mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Zeng Guang <guang.zeng@intel.com>
Subject: Re: [PATCH 0/4] KVM: nVMX: Use vmcs01 ctrls shadow as basis for vmcs02
Date: Tue, 10 Aug 2021 19:39:31 +0200	[thread overview]
Message-ID: <4025c213-b238-7902-9323-ec512eea2d41@redhat.com> (raw)
In-Reply-To: <20210810171952.2758100-1-seanjc@google.com>

On 10/08/21 19:19, Sean Christopherson wrote:
> The goal of this series is to drop the vmx->secondary_exec_control cache
> without degrading nested VM-Enter performance.  The cache is effective,
> e.g. saves ~1000 cycles on nested VM-Enter, but confusing.  The worst of
> the confusion could be eliminated by returning the computed value from
> vmx_compute_secondary_exec_control() to make the calls to the "compute"
> helper more like the other controls.  But, the nested VM-Enter path would
> still have special handling for secondary exec controls, and ideally all
> controls would benefit from caching, though the benefits are marginal for
> other controls and thus difficult to justify.
> 
> Happily, vmcs01 already caches the calculated controls in the
> controls_shadow.  The only issue is that the controls_shadow may have
> dynamically toggled bits set.  However, that is not a fundamental problem,
> it's simply different than what is expected by the nested VM-Enter code
> and is easily remedied.
> 
> TL;DR: Get KVM's (L0's) desires for vmcs02 controls from vmcs01's
> controls_shadow instead of recalculating the desired controls on every
> nested VM-Enter, thus eliminating the need to have a dedicated cache for
> the secondary exec controls calulation.
> 
> Sean Christopherson (4):
>    KVM: VMX: Use current VMCS to query WAITPKG support for MSR emulation
>    KVM: nVMX: Pull KVM L0's desired controls directly from vmcs01
>    KVM: VMX: Drop caching of KVM's desired sec exec controls for vmcs01
>    KVM: VMX: Hide VMCS control calculators in vmx.c
> 
>   arch/x86/kvm/vmx/nested.c | 25 ++++++++++++--------
>   arch/x86/kvm/vmx/vmx.c    | 48 +++++++++++++++++++++++++++------------
>   arch/x86/kvm/vmx/vmx.h    | 35 +++++-----------------------
>   3 files changed, 56 insertions(+), 52 deletions(-)
> 

Queued, thanks (patch 1 for 5.14, the rest for 5.15).

Paolo


      parent reply	other threads:[~2021-08-10 17:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10 17:19 Sean Christopherson
2021-08-10 17:19 ` [PATCH 1/4] KVM: VMX: Use current VMCS to query WAITPKG support for MSR emulation Sean Christopherson
2021-08-10 17:19 ` [PATCH 2/4] KVM: nVMX: Pull KVM L0's desired controls directly from vmcs01 Sean Christopherson
2021-08-10 17:19 ` [PATCH 3/4] KVM: VMX: Drop caching of KVM's desired sec exec controls for vmcs01 Sean Christopherson
2021-08-10 17:19 ` [PATCH 4/4] KVM: VMX: Hide VMCS control calculators in vmx.c Sean Christopherson
2021-08-10 17:39 ` 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=4025c213-b238-7902-9323-ec512eea2d41@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=guang.zeng@intel.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seanjc@google.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.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®