[PATCH v3 3/9] x86/virt/tdx: Export Dynamic PAMT helpers to tdx-host
From: Lu Baolu
Date: Wed Nov 11 2026 - 23:46:27 EST
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.
Signed-off-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
---
arch/x86/virt/vmx/tdx/tdx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c
index a1f35188a272..3b9cfab6cf68 100644
--- a/arch/x86/virt/vmx/tdx/tdx.c
+++ b/arch/x86/virt/vmx/tdx/tdx.c
@@ -2426,7 +2426,7 @@ int tdx_pamt_get(kvm_pfn_t pfn, struct tdx_pamt_cache *cache)
return ret;
}
-EXPORT_SYMBOL_FOR_KVM(tdx_pamt_get);
+EXPORT_SYMBOL_FOR_MODULES(tdx_pamt_get, "kvm-intel,tdx-host");
/* Drop DPAMT refcount for the given pfn and free DPAMT backing if needed. */
void tdx_pamt_put(kvm_pfn_t pfn)
@@ -2470,7 +2470,7 @@ void tdx_pamt_put(kvm_pfn_t pfn)
out_unlock:
spin_unlock(&dpamt_lock);
}
-EXPORT_SYMBOL_FOR_KVM(tdx_pamt_put);
+EXPORT_SYMBOL_FOR_MODULES(tdx_pamt_put, "kvm-intel,tdx-host");
void tdx_free_pamt_cache(struct tdx_pamt_cache *cache)
{
--
2.43.0