Re: [PATCH v2 03/17] x86/virt/tdx: Detect if the extensions initialization is required
Xiaoyao Li <[email protected]> Fri, 24 Jul 2026 16:44:15 +0800
| Newsgroups | dev.linux.lists.linux-coco,org.kernel.vger.kvm,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On 6/30/2026 7:10 PM, Xu Yilun wrote:
> On Mon, Jun 29, 2026 at 02:33:56PM +0800, Chao Gao wrote:
>>> +static __init int init_tdx_module_extensions(void)
>>> +{
>>> + struct tdx_sys_info_ext sysinfo_ext;
>>> + int ret;
>>> +
>>> + if (!(tdx_sysinfo.features.tdx_features0 & TDX_FEATURES0_EXT))
>>> + return 0;
>>> +
>>> + ret = get_tdx_sys_info_ext(&sysinfo_ext);
>>> + if (ret)
>>> + return ret;
>>> +
>>> + /* Skip if no feature requires TDX module extensions. */
>>> + if (!sysinfo_ext.ext_required)
>>> + return 0;
>>
>> What would happen if the kernel doesn't do this 'ext_required' check
>> and always does the extension initialization?
>>
>> If TDH.EXT.INIT returns success when no extension is configured, we
>
> No, TDH.EXT.INIT fails when ext_required==false
What is the SEAMCALL return code in this case?
>> could drop this 'ext_required' from this series entirely.