提交 02766421 编写于 作者: X Xiao Guangrong 提交者: Paolo Bonzini

KVM: MMU: fix check the reserved bits on the gpte of L2

Current code always uses arch.mmu to check the reserved bits on guest gpte
which is valid only for L1 guest, we should use arch.nested_mmu instead when
we translate gva to gpa for the L2 guest

Fix it by using @mmu instead since it is adapted to the current mmu mode
automatically

The bug can be triggered when nested npt is used and L1 guest and L2 guest
use different mmu mode
Reported-by: NJan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: NGleb Natapov <gleb@redhat.com>
Signed-off-by: NXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 205befd9
...@@ -218,8 +218,7 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker, ...@@ -218,8 +218,7 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker,
if (unlikely(!is_present_gpte(pte))) if (unlikely(!is_present_gpte(pte)))
goto error; goto error;
if (unlikely(is_rsvd_bits_set(&vcpu->arch.mmu, pte, if (unlikely(is_rsvd_bits_set(mmu, pte, walker->level))) {
walker->level))) {
errcode |= PFERR_RSVD_MASK | PFERR_PRESENT_MASK; errcode |= PFERR_RSVD_MASK | PFERR_PRESENT_MASK;
goto error; goto error;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册