KVM: MMU: Adjust page_header_update_slot() to accept a gfn instead of a gpa
Signed-off-by: Avi Kivity <avi@qumranet.com>
This commit is contained in:
parent
230c9a8f23
commit
38c335f1f5
|
@ -860,9 +860,9 @@ static void mmu_unshadow(struct kvm *kvm, gfn_t gfn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void page_header_update_slot(struct kvm *kvm, void *pte, gpa_t gpa)
|
static void page_header_update_slot(struct kvm *kvm, void *pte, gfn_t gfn)
|
||||||
{
|
{
|
||||||
int slot = memslot_id(kvm, gfn_to_memslot(kvm, gpa >> PAGE_SHIFT));
|
int slot = memslot_id(kvm, gfn_to_memslot(kvm, gfn));
|
||||||
struct kvm_mmu_page *page_head = page_header(__pa(pte));
|
struct kvm_mmu_page *page_head = page_header(__pa(pte));
|
||||||
|
|
||||||
__set_bit(slot, &page_head->slot_bitmap);
|
__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)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
mark_page_dirty(vcpu->kvm, v >> PAGE_SHIFT);
|
mark_page_dirty(vcpu->kvm, v >> PAGE_SHIFT);
|
||||||
page_header_update_slot(vcpu->kvm, table, v);
|
page_header_update_slot(vcpu->kvm, table,
|
||||||
|
v >> PAGE_SHIFT);
|
||||||
table[index] = p | PT_PRESENT_MASK | PT_WRITABLE_MASK |
|
table[index] = p | PT_PRESENT_MASK | PT_WRITABLE_MASK |
|
||||||
PT_USER_MASK;
|
PT_USER_MASK;
|
||||||
if (!was_rmapped)
|
if (!was_rmapped)
|
||||||
|
|
|
@ -259,8 +259,7 @@ unshadowed:
|
||||||
|
|
||||||
pgprintk("%s: setting spte %llx\n", __FUNCTION__, spte);
|
pgprintk("%s: setting spte %llx\n", __FUNCTION__, spte);
|
||||||
set_shadow_pte(shadow_pte, spte);
|
set_shadow_pte(shadow_pte, spte);
|
||||||
page_header_update_slot(vcpu->kvm, shadow_pte,
|
page_header_update_slot(vcpu->kvm, shadow_pte, gfn);
|
||||||
(gpa_t)gfn << PAGE_SHIFT);
|
|
||||||
if (!was_rmapped) {
|
if (!was_rmapped) {
|
||||||
rmap_add(vcpu, shadow_pte, gfn);
|
rmap_add(vcpu, shadow_pte, gfn);
|
||||||
if (!is_rmap_pte(*shadow_pte))
|
if (!is_rmap_pte(*shadow_pte))
|
||||||
|
|
Loading…
Reference in New Issue