Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965313AbeALW5Y (ORCPT + 1 other); Fri, 12 Jan 2018 17:57:24 -0500 Received: from mga03.intel.com ([134.134.136.65]:40630 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965257AbeALW5X (ORCPT ); Fri, 12 Jan 2018 17:57:23 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,350,1511856000"; d="scan'208";a="19695258" Date: Fri, 12 Jan 2018 14:57:14 -0800 From: Andi Kleen To: Dominik Brodowski Cc: Andi Kleen , tglx@linutronix.de, x86@kernel.org, dwmw@amazon.co.uk, linux-kernel@vger.kernel.org, pjt@google.com, torvalds@linux-foundation.org, gregkh@linux-foundation.org, peterz@infradead.org, luto@amacapital.net, thomas.lendacky@amd.com, arjan.van.de.ven@intel.com Subject: Re: [PATCH 1/4] x86/retpoline: Add new mode RETPOLINE_UNDERFLOW Message-ID: <20180112225714.GQ6718@tassilo.jf.intel.com> References: <20180112184550.6573-1-andi@firstfloor.org> <20180112184550.6573-2-andi@firstfloor.org> <20180112221313.GA13035@light.dominikbrodowski.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180112221313.GA13035@light.dominikbrodowski.net> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Fri, Jan 12, 2018 at 11:13:13PM +0100, Dominik Brodowski wrote: > > @@ -209,6 +234,11 @@ static void __init spectre_v2_select_mitigation(void) > > mode = retp_compiler() ? SPECTRE_V2_RETPOLINE_GENERIC : > > SPECTRE_V2_RETPOLINE_MINIMAL; > > setup_force_cpu_cap(X86_FEATURE_RETPOLINE); > > + if (mode == SPECTRE_V2_RETPOLINE_GENERIC && > > + cpu_needs_underflow_protection()) { > > + mode = SPECTRE_V2_RETPOLINE_UNDERFLOW; > > + setup_force_cpu_cap(X86_FEATURE_RETURN_UNDERFLOW); > > + } > > } > > Why does this require a retp-compatible compiler to be enabled? Without the compiler you have a lot of other problems already, so it's fairly pointless. -Andi