Re: [PATCH v3 1/2] x86/sev: Do not initialize SNP if missing CPUs

From: Borislav Petkov

Date: Fri Apr 17 2026 - 17:57:49 EST


On Thu, Apr 09, 2026 at 01:56:01PM -0600, Tycho Andersen wrote:
> @@ -521,12 +522,20 @@ void snp_prepare(void)
> */
> rdmsrq(MSR_AMD64_SYSCFG, val);
> if (val & MSR_AMD64_SYSCFG_SNP_EN)
> - return;
> + return 0;
>
> clear_rmp();
>
> cpus_read_lock();
>
> + if (!cpumask_equal(cpu_online_mask, cpu_present_mask)) {
> + ret = -EOPNOTSUPP;
> + pr_warn("Skipping SNP initialization. CPUs online %*pbl, present %*pbl\n",

You need to say why exactly you're aborting here:

"SNP init failed: not all CPUs online: (%*pbl online <-> %*pbl present masks)."

or something along those lines.

--
Regards/Gruss,
Boris.

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