mirror of https://gitee.com/openkylin/linux.git
KVM: MMU: cleanup __direct_map
Use link_shadow_page to link the sp to the spte in __direct_map Reviewed-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
parent
f761620377
commit
24db2734ad
|
@ -1947,9 +1947,9 @@ static void link_shadow_page(u64 *sptep, struct kvm_mmu_page *sp)
|
||||||
{
|
{
|
||||||
u64 spte;
|
u64 spte;
|
||||||
|
|
||||||
spte = __pa(sp->spt)
|
spte = __pa(sp->spt) | PT_PRESENT_MASK | PT_WRITABLE_MASK |
|
||||||
| PT_PRESENT_MASK | PT_ACCESSED_MASK
|
shadow_user_mask | shadow_x_mask | shadow_accessed_mask;
|
||||||
| PT_WRITABLE_MASK | PT_USER_MASK;
|
|
||||||
mmu_spte_set(sptep, spte);
|
mmu_spte_set(sptep, spte);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2592,11 +2592,7 @@ static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write,
|
||||||
iterator.level - 1,
|
iterator.level - 1,
|
||||||
1, ACC_ALL, iterator.sptep);
|
1, ACC_ALL, iterator.sptep);
|
||||||
|
|
||||||
mmu_spte_set(iterator.sptep,
|
link_shadow_page(iterator.sptep, sp);
|
||||||
__pa(sp->spt)
|
|
||||||
| PT_PRESENT_MASK | PT_WRITABLE_MASK
|
|
||||||
| shadow_user_mask | shadow_x_mask
|
|
||||||
| shadow_accessed_mask);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return emulate;
|
return emulate;
|
||||||
|
|
Loading…
Reference in New Issue