[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171102173650.GT22924@char.us.oracle.com>
Date: Thu, 2 Nov 2017 13:36:50 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To: Wanpeng Li <kernellwp@...il.com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>,
Wanpeng Li <wanpeng.li@...mail.com>,
Jim Mattson <jmattson@...gle.com>
Subject: Re: [PATCH v3 2/3] KVM: nVMX: Validate the IA32_BNDCFGS on nested
VM-entry
On Thu, Nov 02, 2017 at 01:31:38AM -0700, Wanpeng Li wrote:
> From: Wanpeng Li <wanpeng.li@...mail.com>
>
> According to the SDM, if the "load IA32_BNDCFGS" VM-entry controls is 1, the
> following checks are performed on the field for the IA32_BNDCFGS MSR:
> - Bits reserved in the IA32_BNDCFGS MSR must be 0.
> - The linear address in bits 63:12 must be canonical.
>
> Cc: Paolo Bonzini <pbonzini@...hat.com>
> Cc: Radim Krčmář <rkrcmar@...hat.com>
> Cc: Jim Mattson <jmattson@...gle.com>
> Signed-off-by: Wanpeng Li <wanpeng.li@...mail.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
> ---
> arch/x86/kvm/vmx.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index e6c8ffa..f29f57d 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -10805,6 +10805,13 @@ static int check_vmentry_postreqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12,
> return 1;
> }
>
> + if (kvm_mpx_supported() &&
> + (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_BNDCFGS)) {
> + if (is_noncanonical_address(vmcs12->guest_bndcfgs & PAGE_MASK, vcpu) ||
> + (vmcs12->guest_bndcfgs & MSR_IA32_BNDCFGS_RSVD))
> + return 1;
> + }
> +
> return 0;
> }
>
> --
> 2.7.4
>
Powered by blists - more mailing lists