Re: [PATCH v2 2/5] x86/virt/tdx: Configure add-on features on TDX module init
From: Xu Yilun
Date: Fri Sep 18 2026 - 05:59:05 EST
On Wed, Sep 16, 2026 at 11:23:21AM +0800, Chao Gao wrote:
> On Tue, Sep 15, 2026 at 06:26:55PM +0800, Xu Yilun wrote:
> >The TDX architecture identifies some features that are off by default
> >but can be enabled by the host during TDX module initialization. They
> >are classified as add-on features because enabling them affects existing
> >TDX systems: they may change existing feature behavior, or reserve more
> >memory.
> >
> >The TDX module extends TDH.SYS.CONFIG with a new register argument to
> >specify which add-on features to enable. This new argument is a bitmap
> >that uses the same feature bits as TDX_FEATURES0. Note that Dynamic PAMT
> >is an exception: although it is an add-on feature, it is controlled via
> >a legacy, dedicated register argument [1].
> >
> >The kernel needs to enable these add-on features when it supports them.
> >Add a get_tdx_addon_features0() helper to return the bitmap of the add-on
> >features that the module & kernel both support. Initially, this helper
> >returns 0. It will be updated to return specific feature bits as full
> >kernel support lands. Pass this extra bitmap to TDH.SYS.CONFIG wrapper.
>
> The last sentence is stale: the bitmap is no longer passed to the wrapper.
Good catch.
Pass this bitmap as an argument to TDH.SYS.CONFIG.
Thanks.