Re: [PATCH v2 2/4] x86/virt/tdx: Read global metadata for trusted IOMMU
From: Xu Yilun
Date: Thu Oct 15 2026 - 02:52:33 EST
On Thu, Oct 15, 2026 at 09:07:03AM +0800, Lu Baolu wrote:
> Add support for reading the global metadata of the trusted IOMMU.
>
> The trusted IOMMU feature is optionally enumerated via TDX_FEATURES0.
The feature name is not trusted IOMMU, the name in the spec is
TDX_CONNECT, but I believe people want a name with technical meaning,
maybe TDX TDISP? Open question for all reviewers.
> Check this feature bit before reading the metadata to avoid causing
> the entire TDX initialization to fail on platforms that do not support
> it.
>
> The read value represents the number of pages required for the IOMMU
> metadata. The host will allocate this count of pages and provide them to
> the TDX module when it configures the IOMMU to operate in Secure TDX mode
> via the TDH.IOMMU.SETUP SEAMCALL.
>
> Thanks to Xu Yilun for the initial draft.
>
> Signed-off-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> ---
> arch/x86/include/asm/tdx.h | 1 +
> arch/x86/include/asm/tdx_global_metadata.h | 5 +++++
> arch/x86/virt/vmx/tdx/tdx_global_metadata.c | 20 ++++++++++++++++++++
> 3 files changed, 26 insertions(+)
>
> diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h
> index 8b5411d3eb67..9c9168822274 100644
> --- a/arch/x86/include/asm/tdx.h
> +++ b/arch/x86/include/asm/tdx.h
> @@ -35,6 +35,7 @@
>
> /* Bit definitions of TDX_FEATURES0 metadata field */
> #define TDX_FEATURES0_TD_PRESERVING BIT_ULL(1)
> +#define TDX_FEATURES0_TDXCONNECT BIT_ULL(6)
TDX_FEATURES0_TDX_CONNECT?
My actual point is that the name XX_TDX_CONNECT is good here.