Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965313AbeAJJXK (ORCPT + 1 other); Wed, 10 Jan 2018 04:23:10 -0500 Received: from merlin.infradead.org ([205.233.59.134]:53288 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965291AbeAJJXG (ORCPT ); Wed, 10 Jan 2018 04:23:06 -0500 Date: Wed, 10 Jan 2018 10:22:34 +0100 From: Peter Zijlstra To: Dave Hansen Cc: Thomas Gleixner , LKML , Linus Torvalds , x86@kernel.org, Borislav Petkov , David Woodhouse , Tim Chen , Andrea Arcangeli , Andi Kleen , Greg KH , Andy Lutomirski , Arjan Van De Ven Subject: Re: [patch RFC 5/5] x86/speculation: Add basic speculation control code Message-ID: <20180110092234.GY29822@worktop.programming.kicks-ass.net> References: <20180110010652.404145126@linutronix.de> <20180110011350.855878109@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, Jan 09, 2018 at 06:02:53PM -0800, Dave Hansen wrote: > On 01/09/2018 05:06 PM, Thomas Gleixner wrote: > > --- a/arch/x86/kernel/cpu/bugs.c > > +++ b/arch/x86/kernel/cpu/bugs.c > > @@ -79,6 +79,7 @@ enum spectre_v2_mitigation_cmd { > > SPECTRE_V2_CMD_RETPOLINE, > > SPECTRE_V2_CMD_RETPOLINE_GENERIC, > > SPECTRE_V2_CMD_RETPOLINE_AMD, > > + SPECTRE_V2_CMD_IBRS, > > }; > > A few nits on this: > > IBRS should not default on anywhere, which goes double when retpolines > are available. > > I think I'd also prefer that we separate the IBRS and retpoline enabling > so that you can do both if you want. They do nearly the same thing in > practice, but I can't convince myself that you never ever need IBRS once > retpolines are in place. As per: https://lkml.kernel.org/r/1515460999.4423.104.camel@amazon.co.uk IBRS=2 (always on) is preferred for SKL+ over retpoline. And from what I gather IBRS=1 is never better than retpoline, IBRS=1 is both slower and covers less AFAIU (please educate if I'm wrong). >From this point, I would prefer to not even have the IBRS=1 code. The only question I have is if retpoline works at all on SKL (with ucode update); BDW needs the ucode update for retpoline to work because of the RSB fallback.