summaryrefslogtreecommitdiff
path: root/include/linux/kvm_host.h
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>2012-08-21 11:02:22 +0800
committerAvi Kivity <avi@redhat.com>2012-08-22 15:09:01 +0300
commit7068d0971524dd47a38f44f6020ba133432871ca (patch)
treece1b9d2b8331c417560a3d53f2bf9c5b52ce9dc0 /include/linux/kvm_host.h
parentca3a490c7de8472b514e2d635c052b1e0f8e1c9d (diff)
downloadlwn-7068d0971524dd47a38f44f6020ba133432871ca.tar.gz
lwn-7068d0971524dd47a38f44f6020ba133432871ca.zip
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 <xiaoguangrong@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r--include/linux/kvm_host.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index b9bba60c298b..a913ac709a9d 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))