From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx2.suse.de ([195.135.220.15]) by Galois.linutronix.de with esmtps (TLS1.0:DHE_RSA_CAMELLIA_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1fICAd-0002wZ-3Z for speck@linutronix.de; Mon, 14 May 2018 14:01:39 +0200 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id F2551AEC1 for ; Mon, 14 May 2018 12:01:30 +0000 (UTC) Date: Mon, 14 May 2018 14:01:20 +0200 From: Borislav Petkov Subject: [MODERATED] Re: [patch 06/15] Hidden 6 Message-ID: <20180514120120.GI18407@pd.tnic> References: <20180513140048.543641807@linutronix.de> <20180513140538.715249208@linutronix.de> MIME-Version: 1.0 In-Reply-To: <20180513140538.715249208@linutronix.de> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: speck@linutronix.de List-ID: On Sun, May 13, 2018 at 04:00:54PM +0200, speck for Thomas Gleixner wrote: > Subject: [patch 06/15] x86/speculation: Handle HT correctly on AMD > From: Thomas Gleixner >=20 > The AMD64_LS_CFG MSR is a per core MSR on Family 17H CPUs. That means when > hyperthreading is enabled the SSBD bit toggle needs to take both cores into > account. Otherwise the following situation can happen: >=20 > CPU0 CPU1 >=20 > disable SSB > disable SSB > enable SSB <- Enables it for the Core, i.e. for CPU0 as well >=20 > So after the SSB enable on CPU1 the task on CPU0 runs with SSB enabled > again. >=20 > On Intel the SSBD control is per core as well, but the synchronization > logic is implemented behind the per thread SPEC_CTRL MSR. >=20 > Add the necessary synchronization logic for AMD family 17H. Unfortunately > that requires a spinlock to serialize the access to the MSR, but the locks > are only shared between siblings. >=20 > Signed-off-by: Thomas Gleixner > --- > arch/x86/include/asm/spec-ctrl.h | 6 ++ > arch/x86/kernel/process.c | 108 ++++++++++++++++++++++++++++++++++= ++--- > arch/x86/kernel/smpboot.c | 5 + > 3 files changed, 113 insertions(+), 6 deletions(-) Reviewed-by: Borislav Petkov --=20 Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imend=C3=B6rffer, Jane Smithard, Graham Norton, HR= B 21284 (AG N=C3=BCrnberg) --=20