Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933378AbeAJCC4 (ORCPT + 1 other); Tue, 9 Jan 2018 21:02:56 -0500 Received: from mga11.intel.com ([192.55.52.93]:7132 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933275AbeAJCCz (ORCPT ); Tue, 9 Jan 2018 21:02:55 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,337,1511856000"; d="scan'208";a="8587867" Subject: Re: [patch RFC 5/5] x86/speculation: Add basic speculation control code To: Thomas Gleixner , LKML References: <20180110010652.404145126@linutronix.de> <20180110011350.855878109@linutronix.de> Cc: Linus Torvalds , x86@kernel.org, Peter Zijlstra , Borislav Petkov , David Woodhouse , Tim Chen , Andrea Arcangeli , Andi Kleen , Greg KH , Andy Lutomirski , Arjan Van De Ven From: Dave Hansen Message-ID: Date: Tue, 9 Jan 2018 18:02:53 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180110011350.855878109@linutronix.de> Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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.