From: Xiao Guangrong Date: Mon, 5 Aug 2013 04:59:19 +0000 (+0800) Subject: KVM: MMU: fix check the reserved bits on the gpte of L2 X-Git-Tag: v3.12-rc1~143^2~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=027664216d37afe80101de91f73dfbaf6b36ee65;p=platform%2Fkernel%2Flinux-exynos.git 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: Jan Kiszka Reviewed-by: Gleb Natapov Signed-off-by: Xiao Guangrong Signed-off-by: Paolo Bonzini --- diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index 7769699..3a75828 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h @@ -218,8 +218,7 @@ retry_walk: if (unlikely(!is_present_gpte(pte))) goto error; - if (unlikely(is_rsvd_bits_set(&vcpu->arch.mmu, pte, - walker->level))) { + if (unlikely(is_rsvd_bits_set(mmu, pte, walker->level))) { errcode |= PFERR_RSVD_MASK | PFERR_PRESENT_MASK; goto error; }