aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm.h
diff options
context:
space:
mode:
authorIzik Eidus <avi@qumranet.com>2007-10-17 13:17:48 -0400
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:52:54 -0500
commitcea7bb21280e3a825e64b54740edc5d3e6e4193c (patch)
treed9714d8c13491a433951b83a176f2a04f6521009 /drivers/kvm/kvm.h
parent9647c14c98687d0abf5197e74b9d1448ab6ebb95 (diff)
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; }
565hpa_t gva_to_hpa(struct kvm_vcpu *vcpu, gva_t gva); 565hpa_t gva_to_hpa(struct kvm_vcpu *vcpu, gva_t gva);
566struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva); 566struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva);
567 567
568extern hpa_t bad_page_address; 568extern struct page *bad_page;
569 569
570int is_error_page(struct page *page);
570gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); 571gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn);
571struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); 572struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn);
572int kvm_read_guest_page(struct kvm *kvm, gfn_t gfn, void *data, int offset, 573int kvm_read_guest_page(struct kvm *kvm, gfn_t gfn, void *data, int offset,