Re: [PATCH v4 1/2] x86/sev: Clear RMPOPT when segmented RMP is disabled by firmware
From: K Prateek Nayak
Date: Tue Nov 03 2026 - 13:00:51 EST
Hello Ashish,
On 11/3/2026 8:10 PM, Kalra, Ashish wrote:
> On 11/2/2026 8:58 PM, K Prateek Nayak wrote:
>> 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.
>
> As rmpopt_init() is now called from snp_rmptable_init() (in patch 2/2), and there is
> already a CC_ATTR_HOST_SEV_SNP check in snp_rmptable_init(), there should be no need
> to check this in rmpopt_init().
True that! I forgot the second patch existed (facepalm).
Sorry for the noise.
--
Thanks and Regards,
Prateek