[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1e1975a134b401c506eb5c4d0f093ce1e286d032.camel@intel.com>
Date: Tue, 12 Nov 2024 21:21:57 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "pbonzini@...hat.com" <pbonzini@...hat.com>, "Hansen, Dave"
<dave.hansen@...el.com>, "seanjc@...gle.com" <seanjc@...gle.com>
CC: "sean.j.christopherson@...el.com" <sean.j.christopherson@...el.com>, "Yao,
Yuan" <yuan.yao@...el.com>, "Huang, Kai" <kai.huang@...el.com>,
"binbin.wu@...ux.intel.com" <binbin.wu@...ux.intel.com>, "Li, Xiaoyao"
<xiaoyao.li@...el.com>, "isaku.yamahata@...il.com"
<isaku.yamahata@...il.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "tony.lindgren@...ux.intel.com"
<tony.lindgren@...ux.intel.com>, "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"Zhao, Yan Y" <yan.y.zhao@...el.com>, "Chatre, Reinette"
<reinette.chatre@...el.com>, "Yamahata, Isaku" <isaku.yamahata@...el.com>
Subject: Re: [PATCH v2 06/25] x86/virt/tdx: Add SEAMCALL wrappers for TDX TD
creation
On Tue, 2024-11-12 at 12:17 -0800, Dave Hansen wrote:
> On 10/30/24 12:00, Rick Edgecombe wrote:
> > +u64 tdh_mng_create(u64 tdr, u64 hkid)
> > +{
> > + struct tdx_module_args args = {
> > + .rcx = tdr,
> > + .rdx = hkid,
> > + };
> > + clflush_cache_range(__va(tdr), PAGE_SIZE);
> > + return seamcall(TDH_MNG_CREATE, &args);
> > +}
> > +EXPORT_SYMBOL_GPL(tdh_mng_create);
>
> I'd _prefer_ that this explain why the clflush is there.
How about:
/*
* 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.
* Be conservative and make the code simpler by doing the CLFLUSH
* unconditionally.
*/
>
> The other goofy thing here is why it's getting a physical address passed
> in. It's my old 32-bit paranoia kicking in, but everything that has a
> valid virtual address _also_ has a valid physical address. The inverse
> is not true, though. So I like to keep things as pointers as long as
> possible.
Ok, seems reasonable.
Powered by blists - more mailing lists