Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965271AbeALW1B (ORCPT + 1 other); Fri, 12 Jan 2018 17:27:01 -0500 Received: from isilmar-4.linta.de ([136.243.71.142]:34024 "EHLO isilmar-4.linta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965212AbeALW1A (ORCPT ); Fri, 12 Jan 2018 17:27:00 -0500 X-Greylist: delayed 323 seconds by postgrey-1.27 at vger.kernel.org; Fri, 12 Jan 2018 17:26:59 EST Date: Fri, 12 Jan 2018 23:13:13 +0100 From: Dominik Brodowski To: Andi Kleen Cc: 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, Andi Kleen Subject: Re: [PATCH 1/4] x86/retpoline: Add new mode RETPOLINE_UNDERFLOW Message-ID: <20180112221313.GA13035@light.dominikbrodowski.net> References: <20180112184550.6573-1-andi@firstfloor.org> <20180112184550.6573-2-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180112184550.6573-2-andi@firstfloor.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: > @@ -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? Thanks, Dominik