Re: [PATCH 09/11] x86/snp: create snp_x86_shutdown()
From: Tycho Andersen
Date: Mon Mar 02 2026 - 17:45:02 EST
Hi Tom,
On Mon, Mar 02, 2026 at 02:35:38PM -0600, Tom Lendacky wrote:
> > +void snp_x86_shutdown(void)
> > +{
>
> Would it make sense to check for SNP being enabled before calling the
> functions below? I realize each of the functions in question will do
> that, but it could save a bunch of IPI's with the on_each_cpu() if SNP
> is still enabled. Not a big deal either way, so:
It is guarded at the call site by:
if (data.x86_snp_shutdown &&
!WARN_ON_ONCE(syscfg & MSR_AMD64_SYSCFG_SNP_EN)) {
if (!panic)
snp_x86_shutdown();
but we could push that into here to protect any future callers.
If we require a v2 I will make the fix.
> Reviewed-by: Tom Lendacky <thomas.lendacky@xxxxxxx>
Thanks for this and the others!
Tycho