Re: [PATCH v3 3/9] x86/virt/tdx: Export Dynamic PAMT helpers to tdx-host

From: Baolu Lu

Date: Tue Nov 24 2026 - 01:13:07 EST


On 11/24/2026 12:28 AM, Edgecombe, Rick P wrote:
On Mon, 2026-11-23 at 18:25 +0800, Xu Yilun wrote:
On Thu, Nov 12, 2026 at 12:30:48PM +0800, Lu Baolu wrote:
With Dynamic PAMT, any page handed to the TDX module needs PAMT backing
first, via tdx_pamt_get(), and must drop it with tdx_pamt_put() once the
TDX module gives the page back. Besides KVM, the tdx-host driver now
hands pages to the TDX module: the IOMMU_MT pages for TDH.IOMMU.SETUP.

Export the two helpers to tdx-host as well. A symbol can only be
exported once, so replace EXPORT_SYMBOL_FOR_KVM() with an explicit list.
Only kvm-intel calls these helpers in KVM.

We are seeking for some simplified intial implementation without DPAMT
for TDX huge page feature. So we could also drop DPAMT support for TDX
Trusted I/O currently.

As an temporary solution, we can disable TDX Trusted I/O if DPAMT is on.

for example:

static inline bool tdx_supports_trusted_io(const struct tdx_sys_info *sysinfo)
{
if (tdx_supports_dynamic_pamt(sysinfo))
return false;

...
}

Yes, let's try to make DPAMT support optional for the initial upstream TDX
connect target. We can add support for it in follow on patches and keep the
initial code sets smaller. In order to facilitate this, we need to add a kernel
param to control enabling DPAMT. I will send a patch soon.

Sounds good. I'll temperately drop the DPAMT support in the next
version.

Thanks,
baolu