aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/mmu.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-11-21 07:20:22 -0500
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:53:11 -0500
commit38c335f1f57bd9edc3cd894e8f5f3fc133320ad3 (patch)
tree583a41cb7c639dcf6286deddd2ff55ef50bfd09e /drivers/kvm/mmu.c
parent230c9a8f2354dc51f55bf81147f408d8fc2f3dd1 (diff)
KVM: MMU: Adjust page_header_update_slot() to accept a gfn instead of a gpa
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/mmu.c')
-rw-r--r--drivers/kvm/mmu.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c
index c3362ba33b0a..1dcffc49eff8 100644
--- a/drivers/kvm/mmu.c
+++ b/drivers/kvm/mmu.c
@@ -860,9 +860,9 @@ static void mmu_unshadow(struct kvm *kvm, gfn_t gfn)
860 } 860 }
861} 861}
862 862
863static void page_header_update_slot(struct kvm *kvm, void *pte, gpa_t gpa) 863static void page_header_update_slot(struct kvm *kvm, void *pte, gfn_t gfn)
864{ 864{
865 int slot = memslot_id(kvm, gfn_to_memslot(kvm, gpa >> PAGE_SHIFT)); 865 int slot = memslot_id(kvm, gfn_to_memslot(kvm, gfn));
866 struct kvm_mmu_page *page_head = page_header(__pa(pte)); 866 struct kvm_mmu_page *page_head = page_header(__pa(pte));
867 867
868 __set_bit(slot, &page_head->slot_bitmap); 868 __set_bit(slot, &page_head->slot_bitmap);
@@ -928,7 +928,8 @@ static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, hpa_t p)
928 return 0; 928 return 0;
929 } 929 }
930 mark_page_dirty(vcpu->kvm, v >> PAGE_SHIFT); 930 mark_page_dirty(vcpu->kvm, v >> PAGE_SHIFT);
931 page_header_update_slot(vcpu->kvm, table, v); 931 page_header_update_slot(vcpu->kvm, table,
932 v >> PAGE_SHIFT);
932 table[index] = p | PT_PRESENT_MASK | PT_WRITABLE_MASK | 933 table[index] = p | PT_PRESENT_MASK | PT_WRITABLE_MASK |
933 PT_USER_MASK; 934 PT_USER_MASK;
934 if (!was_rmapped) 935 if (!was_rmapped)