Re: [PATCH v4 1/2] x86/sev: Clear RMPOPT when segmented RMP is disabled by firmware

From: K Prateek Nayak

Date: Mon Nov 02 2026 - 22:02:22 EST


On 11/3/2026 6:15 AM, Borislav Petkov wrote:
> diff --git a/arch/x86/virt/svm/sev.c b/arch/x86/virt/svm/sev.c
> index bd70c4d0b774..417e6a41ac60 100644
> --- a/arch/x86/virt/svm/sev.c
> +++ b/arch/x86/virt/svm/sev.c
> @@ -669,10 +669,10 @@ void snp_enable_rmpopt(void)
> u64 base;
> int cpu;
>
> - if (!cpu_feature_enabled(X86_FEATURE_RMPOPT))
> + if (!cc_platform_has(CC_ATTR_HOST_SEV_SNP))
> return;

nit. We should check CC_ATTR_HOST_SEV_SNP in rmpopt_init() too
now to prevent an unnecessary workqueue allocation if
probe_segmented_rmptable_info() failed early.

Since it doesn't change anything functionally, maybe Ashish
can do it as a part of his mutil-node optimization series.

>
> - if (!cc_platform_has(CC_ATTR_HOST_SEV_SNP))
> + if (!cpu_feature_enabled(X86_FEATURE_RMPOPT))
> return;
>
> if (!rmpopt_soft_init)

--
Thanks and Regards,
Prateek