Re: [PATCH v10 2/6] x86/sev: Initialize RMPOPT configuration MSRs
From: Borislav Petkov
Date: Tue Jul 21 2026 - 11:36:49 EST
On Tue, Jul 21, 2026 at 09:26:48AM -0500, Kalra, Ashish wrote:
> That's why v7 moved to a runtime check. In v11 (as i mentioned) this will be a small local helper, it will also handles two things
> the cap-clear can't:
> - a contiguous (non-segmented) RMP, where RMPOPT isn't usable even with X86_FEATURE_RMPOPT set.
That's the point of clearing the flag - to mark it non-usable.
> - SNP being disabled at runtime (CC_ATTR_HOST_SEV_SNP).
Same as RMPOPT being not usable follows from disabled SNP.
> static bool rmpopt_capable(void)
> {
> return cpu_feature_enabled(X86_FEATURE_RMPOPT) &&
> cc_platform_has(CC_ATTR_HOST_SEV_SNP) &&
> (rmp_cfg & MSR_AMD64_SEG_RMP_ENABLED) &&
> rmp_segment_table;
> }
But yes, this is a local helper so that's good enough.
We can always change it later if needed.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette