From: Yan Zhao <yan.y.zhao@intel.com>
To: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: <kvm@vger.kernel.org>, <pbonzini@redhat.com>, <seanjc@google.com>,
<dave.hansen@intel.com>, <isaku.yamahata@gmail.com>,
<kai.huang@intel.com>, <linux-kernel@vger.kernel.org>,
<tony.lindgren@linux.intel.com>, <xiaoyao.li@intel.com>,
<x86@kernel.org>, <adrian.hunter@intel.com>,
"Isaku Yamahata" <isaku.yamahata@intel.com>,
Binbin Wu <binbin.wu@linux.intel.com>,
Yuan Yao <yuan.yao@intel.com>
Subject: Re: [RFC PATCH v2 4/6] x86/virt/tdx: Add SEAMCALL wrappers for TDX page cache management
Date: Wed, 11 Dec 2024 09:23:59 +0800 [thread overview]
Message-ID: <Z1jpr7baxGJDj7Ur@yzhao56-desk.sh.intel.com> (raw)
In-Reply-To: <20241203010317.827803-5-rick.p.edgecombe@intel.com>
On Mon, Dec 02, 2024 at 05:03:14PM -0800, Rick Edgecombe wrote:
...
> +u64 tdh_phymem_page_wbinvd_tdr(struct tdx_td *td)
> +{
> + struct tdx_module_args args = {};
> +
> + args.rcx = tdx_tdr_pa(td) | ((u64)tdx_global_keyid << boot_cpu_data.x86_phys_bits);
> +
> + return seamcall(TDH_PHYMEM_PAGE_WBINVD, &args);
> +}
> +EXPORT_SYMBOL_GPL(tdh_phymem_page_wbinvd_tdr);
The tdx_global_keyid is of type u16 in TDX spec and TDX module.
As Reinette pointed out, u64 could cause overflow.
Do we need to change all keyids to u16, including those in
tdh.mng.create() in patch 2,
the global_keyid, tdx_guest_keyid_start in arch/x86/virt/vmx/tdx/tdx.c
and kvm_tdx->hkid in arch/x86/kvm/vmx/tdx.c ?
BTW, is it a good idea to move set_hkid_to_hpa() from KVM TDX to x86 common
header?
static __always_inline hpa_t set_hkid_to_hpa(hpa_t pa, u16 hkid)
{
return pa | ((hpa_t)hkid << boot_cpu_data.x86_phys_bits);
}
next prev parent reply other threads:[~2024-12-11 1:26 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-03 1:03 [RFC PATCH v2 0/6] SEAMCALL Wrappers Rick Edgecombe
2024-12-03 1:03 ` [RFC PATCH v2 1/6] x86/virt/tdx: Add SEAMCALL wrappers for TDX KeyID management Rick Edgecombe
2024-12-03 1:03 ` [RFC PATCH v2 2/6] x86/virt/tdx: Add SEAMCALL wrappers for TDX TD creation Rick Edgecombe
2024-12-03 2:20 ` Binbin Wu
2024-12-04 1:58 ` Edgecombe, Rick P
2024-12-04 19:54 ` Dave Hansen
2024-12-05 17:25 ` Edgecombe, Rick P
2024-12-03 1:03 ` [RFC PATCH v2 3/6] x86/virt/tdx: Add SEAMCALL wrappers for TDX vCPU creation Rick Edgecombe
2024-12-03 1:03 ` [RFC PATCH v2 4/6] x86/virt/tdx: Add SEAMCALL wrappers for TDX page cache management Rick Edgecombe
2024-12-03 2:33 ` Binbin Wu
2024-12-04 1:58 ` Edgecombe, Rick P
2024-12-11 1:23 ` Yan Zhao [this message]
2024-12-11 1:33 ` Edgecombe, Rick P
2024-12-03 1:03 ` [RFC PATCH v2 5/6] x86/virt/tdx: Add SEAMCALL wrappers for TDX VM/vCPU field access Rick Edgecombe
2024-12-04 19:57 ` Dave Hansen
2024-12-05 17:33 ` Edgecombe, Rick P
2024-12-03 1:03 ` [RFC PATCH v2 6/6] x86/virt/tdx: Add SEAMCALL wrappers for TDX flush operations Rick Edgecombe
2024-12-04 1:24 ` [RFC PATCH v2 0/6] SEAMCALL Wrappers Huang, Kai
2024-12-04 1:57 ` Edgecombe, Rick P
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=Z1jpr7baxGJDj7Ur@yzhao56-desk.sh.intel.com \
--to=yan.y.zhao@intel.com \
--cc=adrian.hunter@intel.com \
--cc=binbin.wu@linux.intel.com \
--cc=dave.hansen@intel.com \
--cc=isaku.yamahata@gmail.com \
--cc=isaku.yamahata@intel.com \
--cc=kai.huang@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rick.p.edgecombe@intel.com \
--cc=seanjc@google.com \
--cc=tony.lindgren@linux.intel.com \
--cc=x86@kernel.org \
--cc=xiaoyao.li@intel.com \
--cc=yuan.yao@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