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

From: Borislav Petkov

Date: Mon Jul 20 2026 - 18:19:56 EST


On Tue, Jun 30, 2026 at 06:10:13PM +0000, Ashish Kalra wrote:
> @@ -490,6 +494,11 @@ static bool __init setup_rmptable(void)
> if (rmp_cfg & MSR_AMD64_SEG_RMP_ENABLED) {
> if (!setup_segmented_rmptable())
> return false;
> + /*
> + * RMPOPT requires a segmented RMP, so indicate that the
> + * system is capable of configuring and running RMPOPT.
> + */
> + rmpopt_capable = true;

So we're capable of doing RMPOPT when setup_segmented_rmptable() has
succeeded. Which means, when rmp_segment_table is not NULL, i.e., when we have
a segmented table.

Which means that instead of testing rmpopt_capable, you need to test
CC_ATTR_HOST_SEV_SNP and rmp_segment_table != NULL and you can put that in
a helper local to arch/x86/virt/svm/sev.c

Which means, you don't need that bool.

--
Regards/Gruss,
Boris.

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