diff options
-rw-r--r-- | include/linux/kvm_host.h | 6 | ||||
-rw-r--r-- | virt/kvm/kvm_main.c | 17 |
2 files changed, 5 insertions, 18 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index ab428552af8e..57d7092d7717 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -365,7 +365,6 @@ pfn_t gfn_to_pfn_prot(struct kvm *kvm, gfn_t gfn, bool write_fault, | |||
365 | bool *writable); | 365 | bool *writable); |
366 | pfn_t gfn_to_pfn_memslot(struct kvm *kvm, | 366 | pfn_t gfn_to_pfn_memslot(struct kvm *kvm, |
367 | struct kvm_memory_slot *slot, gfn_t gfn); | 367 | struct kvm_memory_slot *slot, gfn_t gfn); |
368 | int memslot_id(struct kvm *kvm, gfn_t gfn); | ||
369 | void kvm_release_pfn_dirty(pfn_t); | 368 | void kvm_release_pfn_dirty(pfn_t); |
370 | void kvm_release_pfn_clean(pfn_t pfn); | 369 | void kvm_release_pfn_clean(pfn_t pfn); |
371 | void kvm_set_pfn_dirty(pfn_t pfn); | 370 | void kvm_set_pfn_dirty(pfn_t pfn); |
@@ -597,6 +596,11 @@ static inline void kvm_guest_exit(void) | |||
597 | current->flags &= ~PF_VCPU; | 596 | current->flags &= ~PF_VCPU; |
598 | } | 597 | } |
599 | 598 | ||
599 | static inline int memslot_id(struct kvm *kvm, gfn_t gfn) | ||
600 | { | ||
601 | return gfn_to_memslot(kvm, gfn)->id; | ||
602 | } | ||
603 | |||
600 | static inline unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, | 604 | static inline unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, |
601 | gfn_t gfn) | 605 | gfn_t gfn) |
602 | { | 606 | { |
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 6330653480e4..58146457bf97 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -996,23 +996,6 @@ out: | |||
996 | return size; | 996 | return size; |
997 | } | 997 | } |
998 | 998 | ||
999 | int memslot_id(struct kvm *kvm, gfn_t gfn) | ||
1000 | { | ||
1001 | int i; | ||
1002 | struct kvm_memslots *slots = kvm_memslots(kvm); | ||
1003 | struct kvm_memory_slot *memslot = NULL; | ||
1004 | |||
1005 | for (i = 0; i < slots->nmemslots; ++i) { | ||
1006 | memslot = &slots->memslots[i]; | ||
1007 | |||
1008 | if (gfn >= memslot->base_gfn | ||
1009 | && gfn < memslot->base_gfn + memslot->npages) | ||
1010 | break; | ||
1011 | } | ||
1012 | |||
1013 | return memslot - slots->memslots; | ||
1014 | } | ||
1015 | |||
1016 | static unsigned long gfn_to_hva_many(struct kvm_memory_slot *slot, gfn_t gfn, | 999 | static unsigned long gfn_to_hva_many(struct kvm_memory_slot *slot, gfn_t gfn, |
1017 | gfn_t *nr_pages) | 1000 | gfn_t *nr_pages) |
1018 | { | 1001 | { |