Linux Confidential Computing Development
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "Kalra, Ashish" <ashish.kalra@amd.com>
Cc: tglx@kernel.org, mingo@redhat.com, dave.hansen@linux.intel.com,
	x86@kernel.org, hpa@zytor.com, seanjc@google.com,
	peterz@infradead.org, thomas.lendacky@amd.com,
	herbert@gondor.apana.org.au, davem@davemloft.net,
	ardb@kernel.org, pbonzini@redhat.com, aik@amd.com,
	Michael.Roth@amd.com, KPrateek.Nayak@amd.com,
	Tycho.Andersen@amd.com, Nathan.Fontenot@amd.com,
	ackerleytng@google.com, jackyli@google.com, pgonda@google.com,
	rientjes@google.com, jacobhxu@google.com, xin@zytor.com,
	pawan.kumar.gupta@linux.intel.com, babu.moger@amd.com,
	dyoung@redhat.com, nikunj@amd.com, john.allen@amd.com,
	darwi@linutronix.de, linux-kernel@vger.kernel.org,
	linux-crypto@vger.kernel.org, kvm@vger.kernel.org,
	linux-coco@lists.linux.dev
Subject: Re: [PATCH v9 3/6] x86/sev: Disable CPU hotplug while SNP is active
Date: Fri, 26 Jun 2026 21:41:17 -0700	[thread overview]
Message-ID: <20260627044117.GEaj9UbSvTExfmFilu@fat_crate.local> (raw)
In-Reply-To: <9d019b55-739d-429c-bb34-ce792e8340b6@amd.com>

On Fri, Jun 26, 2026 at 03:59:34PM -0500, Kalra, Ashish wrote:
> It can be that simple, and flag-free, by following the SNP_EN state:

Maybe. But that doesn't mean that you should not clean things up first where
needed. But I'll do a proper review once the dust from patchsets flying around
settles.

> We also have to re-enable cpu hotplug on the init failure paths 
> (snp_prepare()'s online != present check, and the SNP_INIT_EX / DF_FLUSH failures in 
> __sev_snp_init_locked()), so a failed init leaves hotplug enabled, as it was before
> this support.

You could also block hotplug for the time being by grabbing cpus_read_lock().
And only when you know you are all clear to disable hotplug, then you can do
that in the end and drop the hotplug lock.

> The only extra case is a kexec target that boots with SNP_EN already set (legacy
> firmware -- on X86_SNP_SHUTDOWN firmware the full shutdown required before kexec
> clears SNP_EN, so the target re-inits normally). There snp_prepare() bails, so I
> do the disable once at boot in snp_rmptable_init() when SNP_EN is already set.
> That and the snp_prepare() disable can't both run -- SNP_EN is either already set
> at boot, or it gets programmed by snp_prepare().

Ok.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

  reply	other threads:[~2026-06-27  4:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1782336473.git.ashish.kalra@amd.com>
2026-06-24 21:56 ` [PATCH v9 1/6] x86/cpufeatures: Add X86_FEATURE_RMPOPT feature flag Ashish Kalra
2026-06-24 21:56 ` [PATCH v9 2/6] x86/sev: Initialize RMPOPT configuration MSRs Ashish Kalra
2026-06-24 21:56 ` [PATCH v9 3/6] x86/sev: Disable CPU hotplug while SNP is active Ashish Kalra
2026-06-25  3:45   ` K Prateek Nayak
2026-06-25  5:38     ` Kalra, Ashish
2026-06-30 14:18     ` Tom Lendacky
2026-06-25 15:02   ` Borislav Petkov
2026-06-25 19:42     ` Kalra, Ashish
2026-06-25 22:16       ` K Prateek Nayak
2026-06-26  2:38         ` Kalra, Ashish
2026-06-26  4:01           ` K Prateek Nayak
2026-06-26 20:23             ` Kalra, Ashish
2026-06-26 16:40       ` Borislav Petkov
2026-06-26 20:59         ` Kalra, Ashish
2026-06-27  4:41           ` Borislav Petkov [this message]
2026-06-29  3:05             ` K Prateek Nayak
2026-06-29  3:11               ` Kalra, Ashish
2026-06-24 21:57 ` [PATCH v9 4/6] x86/sev: Add support to perform RMP optimizations asynchronously Ashish Kalra
2026-06-24 21:58 ` [PATCH v9 5/6] x86/sev: Add interface to re-enable RMP optimizations Ashish Kalra
2026-06-24 21:59 ` [PATCH v9 6/6] KVM: SEV: Perform RMP optimizations on SNP guest shutdown Ashish Kalra

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=20260627044117.GEaj9UbSvTExfmFilu@fat_crate.local \
    --to=bp@alien8.de \
    --cc=KPrateek.Nayak@amd.com \
    --cc=Michael.Roth@amd.com \
    --cc=Nathan.Fontenot@amd.com \
    --cc=Tycho.Andersen@amd.com \
    --cc=ackerleytng@google.com \
    --cc=aik@amd.com \
    --cc=ardb@kernel.org \
    --cc=ashish.kalra@amd.com \
    --cc=babu.moger@amd.com \
    --cc=darwi@linutronix.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=dyoung@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=jackyli@google.com \
    --cc=jacobhxu@google.com \
    --cc=john.allen@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nikunj@amd.com \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pgonda@google.com \
    --cc=rientjes@google.com \
    --cc=seanjc@google.com \
    --cc=tglx@kernel.org \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    --cc=xin@zytor.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