lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cc6aa3d9ba3f075d0d3b772491be1516c5951f6d.camel@intel.com>
Date: Thu, 14 Aug 2025 00:09:34 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "Hansen, Dave" <dave.hansen@...el.com>, "Edgecombe, Rick P"
	<rick.p.edgecombe@...el.com>, "bp@...en8.de" <bp@...en8.de>,
	"peterz@...radead.org" <peterz@...radead.org>, "hpa@...or.com"
	<hpa@...or.com>, "mingo@...hat.com" <mingo@...hat.com>, "tglx@...utronix.de"
	<tglx@...utronix.de>, "thomas.lendacky@....com" <thomas.lendacky@....com>
CC: "Gao, Chao" <chao.gao@...el.com>, "Yamahata, Isaku"
	<isaku.yamahata@...el.com>, "seanjc@...gle.com" <seanjc@...gle.com>,
	"x86@...nel.org" <x86@...nel.org>, "kas@...nel.org" <kas@...nel.org>,
	"sagis@...gle.com" <sagis@...gle.com>, "Chatre, Reinette"
	<reinette.chatre@...el.com>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "Williams, Dan J" <dan.j.williams@...el.com>,
	"Chen, Farrah" <farrah.chen@...el.com>, "ashish.kalra@....com"
	<ashish.kalra@....com>, "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
	"nik.borisov@...e.com" <nik.borisov@...e.com>, "dwmw@...zon.co.uk"
	<dwmw@...zon.co.uk>, "pbonzini@...hat.com" <pbonzini@...hat.com>
Subject: Re: [PATCH v5 3/7] x86/virt/tdx: Mark memory cache state incoherent
 when making SEAMCALL

On Tue, 2025-08-12 at 01:32 +0000, Huang, Kai wrote:
> On Tue, 2025-08-12 at 00:51 +0000, Edgecombe, Rick P wrote:
> > On Tue, 2025-07-29 at 00:28 +1200, Kai Huang wrote:
> > > +static __always_inline u64 do_seamcall(sc_func_t func, u64 fn,
> > > +				       struct tdx_module_args *args)
> > > +{
> > > +	lockdep_assert_preemption_disabled();
> > > +
> > > +	/*
> > > +	 * SEAMCALLs are made to the TDX module and can generate dirty
> > > +	 * cachelines of TDX private memory.  Mark cache state incoherent
> > > +	 * so that the cache can be flushed during kexec.
> > > +	 *
> > > +	 * This needs to be done before actually making the SEAMCALL,
> > > +	 * because kexec-ing CPU could send NMI to stop remote CPUs,
> > > +	 * in which case even disabling IRQ won't help here.
> > > +	 */
> > > +	this_cpu_write(cache_state_incoherent, true);
> > > +
> > > +	return func(fn, args);
> > > +}
> > > +
> > 
> > 
> > Functionally it looks good now, but I still think the chain of names is not
> > acceptable:
> > 
> > seamcall()
> > 	sc_retry()
> > 		do_seamcall()
> > 			__seamcall()
> > 
> > sc_retry() is the only one with a hint of what is different about it, but it
> > randomly uses sc abbreviation instead of seamcall. That is an existing thing.
> > But the additional one should be named with something about the cache part that
> > it does, like seamcall_dirty_cache() or something. "do_seamcall()" tells the
> > reader nothing.
> 
> OK. I'll change do_seamcall() to seamcall_dirty_cache().
> 

Talked to Rick offline on this.  seamcall_dirty_cache() seems more like a
high level helper, e.g., could look like a wrapper to existing
seamcall*().  We agreed to change to __seamcall_dirty_cache(), which looks
like a low level helper instead.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ