All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Yosry Ahmed <yosry.ahmed@linux.dev>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] KVM: SVM: Refactor EFER.SVME switching logic out of svm_set_efer()
Date: Wed, 4 Feb 2026 10:49:56 -0800	[thread overview]
Message-ID: <aYOU1NLFmk1roKY5@google.com> (raw)
In-Reply-To: <20260130020735.2517101-2-yosry.ahmed@linux.dev>

On Fri, Jan 30, 2026, Yosry Ahmed wrote:
> Move the logic of switching EFER.SVME in the guest outside of
> svm_set_efer(). This makes it possible to easily check the skip
> conditions separately (and add more) and reduce indentation level.
> 
> No functional change intended.
> 
> Signed-off-by: Yosry Ahmed <yosry.ahmed@linux.dev>
> ---
>  arch/x86/kvm/svm/svm.c | 72 ++++++++++++++++++++++++------------------
>  1 file changed, 42 insertions(+), 30 deletions(-)
> 
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index 5f0136dbdde6b..4575a6a7d6c4e 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -200,11 +200,49 @@ static int get_npt_level(void)
>  #endif
>  }
>  
> +static int svm_set_efer_svme(struct kvm_vcpu *vcpu, u64 old_efer, u64 new_efer)

Code looks good, but I think we need a better name.  This helper doesn't actually
write vcpu->arch.efer, and the name can also be misconstrued as "set EFER.SVME=1".

How about svm_post_set_efer(), to align with kvm_post_set_cr{0,3,4}()?  It's not
perfect, but I can't come up with something that's more accurate without being
stupidly verbose.

  reply	other threads:[~2026-02-04 18:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-30  2:07 [PATCH 0/3] KVM: nSVM: Stop tracking EFER.SVME in guest mode Yosry Ahmed
2026-01-30  2:07 ` [PATCH 1/3] KVM: SVM: Refactor EFER.SVME switching logic out of svm_set_efer() Yosry Ahmed
2026-02-04 18:49   ` Sean Christopherson [this message]
2026-01-30  2:07 ` [PATCH 2/3] KVM: nSVM: Do not track EFER.SVME toggling in guest mode Yosry Ahmed
2026-02-04 21:15   ` Sean Christopherson
2026-02-04 23:30     ` Yosry Ahmed
2026-02-05  2:10       ` Sean Christopherson
2026-01-30  2:07 ` [PATCH 3/3] KVM: selftests: Add a test for L2 toggling EFER.SVME Yosry Ahmed

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=aYOU1NLFmk1roKY5@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=yosry.ahmed@linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.