From: Xiaoyao Li <xiaoyao.li@intel.com>
To: Yan Zhao <yan.y.zhao@intel.com>,
dave.hansen@linux.intel.com, pbonzini@redhat.com,
seanjc@google.com
Cc: tglx@kernel.org, mingo@redhat.com, bp@alien8.de, kas@kernel.org,
x86@kernel.org, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org, linux-coco@lists.linux.dev,
kai.huang@intel.com, rick.p.edgecombe@intel.com,
yilun.xu@linux.intel.com, vannapurve@google.com,
ackerleytng@google.com, sagis@google.com,
binbin.wu@linux.intel.com, isaku.yamahata@intel.com
Subject: Re: [PATCH v2 4/4] x86/virt/tdx: Move mk_keyed_paddr() to tdx.c due to no external users
Date: Thu, 7 May 2026 16:07:01 +0800 [thread overview]
Message-ID: <3eadc407-181e-4cc5-a03a-78d3c0c39fcb@intel.com> (raw)
In-Reply-To: <20260430015014.24261-1-yan.y.zhao@intel.com>
On 4/30/2026 9:50 AM, Yan Zhao wrote:
> 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.
Missing a new blank line.
> Signed-off-by: Yan Zhao <yan.y.zhao@intel.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
> ---
> arch/x86/include/asm/tdx.h | 6 ------
> arch/x86/virt/vmx/tdx/tdx.c | 6 ++++++
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h
> index 9c63deaa0e8f..503f9a3f46d6 100644
> --- a/arch/x86/include/asm/tdx.h
> +++ b/arch/x86/include/asm/tdx.h
> @@ -177,12 +177,6 @@ struct tdx_vp {
> struct page **tdcx_pages;
> };
>
> -static inline u64 mk_keyed_paddr(u16 hkid, kvm_pfn_t pfn)
> -{
> - /* KeyID bits are just above the physical address bits. */
> - return PFN_PHYS(pfn) | ((u64)hkid << boot_cpu_data.x86_phys_bits);
> -}
> -
> u64 tdh_vp_enter(struct tdx_vp *vp, struct tdx_module_args *args);
> u64 tdh_mng_addcx(struct tdx_td *td, struct page *tdcs_page);
> u64 tdh_mem_page_add(struct tdx_td *td, u64 gpa, kvm_pfn_t pfn, struct page *source,
> diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c
> index deb67e68f85f..967482ae3c80 100644
> --- a/arch/x86/virt/vmx/tdx/tdx.c
> +++ b/arch/x86/virt/vmx/tdx/tdx.c
> @@ -1911,6 +1911,12 @@ u64 tdh_phymem_cache_wb(bool resume)
> }
> EXPORT_SYMBOL_FOR_KVM(tdh_phymem_cache_wb);
>
> +static inline u64 mk_keyed_paddr(u16 hkid, kvm_pfn_t pfn)
> +{
> + /* KeyID bits are just above the physical address bits. */
> + return PFN_PHYS(pfn) | ((u64)hkid << boot_cpu_data.x86_phys_bits);
> +}
> +
> u64 tdh_phymem_page_wbinvd_tdr(struct tdx_td *td)
> {
> struct tdx_module_args args = {};
prev parent reply other threads:[~2026-05-07 8:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260430014852.24183-1-yan.y.zhao@intel.com>
[not found] ` <20260430014929.24210-1-yan.y.zhao@intel.com>
2026-05-07 7:49 ` [PATCH v2 1/4] x86/tdx: Use PFN directly for mapping guest private memory Xiaoyao Li
2026-05-07 8:08 ` Yan Zhao
2026-05-07 18:46 ` Sean Christopherson
[not found] ` <20260430014948.24226-1-yan.y.zhao@intel.com>
2026-05-07 7:54 ` [PATCH v2 2/4] x86/tdx: Use PFN directly for unmapping " Xiaoyao Li
[not found] ` <20260430015001.24242-1-yan.y.zhao@intel.com>
2026-05-07 8:02 ` [PATCH v2 3/4] x86/tdx: Drop exported function tdx_quirk_reset_page() Xiaoyao Li
[not found] ` <20260430015014.24261-1-yan.y.zhao@intel.com>
2026-05-07 8:07 ` Xiaoyao Li [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3eadc407-181e-4cc5-a03a-78d3c0c39fcb@intel.com \
--to=xiaoyao.li@intel.com \
--cc=ackerleytng@google.com \
--cc=binbin.wu@linux.intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=isaku.yamahata@intel.com \
--cc=kai.huang@intel.com \
--cc=kas@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rick.p.edgecombe@intel.com \
--cc=sagis@google.com \
--cc=seanjc@google.com \
--cc=tglx@kernel.org \
--cc=vannapurve@google.com \
--cc=x86@kernel.org \
--cc=yan.y.zhao@intel.com \
--cc=yilun.xu@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox