diff options
Diffstat (limited to 'drivers/kvm')
-rw-r--r-- | drivers/kvm/kvm.h | 1 | ||||
-rw-r--r-- | drivers/kvm/kvm_main.c | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index 3f5ffc37480d..64983240adca 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h | |||
@@ -520,6 +520,7 @@ struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva); | |||
520 | extern struct page *bad_page; | 520 | extern struct page *bad_page; |
521 | 521 | ||
522 | int is_error_page(struct page *page); | 522 | int is_error_page(struct page *page); |
523 | int kvm_is_error_hva(unsigned long addr); | ||
523 | int kvm_set_memory_region(struct kvm *kvm, | 524 | int kvm_set_memory_region(struct kvm *kvm, |
524 | struct kvm_userspace_memory_region *mem, | 525 | struct kvm_userspace_memory_region *mem, |
525 | int user_alloc); | 526 | int user_alloc); |
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index d395c987894e..dfb65e2f87ee 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -498,6 +498,17 @@ int is_error_page(struct page *page) | |||
498 | } | 498 | } |
499 | EXPORT_SYMBOL_GPL(is_error_page); | 499 | EXPORT_SYMBOL_GPL(is_error_page); |
500 | 500 | ||
501 | static inline unsigned long bad_hva(void) | ||
502 | { | ||
503 | return PAGE_OFFSET; | ||
504 | } | ||
505 | |||
506 | int kvm_is_error_hva(unsigned long addr) | ||
507 | { | ||
508 | return addr == bad_hva(); | ||
509 | } | ||
510 | EXPORT_SYMBOL_GPL(kvm_is_error_hva); | ||
511 | |||
501 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn) | 512 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn) |
502 | { | 513 | { |
503 | int i; | 514 | int i; |