diff options
-rw-r--r-- | arch/s390/include/asm/kvm_host.h | 8 | ||||
-rw-r--r-- | include/linux/kvm_host.h | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h index 3238d4004e84..e87ecaa2c569 100644 --- a/arch/s390/include/asm/kvm_host.h +++ b/arch/s390/include/asm/kvm_host.h | |||
@@ -274,6 +274,14 @@ struct kvm_arch{ | |||
274 | int css_support; | 274 | int css_support; |
275 | }; | 275 | }; |
276 | 276 | ||
277 | #define KVM_HVA_ERR_BAD (-1UL) | ||
278 | #define KVM_HVA_ERR_RO_BAD (-2UL) | ||
279 | |||
280 | static inline bool kvm_is_error_hva(unsigned long addr) | ||
281 | { | ||
282 | return IS_ERR_VALUE(addr); | ||
283 | } | ||
284 | |||
277 | extern int sie64a(struct kvm_s390_sie_block *, u64 *); | 285 | extern int sie64a(struct kvm_s390_sie_block *, u64 *); |
278 | extern char sie_exit; | 286 | extern char sie_exit; |
279 | #endif | 287 | #endif |
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 | ||
98 | static inline bool is_error_page(struct page *page) | 106 | static inline bool is_error_page(struct page *page) |