Re: [PATCH v2 06/17] x86/virt/tdx: Re-initialize the extensions on runtime TDX module update

From: Xu Yilun

Date: Tue Jun 30 2026 - 07:24:06 EST


On Mon, Jun 29, 2026 at 04:12:40PM +0800, Chao Gao wrote:
> >+/*
> >+ * Mostly the same flow as init_tdx_module_extensions(), but rejects adding
> >+ * more memory.
> >+ */
> >+static int update_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;
> >+
> >+ if (!sysinfo_ext.ext_required)
> >+ return 0;
> >+
> >+ if (sysinfo_ext.memory_pool_required_pages)
> >+ return -EFAULT;
>
> Will tdx_ext_init() return an error if more memory is needed?

Yes.

>
> If yes, we can leave this check to the module.

Yes, we can. Although we can't remove ext_required check, we can remove
memory_pool_required_pages check, making the function simpler.