Re: [PATCH v3 3/9] x86/virt/tdx: Export Dynamic PAMT helpers to tdx-host
From: Xu Yilun
Date: Mon Nov 23 2026 - 05:35:47 EST
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;
...
}