diff options
Diffstat (limited to 'drivers/kvm/mmu.c')
-rw-r--r-- | drivers/kvm/mmu.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index 376800a33968..8bdb9ca1811c 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c | |||
@@ -390,13 +390,11 @@ static void rmap_write_protect(struct kvm_vcpu *vcpu, u64 gfn) | |||
390 | { | 390 | { |
391 | struct kvm *kvm = vcpu->kvm; | 391 | struct kvm *kvm = vcpu->kvm; |
392 | struct page *page; | 392 | struct page *page; |
393 | struct kvm_memory_slot *slot; | ||
394 | struct kvm_rmap_desc *desc; | 393 | struct kvm_rmap_desc *desc; |
395 | u64 *spte; | 394 | u64 *spte; |
396 | 395 | ||
397 | slot = gfn_to_memslot(kvm, gfn); | 396 | page = gfn_to_page(kvm, gfn); |
398 | BUG_ON(!slot); | 397 | BUG_ON(!page); |
399 | page = gfn_to_page(slot, gfn); | ||
400 | 398 | ||
401 | while (page_private(page)) { | 399 | while (page_private(page)) { |
402 | if (!(page_private(page) & 1)) | 400 | if (!(page_private(page) & 1)) |
@@ -711,14 +709,12 @@ hpa_t safe_gpa_to_hpa(struct kvm_vcpu *vcpu, gpa_t gpa) | |||
711 | 709 | ||
712 | hpa_t gpa_to_hpa(struct kvm_vcpu *vcpu, gpa_t gpa) | 710 | hpa_t gpa_to_hpa(struct kvm_vcpu *vcpu, gpa_t gpa) |
713 | { | 711 | { |
714 | struct kvm_memory_slot *slot; | ||
715 | struct page *page; | 712 | struct page *page; |
716 | 713 | ||
717 | ASSERT((gpa & HPA_ERR_MASK) == 0); | 714 | ASSERT((gpa & HPA_ERR_MASK) == 0); |
718 | slot = gfn_to_memslot(vcpu->kvm, gpa >> PAGE_SHIFT); | 715 | page = gfn_to_page(vcpu->kvm, gpa >> PAGE_SHIFT); |
719 | if (!slot) | 716 | if (!page) |
720 | return gpa | HPA_ERR_MASK; | 717 | return gpa | HPA_ERR_MASK; |
721 | page = gfn_to_page(slot, gpa >> PAGE_SHIFT); | ||
722 | return ((hpa_t)page_to_pfn(page) << PAGE_SHIFT) | 718 | return ((hpa_t)page_to_pfn(page) << PAGE_SHIFT) |
723 | | (gpa & (PAGE_SIZE-1)); | 719 | | (gpa & (PAGE_SIZE-1)); |
724 | } | 720 | } |