diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kvm_host.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index c13cc48697aa..307d0e2c0f59 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -296,6 +296,7 @@ void kvm_release_page_dirty(struct page *page); | |||
296 | void kvm_set_page_dirty(struct page *page); | 296 | void kvm_set_page_dirty(struct page *page); |
297 | void kvm_set_page_accessed(struct page *page); | 297 | void kvm_set_page_accessed(struct page *page); |
298 | 298 | ||
299 | pfn_t hva_to_pfn_atomic(struct kvm *kvm, unsigned long addr); | ||
299 | pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn); | 300 | pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn); |
300 | pfn_t gfn_to_pfn_memslot(struct kvm *kvm, | 301 | pfn_t gfn_to_pfn_memslot(struct kvm *kvm, |
301 | struct kvm_memory_slot *slot, gfn_t gfn); | 302 | struct kvm_memory_slot *slot, gfn_t gfn); |
@@ -518,6 +519,12 @@ static inline void kvm_guest_exit(void) | |||
518 | current->flags &= ~PF_VCPU; | 519 | current->flags &= ~PF_VCPU; |
519 | } | 520 | } |
520 | 521 | ||
522 | static inline unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, | ||
523 | gfn_t gfn) | ||
524 | { | ||
525 | return slot->userspace_addr + (gfn - slot->base_gfn) * PAGE_SIZE; | ||
526 | } | ||
527 | |||
521 | static inline gpa_t gfn_to_gpa(gfn_t gfn) | 528 | static inline gpa_t gfn_to_gpa(gfn_t gfn) |
522 | { | 529 | { |
523 | return (gpa_t)gfn << PAGE_SHIFT; | 530 | return (gpa_t)gfn << PAGE_SHIFT; |