diff options
author | Izik Eidus <avi@qumranet.com> | 2007-10-17 13:17:48 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:52:54 -0500 |
commit | cea7bb21280e3a825e64b54740edc5d3e6e4193c (patch) | |
tree | d9714d8c13491a433951b83a176f2a04f6521009 /drivers/kvm/kvm.h | |
parent | 9647c14c98687d0abf5197e74b9d1448ab6ebb95 (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.h | 3 |
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; } | |||
565 | hpa_t gva_to_hpa(struct kvm_vcpu *vcpu, gva_t gva); | 565 | hpa_t gva_to_hpa(struct kvm_vcpu *vcpu, gva_t gva); |
566 | struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva); | 566 | struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva); |
567 | 567 | ||
568 | extern hpa_t bad_page_address; | 568 | extern struct page *bad_page; |
569 | 569 | ||
570 | int is_error_page(struct page *page); | ||
570 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); | 571 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); |
571 | struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); | 572 | struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); |
572 | int kvm_read_guest_page(struct kvm *kvm, gfn_t gfn, void *data, int offset, | 573 | int kvm_read_guest_page(struct kvm *kvm, gfn_t gfn, void *data, int offset, |