From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 19 Feb 2019 16:09:18 -0000 Received: from mga05.intel.com ([192.55.52.43]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gw7xM-0001Ja-I8 for speck@linutronix.de; Tue, 19 Feb 2019 17:09:17 +0100 Date: Tue, 19 Feb 2019 08:09:13 -0800 From: Andi Kleen Subject: [MODERATED] Re: [patch 4/8] MDS basics 4 Message-ID: <20190219160913.GU16922@tassilo.jf.intel.com> References: <20190219124406.449727187@linutronix.de> <20190219125346.141295571@linutronix.de> <7f92c34c-a3c4-1df2-c026-c7309c6ff3f2@citrix.com> MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Tue, Feb 19, 2019 at 03:07:59PM +0100, speck for Thomas Gleixner wrote: > On Tue, 19 Feb 2019, speck for Thomas Gleixner wrote: > > On Tue, 19 Feb 2019, speck for Andrew Cooper wrote: > > > > > On 19/02/2019 12:44, speck for Thomas Gleixner wrote: > > > > Subject: [patch 4/8] x86/speculation/mds: Conditionaly clear CPU buffers on idle entry > > > > From: Thomas Gleixner > > > > > > > > Add a static key which controls the invocation of the CPU buffer clear > > > > mechanism on idle entry. This is independent of other MDS mitigations > > > > because the idle entry invocation to mitigate the potential leakage due to > > > > store buffer repartitioning is only necessary on SMT systems. > > > > > > > > Add the actual invocations to the different halt/mwait variants which > > > > covers all usage sites. mwaitx is not patched as it's not available on > > > > Intel CPUs. > > > > > > > > Signed-off-by: Thomas Gleixner > > > > > > Unfortunately, clearing is needed on the exit from idle as well as the > > > entry. > > > > > > This only impacts the store buffer (MSBDS, previously PSF) because it > > > gets statically re-partitioned when a thread comes in and out of idle. > > > > > > >From the point of view of the thread going idle, when going idle my half > > > of the store buffers get given to the other thread and potentially leak > > > my secrets, whereas when coming out of idle, the other threads store > > > buffers get split with me, potentially leaking their secrets. > > > > Duh, indeed. Easy enough to fix. > > Delta patch below. Stupid me even mentioned the repartioning on both sides > in the changelog. It's not needed. You can drop it. -Andi