From: Bandan Das Subject: Re: [PATCH v2 3/5] KVM: nVMX: Fix returned value of MSR_IA32_VMX_PROCBASED_CTLS Date: Mon, 16 Jun 2014 12:56:36 -0400 Message-ID: References: <9c25dd5a8d9392743b77d904364fa99695e4db5b.1402919981.git.jan.kiszka@siemens.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Paolo Bonzini , kvm To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:33254 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751448AbaFPQ4o (ORCPT ); Mon, 16 Jun 2014 12:56:44 -0400 In-Reply-To: <9c25dd5a8d9392743b77d904364fa99695e4db5b.1402919981.git.jan.kiszka@siemens.com> (Jan Kiszka's message of "Mon, 16 Jun 2014 13:59:42 +0200") Sender: kvm-owner@vger.kernel.org List-ID: Jan Kiszka writes: > SDM says bits 1, 4-6, 8, 13-16, and 26 have to be set. > > Signed-off-by: Jan Kiszka > --- > arch/x86/include/asm/vmx.h | 3 +++ > arch/x86/kvm/vmx.c | 5 +++-- > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h > index d989829..bcbfade 100644 > --- a/arch/x86/include/asm/vmx.h > +++ b/arch/x86/include/asm/vmx.h > @@ -51,6 +51,9 @@ > #define CPU_BASED_MONITOR_EXITING 0x20000000 > #define CPU_BASED_PAUSE_EXITING 0x40000000 > #define CPU_BASED_ACTIVATE_SECONDARY_CONTROLS 0x80000000 > + > +#define CPU_BASED_ALWAYSON_WITHOUT_TRUE_MSR 0x0401e172 > + Nit: Do we want to keep this consistent ? The previous defines have spaces, and you have introduced a tab > /* > * Definitions of Secondary Processor-Based VM-Execution Controls. > */ > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 7568679..475f2dc 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -2306,7 +2306,7 @@ static __init void nested_vmx_setup_ctls_msrs(void) > /* cpu-based controls */ > rdmsr(MSR_IA32_VMX_PROCBASED_CTLS, > nested_vmx_procbased_ctls_low, nested_vmx_procbased_ctls_high); > - nested_vmx_procbased_ctls_low = 0; > + nested_vmx_procbased_ctls_low = CPU_BASED_ALWAYSON_WITHOUT_TRUE_MSR; > nested_vmx_procbased_ctls_high &= > CPU_BASED_VIRTUAL_INTR_PENDING | > CPU_BASED_VIRTUAL_NMI_PENDING | CPU_BASED_USE_TSC_OFFSETING | > @@ -2327,7 +2327,8 @@ static __init void nested_vmx_setup_ctls_msrs(void) > * can use it to avoid exits to L1 - even when L0 runs L2 > * without MSR bitmaps. > */ > - nested_vmx_procbased_ctls_high |= CPU_BASED_USE_MSR_BITMAPS; > + nested_vmx_procbased_ctls_high |= CPU_BASED_ALWAYSON_WITHOUT_TRUE_MSR | > + CPU_BASED_USE_MSR_BITMAPS; > > /* We support free control of CR3 access interception. */ > nested_vmx_true_procbased_ctls_low = nested_vmx_procbased_ctls_low &