Skip to content

Commit 3f330fb

Browse files
yanzhao56sean-jc
authored andcommitted
x86/virt/tdx: Move mk_keyed_paddr() to tdx.c due to no external users
Move mk_keyed_paddr() from tdx.h to tdx.c to avoid unnecessary header inclusion and improve encapsulation since there are no users outside of tdx.c. No functional change intended. Signed-off-by: Yan Zhao <yan.y.zhao@intel.com> Acked-by: Kiryl Shutsemau <kas@kernel.org> Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com> Acked-by: Dave Hansen <dave.hansen@linux.intel.com> Link: https://patch.msgid.link/20260430015014.24261-1-yan.y.zhao@intel.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 4a72a6d commit 3f330fb

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

arch/x86/include/asm/tdx.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,6 @@ struct tdx_vp {
177177
struct page **tdcx_pages;
178178
};
179179

180-
static inline u64 mk_keyed_paddr(u16 hkid, kvm_pfn_t pfn)
181-
{
182-
/* KeyID bits are just above the physical address bits. */
183-
return PFN_PHYS(pfn) | ((u64)hkid << boot_cpu_data.x86_phys_bits);
184-
}
185-
186180
u64 tdh_vp_enter(struct tdx_vp *vp, struct tdx_module_args *args);
187181
u64 tdh_mng_addcx(struct tdx_td *td, struct page *tdcs_page);
188182
u64 tdh_mem_page_add(struct tdx_td *td, u64 gpa, kvm_pfn_t pfn, struct page *source,

arch/x86/virt/vmx/tdx/tdx.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,6 +1911,12 @@ u64 tdh_phymem_cache_wb(bool resume)
19111911
}
19121912
EXPORT_SYMBOL_FOR_KVM(tdh_phymem_cache_wb);
19131913

1914+
static inline u64 mk_keyed_paddr(u16 hkid, kvm_pfn_t pfn)
1915+
{
1916+
/* KeyID bits are just above the physical address bits. */
1917+
return PFN_PHYS(pfn) | ((u64)hkid << boot_cpu_data.x86_phys_bits);
1918+
}
1919+
19141920
u64 tdh_phymem_page_wbinvd_tdr(struct tdx_td *td)
19151921
{
19161922
struct tdx_module_args args = {};

0 commit comments

Comments
 (0)