Re: [PATCH v7 09/11] x86/virt/tdx: Enable Dynamic PAMT

From: Edgecombe, Rick P

Date: Mon Jul 20 2026 - 14:35:24 EST


On Sat, 2026-07-18 at 01:56 +0000, sashiko-bot@xxxxxxxxxx wrote:
> > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> > - [Low] The global variable `tdx_enable_dpamt` is defined without the `static` keyword, polluting the global namespace.
> > --
> >
> > --- Patch [9]: [PATCH v7 09/11] x86/virt/tdx: Enable Dynamic PAMT ---
> > commit a5e057035573a191a887572dacd25f3faa79112d
> > Author: Kiryl Shutsemau <kas@xxxxxxxxxx>
> >
> > x86/virt/tdx: Enable Dynamic PAMT
> >
> > This commit enables Dynamic PAMT for TDX modules to reduce memory usage
> > during module initialization. It introduces a kernel command line parameter
> > "tdx_dpamt" to allow users to opt-in to this feature when supported by the
> > hardware.
> >
> > > > diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c
> > > > index e31b62f36300d..69834b0d3e602 100644
> > > > --- a/arch/x86/virt/vmx/tdx/tdx.c
> > > > +++ b/arch/x86/virt/vmx/tdx/tdx.c
> > > > @@ -47,6 +47,8 @@
> > > >   #include "seamcall_internal.h"
> > > >   #include "tdx.h"
> > > >  
> > > > +bool tdx_enable_dpamt __ro_after_init;
> >
> > [Severity: Low]
> > Since tdx_enable_dpamt is only used within this file, should it be marked
> > as static? Leaving it globally exposed can trigger compiler warnings like
> > -Wmissing-declarations when building with W=1 and unnecessarily pollutes
> > the global namespace.

Sigh. Yes this is valid. I forgot to make it static after deciding to move
tdx_supports_dynamic_pamt() out of the header instead. Then it didn't need to
reference out of this file. Doh.

Seems maybe something that could be fixed up when applying if the rest of the
series look ok?