mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Wanpeng Li <kernellwp@gmail.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Wanpeng Li" <wanpeng.li@hotmail.com>,
	"Jim Mattson" <jmattson@google.com>
Subject: Re: [PATCH v3 1/2] KVM: nVMX: Fix EPT switching advertising
Date: Wed, 18 Oct 2017 11:31:11 +0200	[thread overview]
Message-ID: <1cad7936-cbf3-2723-9892-60e66528a2d1@redhat.com> (raw)
In-Reply-To: <1508290980-3525-1-git-send-email-wanpeng.li@hotmail.com>

On 18.10.2017 03:42, Wanpeng Li wrote:
> From: Wanpeng Li <wanpeng.li@hotmail.com>
> 
> I can use vmxcap tool to observe "EPTP Switching   yes" even if EPT is not 
> exposed to L1.
> 
> EPT switching is advertised unconditionally since it is emulated, however, 
> it can be treated as an extended feature for EPT and it should not be 
> advertised if EPT itself is not exposed. This patch fixes it.
> 
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Radim Krčmář <rkrcmar@redhat.com>
> Cc: Jim Mattson <jmattson@google.com>
> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
> ---
> v2 -> v3:
>  * it is legal for the IA32_VMX_VMFUNC MSR to report all-zero
> v1 -> v2:
>  * don't advertise "EPT VM Functions" in secondary processor-based VM-execution 
>    controls if we don't actually support any VM Functions.
> 
>  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;
>  	}
>  
>  	/*
> 

I think we talked about how that cannot happen. But you observe it, so
it seems to happen :)

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 

Thanks,

David

  parent reply	other threads:[~2017-10-18  9:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18  1:42 Wanpeng Li
2017-10-18  1:43 ` [PATCH v3 2/2] KVM: VMX: Fix VPID capability detection Wanpeng Li
2017-10-18 15:39   ` Jim Mattson
2017-10-18 15:40     ` Paolo Bonzini
2017-10-18  9:31 ` David Hildenbrand [this message]
2017-10-18  9:36   ` [PATCH v3 1/2] KVM: nVMX: Fix EPT switching advertising Wanpeng Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1cad7936-cbf3-2723-9892-60e66528a2d1@redhat.com \
    --to=david@redhat.com \
    --cc=jmattson@google.com \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=wanpeng.li@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®