From: Xiao Guangrong Date: Tue, 21 Aug 2012 03:02:22 +0000 (+0800) Subject: KVM: introduce KVM_HVA_ERR_RO_BAD X-Git-Tag: v3.7-rc1~113^2~45 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=7068d0971524dd47a38f44f6020ba133432871ca;p=~emulex%2Finfiniband.git KVM: introduce KVM_HVA_ERR_RO_BAD In the later patch, it indicates failure when we try to get a writable hva from the readonly memslot Signed-off-by: Xiao Guangrong Signed-off-by: Avi Kivity --- diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index b9bba60c298..a913ac709a9 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -82,11 +82,12 @@ static inline bool is_invalid_pfn(pfn_t pfn) return !is_noslot_pfn(pfn) && is_error_pfn(pfn); } -#define KVM_HVA_ERR_BAD (PAGE_OFFSET) +#define KVM_HVA_ERR_BAD (PAGE_OFFSET) +#define KVM_HVA_ERR_RO_BAD (PAGE_OFFSET + PAGE_SIZE) static inline bool kvm_is_error_hva(unsigned long addr) { - return addr == PAGE_OFFSET; + return addr >= PAGE_OFFSET; } #define KVM_ERR_PTR_BAD_PAGE (ERR_PTR(-ENOENT))