Re: [PATCH v2 2/5] x86/virt/tdx: Configure add-on features on TDX module init

From: Tony Lindgren

Date: Thu Sep 24 2026 - 02:27:07 EST


On Thu, Sep 24, 2026 at 09:33:31AM +0800, Xu Yilun wrote:
> On Wed, Sep 23, 2026 at 10:59:22AM +0300, Tony Lindgren wrote:
> > On Wed, Sep 23, 2026 at 03:30:55PM +0800, Xu Yilun wrote:
> > > On Tue, Sep 22, 2026 at 10:13:56AM +0300, Tony Lindgren wrote:
> > > > On Tue, Sep 15, 2026 at 06:26:55PM +0800, Xu Yilun wrote:
> > > > > --- a/arch/x86/virt/vmx/tdx/tdx.c
> > > > > +++ b/arch/x86/virt/vmx/tdx/tdx.c
> > > > > @@ -998,6 +998,15 @@ static __init int construct_tdmrs(struct list_head *tmb_list,
> > > > > return ret;
> > > > > }
> > > > >
> > > > > +/* List all kernel supported add-on features0 bits here */
> > > > > +#define TDX_KERNEL_SUPPORTED_ADDON_FEATURES0 (0)
> > > > > +
> > > > > +static __init u64 get_tdx_addon_features0(void)
> > > > > +{
> > > > > + return tdx_sysinfo.features.tdx_features0 &
> > > > > + TDX_KERNEL_SUPPORTED_ADDON_FEATURES0;
> > > > > +}
> > > >
> > > > How about get_tdx_supported_addon_features() for the above? It makes the
> > >
> > > mm.. I think this would make a bit confusion. "tdx_supported" reads like
> > > the module supported features, which is just .tdx_features0. But here we
> > > want both the module & kernel support. I'm thinking of:
> > >
> > > get_tdx_addon_features0(), just as is
> > >
> > > or
> > >
> > > tdx_get_supported_addon_features0(), maybe this is better?
> >
> > Something to describe it's masked with Linux supported features would be
> > nicest.
> >
> > Maybe something like get_tdx_masked_features0() or just
> > get_tdx_usable_features0()?
>
> I like "usable", and I want to keep "addon", not all usable features are
> listed here:
>
> get_tdx_usable_addon_features0()

Sounds good to me.