[RFC PATCH 05/15] x86/virt/tdx: Move tdx_tdr_pa() up in the file
From: Xu Yilun
Date: Fri May 22 2026 - 00:09:32 EST
From: Peter Fang <peter.fang@xxxxxxxxx>
Move the tdx_tdr_pa() in preparation for upcoming changes to use them
during TDX bringup.
No functional change intended.
Signed-off-by: Peter Fang <peter.fang@xxxxxxxxx>
Signed-off-by: Xu Yilun <yilun.xu@xxxxxxxxxxxxxxx>
---
arch/x86/virt/vmx/tdx/tdx.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c
index dad5ec642723..67758adefb4a 100644
--- a/arch/x86/virt/vmx/tdx/tdx.c
+++ b/arch/x86/virt/vmx/tdx/tdx.c
@@ -1200,6 +1200,11 @@ static __init u64 to_hpa_list_info(struct page *root, unsigned int nr_pages)
FIELD_PREP(HPA_LIST_INFO_LAST_ENTRY, nr_pages - 1);
}
+static inline u64 tdx_tdr_pa(struct tdx_td *td)
+{
+ return page_to_phys(td->tdr_page);
+}
+
/* Initialize the TDX Module Extensions then Extension-SEAMCALLs can be used */
static __init int tdx_ext_init(void)
{
@@ -1725,11 +1730,6 @@ void tdx_guest_keyid_free(unsigned int keyid)
}
EXPORT_SYMBOL_FOR_KVM(tdx_guest_keyid_free);
-static inline u64 tdx_tdr_pa(struct tdx_td *td)
-{
- return page_to_phys(td->tdr_page);
-}
-
/*
* The TDX module exposes a CLFLUSH_BEFORE_ALLOC bit to specify whether
* a CLFLUSH of pages is required before handing them to the TDX module.
--
2.25.1