Re: [PATCH v2 03/17] x86/virt/tdx: Detect if the extensions initialization is required

From: Xu Yilun

Date: Tue Jun 30 2026 - 07:23:22 EST


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

> could drop this 'ext_required' from this series entirely.