[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130805060324.GA1550@redhat.com>
Date: Mon, 5 Aug 2013 09:03:24 +0300
From: Gleb Natapov <gleb@...hat.com>
To: Xiao Guangrong <xiaoguangrong@...ux.vnet.ibm.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Jan Kiszka <jan.kiszka@...mens.com>,
LKML <linux-kernel@...r.kernel.org>, KVM <kvm@...r.kernel.org>
Subject: Re: [PATCH] KVM: MMU: fix check the reserved bits on the gpte of L2
On Mon, Aug 05, 2013 at 12:59:19PM +0800, Xiao Guangrong wrote:
> 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 <jan.kiszka@...mens.com>
> Signed-off-by: Xiao Guangrong <xiaoguangrong@...ux.vnet.ibm.com>
Reviewed-by: Gleb Natapov <gleb@...hat.com>
> ---
> arch/x86/kvm/paging_tmpl.h | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> 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;
> }
> --
> 1.8.1.4
--
Gleb.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists