aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDominik Dingel <dingel@linux.vnet.ibm.com>2013-07-26 09:04:07 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2013-07-29 03:03:53 -0400
commitbf640876e21fe603f7f52b0c27d66b7716da0384 (patch)
tree981a401df9e8ede64cfe07aa0a86e20ff51153f9 /include
parentea828ebf59f5b56e7261bfaeb94393c9dcb86260 (diff)
KVM: s390: Make KVM_HVA_ERR_BAD usable on s390
Current common code uses PAGE_OFFSET to indicate a bad host virtual address. As this check won't work on architectures that don't map kernel and user memory into the same address space (e.g. s390), such architectures can now provide their own KVM_HVA_ERR_BAD defines. Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/kvm_host.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index c11c7686ae5f..ca645a01d37a 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -85,6 +85,12 @@ static inline bool is_noslot_pfn(pfn_t pfn)
85 return pfn == KVM_PFN_NOSLOT; 85 return pfn == KVM_PFN_NOSLOT;
86} 86}
87 87
88/*
89 * architectures with KVM_HVA_ERR_BAD other than PAGE_OFFSET (e.g. s390)
90 * provide own defines and kvm_is_error_hva
91 */
92#ifndef KVM_HVA_ERR_BAD
93
88#define KVM_HVA_ERR_BAD (PAGE_OFFSET) 94#define KVM_HVA_ERR_BAD (PAGE_OFFSET)
89#define KVM_HVA_ERR_RO_BAD (PAGE_OFFSET + PAGE_SIZE) 95#define KVM_HVA_ERR_RO_BAD (PAGE_OFFSET + PAGE_SIZE)
90 96
@@ -93,6 +99,8 @@ static inline bool kvm_is_error_hva(unsigned long addr)
93 return addr >= PAGE_OFFSET; 99 return addr >= PAGE_OFFSET;
94} 100}
95 101
102#endif
103
96#define KVM_ERR_PTR_BAD_PAGE (ERR_PTR(-ENOENT)) 104#define KVM_ERR_PTR_BAD_PAGE (ERR_PTR(-ENOENT))
97 105
98static inline bool is_error_page(struct page *page) 106static inline bool is_error_page(struct page *page)