Re: [PATCH v6 10/11] x86/virt/tdx: Enable Dynamic PAMT

From: Edgecombe, Rick P

Date: Tue Jun 30 2026 - 21:21:27 EST


On Fri, 2026-06-05 at 13:25 +0800, Chao Gao wrote:
> On Thu, Jun 04, 2026 at 06:14:17PM +0100, Kiryl Shutsemau wrote:
> > On Mon, May 25, 2026 at 07:35:14PM -0700, Rick Edgecombe wrote:
> > > @@ -152,7 +156,12 @@ const struct tdx_sys_info *tdx_get_sysinfo(void);
> > >  
> > >   static inline bool tdx_supports_dynamic_pamt(const struct tdx_sys_info *sysinfo)
> > >   {
> > > - return false; /* To be enabled when kernel is ready */
> > > + /*
> > > + * The TDX Module's internal Dynamic PAMT tree structure can't
> > > + * handle physical addresses with more than 48 bits.
> > > + */
> > > + return sysinfo->features.tdx_features0 & TDX_FEATURES0_DYNAMIC_PAMT &&
> > > +        boot_cpu_data.x86_phys_bits <= 48;
> >
> > Should we warn for >48?
>
> Maybe we should drop this check. If the TDX module cannot handle that case,
> advertising TDX_FEATURES0_DYNAMIC_PAMT is a bug and should be fixed by the
> module.

I totally agree this is an awkward thing to make the VMM check. But I think
tdx_features0 is normally about what the *TDX Module* supports? When this is
kind of a valid configuration check. The user can configure enough keyids to
make Dynamic PAMT workable.

Looking... Actually there are some dynamic supported ones. Ok, I'll ask.