From: Paolo Bonzini <pbonzini@redhat.com>
To: Jim Mattson <jmattson@google.com>, kvm@vger.kernel.org
Cc: Junaid Shahid <junaids@google.com>,
Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>,
Nadav Har'El <nyh@il.ibm.com>,
Jun Nakajima <jun.nakajima@intel.com>,
Xinhao Xu <xinhao.xu@intel.com>,
Yang Zhang <yang.z.zhang@Intel.com>,
Gleb Natapov <gleb@redhat.com>
Subject: Re: [PATCH] kvm: nVMX: Remove unnecessary sync_roots from handle_invept
Date: Tue, 2 Jul 2019 18:50:37 +0200 [thread overview]
Message-ID: <7caa0e52-2b2f-9706-e117-abef3aa98a5b@redhat.com> (raw)
In-Reply-To: <20190613161608.120838-1-jmattson@google.com>
On 13/06/19 18:16, Jim Mattson wrote:
> When L0 is executing handle_invept(), the TDP MMU is active. Emulating
> an L1 INVEPT does require synchronizing the appropriate shadow EPT
> root(s), but a call to kvm_mmu_sync_roots in this context won't do
> that. Similarly, the hardware TLB and paging-structure-cache entries
> associated with the appropriate shadow EPT root(s) must be flushed,
> but requesting a TLB_FLUSH from this context won't do that either.
>
> How did this ever work? KVM always does a sync_roots and TLB flush (in
> the correct context) when transitioning from L1 to L2. That isn't the
> best choice for nested VM performance, but it effectively papers over
> the mistakes here.
>
> Remove the unnecessary operations and leave a comment to try to do
> better in the future.
>
> Reported-by: Junaid Shahid <junaids@google.com>
> Fixes: bfd0a56b90005f ("nEPT: Nested INVEPT")
> Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
> Cc: Nadav Har'El <nyh@il.ibm.com>
> Cc: Jun Nakajima <jun.nakajima@intel.com>
> Cc: Xinhao Xu <xinhao.xu@intel.com>
> Cc: Yang Zhang <yang.z.zhang@Intel.com>
> Cc: Gleb Natapov <gleb@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Reviewed-by Peter Shier <pshier@google.com>
> Reviewed-by: Junaid Shahid <junaids@google.com>
> Signed-off-by: Jim Mattson <jmattson@google.com>
> ---
> arch/x86/kvm/vmx/nested.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
Queued, thanks.
Paolo
prev parent reply other threads:[~2019-07-02 16:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-13 16:16 [PATCH] kvm: nVMX: Remove unnecessary sync_roots from handle_invept Jim Mattson
2019-07-02 16:39 ` Jim Mattson
2019-07-02 16:50 ` Paolo Bonzini [this message]
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=7caa0e52-2b2f-9706-e117-abef3aa98a5b@redhat.com \
--to=pbonzini@redhat.com \
--cc=gleb@redhat.com \
--cc=jmattson@google.com \
--cc=jun.nakajima@intel.com \
--cc=junaids@google.com \
--cc=kvm@vger.kernel.org \
--cc=nyh@il.ibm.com \
--cc=xiaoguangrong@linux.vnet.ibm.com \
--cc=xinhao.xu@intel.com \
--cc=yang.z.zhang@Intel.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;
as well as URLs for NNTP newsgroup(s).