*/
struct guest_walker {
int level;
+ gfn_t table_gfn;
pt_element_t *table;
pt_element_t inherited_ar;
};
struct kvm_memory_slot *slot;
walker->level = vcpu->mmu.root_level;
- slot = gfn_to_memslot(vcpu->kvm,
- (vcpu->cr3 & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT);
+ walker->table_gfn = (vcpu->cr3 & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT;
+ slot = gfn_to_memslot(vcpu->kvm, walker->table_gfn);
hpa = safe_gpa_to_hpa(vcpu, vcpu->cr3 & PT64_BASE_ADDR_MASK);
walker->table = kmap_atomic(pfn_to_page(hpa >> PAGE_SHIFT), KM_USER0);
return &walker->table[index];
if (walker->level != 3 || is_long_mode(vcpu))
walker->inherited_ar &= walker->table[index];
+ walker->table_gfn = (walker->table[index] & PT_BASE_ADDR_MASK)
+ >> PAGE_SHIFT;
paddr = safe_gpa_to_hpa(vcpu, walker->table[index] & PT_BASE_ADDR_MASK);
kunmap_atomic(walker->table, KM_USER0);
walker->table = kmap_atomic(pfn_to_page(paddr >> PAGE_SHIFT),