Re: [PATCH v1 1/2] x86/sev: Do not initialize SNP if missing CPUs
From: Tycho Andersen
Date: Fri Apr 03 2026 - 13:52:17 EST
On Fri, Apr 03, 2026 at 07:18:33PM +0200, Borislav Petkov wrote:
> On Fri, Apr 03, 2026 at 08:31:24AM -0500, Tom Lendacky wrote:
> > > + if (!cpumask_equal(cpu_online_mask, cpu_possible_mask))
> >
> > If CONFIG_INIT_ALL_POSSIBLE is set, won't that set cpu_possible_mask to
> > include all CPUs up to NR_CPUS? That would result in this always failing.
Thanks, I didn't know about this config.
> Yah,
>
> sashiko gave another possible situation where this can fail:
>
> https://sashiko.dev/#/patchset/20260401143552.3038979-1-tycho%40kernel.org
> disabled ACPI MADT entries for hotplug
I suppose depends on how the firmware reasons about such things too.
But it seems like the suggestion of cpus_present_mask is right.
> > Not sure if this change is worth it.
>
> Well, it would save us a lot of effort if we can check at module load time
> whether some CPUs are offlined. A very simple use case:
>
> echo 0 > /sys/devices/system/cpu.../online
> modprobe ccp
This is how I was testing this, but I'll see about testing the ACPI
thing too.
Tycho