Re: [PATCH v10 2/6] x86/sev: Initialize RMPOPT configuration MSRs

From: Borislav Petkov

Date: Thu Jul 23 2026 - 14:36:10 EST


On Thu, Jul 23, 2026 at 01:50:48AM -0500, Kalra, Ashish wrote:
> > What happens if you boot with a subset of cores, the boot flow enables RMPOPT
> > and then you online the rest?
> >
> > Have we tried that?
> >
> It can't happen here. snp_prepare() does the following, in order:

Then the comment in the code is greatly misleading:

/*
* The RMPOPT_BASE MSR is per-core, so only one thread per core needs
* to set up the RMPOPT_BASE MSR.
*
* Note: only online primary threads are included. If a core's
* primary thread is offline, that core is not covered. CPU hotplug
* is not currently supported with SNP enabled.
*/
scoped_guard(cpus_read_lock) {
for_each_online_cpu(cpu)
if (topology_is_primary_thread(cpu))

I'd expect to read there:

/*
* The RMPOPT_BASE MSR is per-core, so only one thread per core needs
* to set up the RMPOPT_BASE MSR. All primary threads are online,
* otherwise SNP would not have been enabled.
*/

--
Regards/Gruss,
Boris.

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