[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1558022133.835402784@decadent.org.uk>
Date: Thu, 16 May 2019 16:55:33 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, Denis Kirjanov <kda@...ux-powerpc.org>,
"Arjan van de Ven" <arjan@...ux.intel.com>,
"Andrea Arcangeli" <aarcange@...hat.com>,
"Josh Poimboeuf" <jpoimboe@...hat.com>,
"Greg KH" <gregkh@...uxfoundation.org>,
"Tom Lendacky" <thomas.lendacky@....com>,
"Tim Chen" <tim.c.chen@...ux.intel.com>,
"Andy Lutomirski" <luto@...nel.org>,
"Casey Schaufler" <casey.schaufler@...el.com>,
"Waiman Long" <longman9394@...il.com>,
"Linus Torvalds" <torvalds@...ux-foundation.org>,
"Jon Masters" <jcm@...hat.com>,
"Dave Stewart" <david.c.stewart@...el.com>,
"Asit Mallick" <asit.k.mallick@...el.com>,
"David Woodhouse" <dwmw@...zon.co.uk>,
"Thomas Gleixner" <tglx@...utronix.de>,
"Kees Cook" <keescook@...omium.org>,
"Jiri Kosina" <jkosina@...e.cz>,
"Peter Zijlstra" <peterz@...radead.org>,
"Dave Hansen" <dave.hansen@...el.com>,
"Ingo Molnar" <mingo@...nel.org>, "Andi Kleen" <ak@...ux.intel.com>
Subject: [PATCH 3.16 38/86] x86/speculation: Disable STIBP when enhanced
IBRS is in use
3.16.68-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Tim Chen <tim.c.chen@...ux.intel.com>
commit 34bce7c9690b1d897686aac89604ba7adc365556 upstream.
If enhanced IBRS is active, STIBP is redundant for mitigating Spectre v2
user space exploits from hyperthread sibling.
Disable STIBP when enhanced IBRS is used.
Signed-off-by: Tim Chen <tim.c.chen@...ux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Ingo Molnar <mingo@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Jiri Kosina <jkosina@...e.cz>
Cc: Tom Lendacky <thomas.lendacky@....com>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Andrea Arcangeli <aarcange@...hat.com>
Cc: David Woodhouse <dwmw@...zon.co.uk>
Cc: Andi Kleen <ak@...ux.intel.com>
Cc: Dave Hansen <dave.hansen@...el.com>
Cc: Casey Schaufler <casey.schaufler@...el.com>
Cc: Asit Mallick <asit.k.mallick@...el.com>
Cc: Arjan van de Ven <arjan@...ux.intel.com>
Cc: Jon Masters <jcm@...hat.com>
Cc: Waiman Long <longman9394@...il.com>
Cc: Greg KH <gregkh@...uxfoundation.org>
Cc: Dave Stewart <david.c.stewart@...el.com>
Cc: Kees Cook <keescook@...omium.org>
Link: https://lkml.kernel.org/r/20181125185003.966801480@linutronix.de
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
arch/x86/kernel/cpu/bugs.c | 7 +++++++
1 file changed, 7 insertions(+)
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -380,6 +380,10 @@ static bool stibp_needed(void)
if (spectre_v2_enabled == SPECTRE_V2_NONE)
return false;
+ /* Enhanced IBRS makes using STIBP unnecessary. */
+ if (spectre_v2_enabled == SPECTRE_V2_IBRS_ENHANCED)
+ return false;
+
if (!boot_cpu_has(X86_FEATURE_STIBP))
return false;
@@ -823,6 +827,9 @@ static void __init l1tf_select_mitigatio
static char *stibp_state(void)
{
+ if (spectre_v2_enabled == SPECTRE_V2_IBRS_ENHANCED)
+ return "";
+
if (x86_spec_ctrl_base & SPEC_CTRL_STIBP)
return ", STIBP";
else
Powered by blists - more mailing lists