Re: [PATCH v9 09/11] x86/virt/tdx: Enable Dynamic PAMT
From: Vishal Annapurve
Date: Fri Aug 28 2026 - 18:38:13 EST
On Wed, Aug 5, 2026 at 7:09 PM Rick Edgecombe
<rick.p.edgecombe@xxxxxxxxx> wrote:
>
> From: "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx>
>
> The Physical Address Metadata Table (PAMT) holds TDX metadata for
> physical memory and must be allocated by the kernel during TDX module
> initialization. Dynamic PAMT is a TDX module feature that can reduce this
> memory use by allocating part of the PAMT dynamically.
>
> The TDX module exposes whether Dynamic PAMT is supported via a bit in the
> 'features0' metadata. Unfortunately, the TDX module exposes the feature as
> supported even when it does not support using it with the number of keyids
> currently configured in the BIOS. Since no TDX modules exist today with
> that issue fixed, make the feature default off to prevent users from
> upgrading their kernel and encountering TDX erroring out when trying to
> enable Dynamic PAMT.
>
> For the decision of whether to make it a boot time option and/or compile
> time option, consider that Dynamic PAMT's memory savings are significant
> enough to make it a good default configuration. That is most TDX users
> should want it unless they have strange keyid configurations.
>
> The feature increases the kernel size by 2KB (when TDX is configured in the
> build).
>
> All pieces are in place to enable Dynamic PAMT if it is supported and the
> user passes a kernel parameter.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
> Co-developed-by: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>
> Signed-off-by: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>
> Tested-by: Hongyu Ning <hongyu.ning@xxxxxxxxxxxxxxx>
> Reviewed-by: Tony Lindgren <tony.lindgren@xxxxxxxxxxxxxxx>
> Acked-by: Sohil Mehta <sohil.mehta@xxxxxxxxx>
Reviewed-by: Vishal Annapurve <vannapurve@xxxxxxxxxx>