[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANRm+CyNQOazchzG+srCkCT8M8Yqd-O30TpRFztc7YS-GXvnKg@mail.gmail.com>
Date: Tue, 17 Oct 2017 11:12:52 +0800
From: Wanpeng Li <kernellwp@...il.com>
To: Jim Mattson <jmattson@...gle.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kvm list <kvm@...r.kernel.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>,
Wanpeng Li <wanpeng.li@...mail.com>
Subject: Re: [PATCH 1/2] KVM: VMX: Don't advertise EPT switching if EPT itself
is not exposed
2017-10-17 1:16 GMT+08:00 Jim Mattson <jmattson@...gle.com>:
> Does it still make sense to advertise "Enable VM Functions" in the
> secondary processor-based VM-execution controls if we don't actually
> support any VM Functions?
Will do in v2. Thanks for your review.
Regards,
Wanpeng Li
>
> On Sat, Oct 14, 2017 at 7:31 PM, Wanpeng Li <kernellwp@...il.com> wrote:
>> From: Wanpeng Li <wanpeng.li@...mail.com>
>>
>> EPT switching is advertised unconditionally since it is emulated, however, it can
>> be treated as an extended feature for EPT, it should be not advertised if EPT itself
>> is not exposed. This patch fixes it.
>>
>> Cc: Paolo Bonzini <pbonzini@...hat.com>
>> Cc: Radim Krčmář <rkrcmar@...hat.com>
>> Signed-off-by: Wanpeng Li <wanpeng.li@...mail.com>
>> ---
>> arch/x86/kvm/vmx.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>> index c460b0b..3644540 100644
>> --- a/arch/x86/kvm/vmx.c
>> +++ b/arch/x86/kvm/vmx.c
>> @@ -2842,8 +2842,9 @@ static void nested_vmx_setup_ctls_msrs(struct vcpu_vmx *vmx)
>> * Advertise EPTP switching unconditionally
>> * since we emulate it
>> */
>> - vmx->nested.nested_vmx_vmfunc_controls =
>> - VMX_VMFUNC_EPTP_SWITCHING;
>> + if (enable_ept)
>> + vmx->nested.nested_vmx_vmfunc_controls =
>> + VMX_VMFUNC_EPTP_SWITCHING;
>> }
>>
>> /*
>> --
>> 2.7.4
>>
Powered by blists - more mailing lists