summaryrefslogtreecommitdiff
path: root/drivers/kvm/kvm.h
diff options
context:
space:
mode:
authorIzik Eidus <avi@qumranet.com>2007-10-17 19:17:48 +0200
committerAvi Kivity <avi@qumranet.com>2008-01-30 17:52:54 +0200
commitcea7bb21280e3a825e64b54740edc5d3e6e4193c (patch)
treed9714d8c13491a433951b83a176f2a04f6521009 /drivers/kvm/kvm.h
parent9647c14c98687d0abf5197e74b9d1448ab6ebb95 (diff)
downloadlwn-cea7bb21280e3a825e64b54740edc5d3e6e4193c.tar.gz
lwn-cea7bb21280e3a825e64b54740edc5d3e6e4193c.zip
KVM: MMU: Make gfn_to_page() always safe
In case the page is not present in the guest memory map, return a dummy page the guest can scribble on. This simplifies error checking in its users. Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r--drivers/kvm/kvm.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 6ae7b6332e32..0c17c76d030f 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -565,8 +565,9 @@ static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; }
hpa_t gva_to_hpa(struct kvm_vcpu *vcpu, gva_t gva);
struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva);
-extern hpa_t bad_page_address;
+extern struct page *bad_page;
+int is_error_page(struct page *page);
gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn);
struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn);
int kvm_read_guest_page(struct kvm *kvm, gfn_t gfn, void *data, int offset,