Received: by 10.223.176.5 with SMTP id f5csp4403276wra; Tue, 30 Jan 2018 06:52:06 -0800 (PST) X-Google-Smtp-Source: AH8x227iIg034nJULJPQgio6FuiBfzcdmsUPTl85wJ4AjpcVqw3eLmDyJb2poPvo/oRa+R1bA7OJ X-Received: by 10.98.190.11 with SMTP id l11mr30845625pff.32.1517323926091; Tue, 30 Jan 2018 06:52:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517323926; cv=none; d=google.com; s=arc-20160816; b=suR00Lp5LoQiPvJxQJXN0YLElOhJGqHNH8nowmyI9R7akdJq1gsI3PX0aaTPwYnYn1 QrboyoZHzo6XbZ8I0m5y43tdhnFSNKi80h2PgdseOoJGVdi8KjgQldFNL10oa8Qtkstq W4h8yfnee+54wAYf7Jt4RE80Rb8zjtNFuRQ1KJJ0NiL9oj5NxvzHka9ejy0K1X2jv9dD M8iUclYxnSchlHkDSGJ6MwHBA7m1lFbBynyiRCYGdp2CO8af1lTCrwrRoN+LJ6LJseUD 0SBhfqNfC72QOf2wicw8lHq9rV8xzq4035+FYH5bMKVnTUg2vzT1NvrnN3dpKehd26Bh wCyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=ihQo8v15M1cFOIRjr6a4QxSWLcoYZJz+fUyanEP9vhg=; b=CeLk9UY6GBTH/4BXhYVW++Fv2qsLSJI1IzaF+A2LMmV5xL7nx0Pi7NW++6B0kMvMTZ ISIK9Mybi9hhmiY/ACRofcDYON+pSxmQziBapu3Or7UCCLLfEZTwEe5VNxq5g/RapEYf xIC9XWevakbaC6PO2FhI3o05n/lN9L2FeJrKR9Vo3HflUtDN3cKkcky0VP576sOQCKwY J0wxGDXxlgguu8SRyXUwZuWPt6t3Qsrouee6Ot5YS9JfhTI684yXe0kUWAJZX+B0bXR7 9bziKcNorzgBTPnLrUKFHxlVSlA/ApVAQH72xHZXZZAlPcx+uBr6RWRSuFx4ixjsytZ8 NvNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i7si1180656pgn.212.2018.01.30.06.51.51; Tue, 30 Jan 2018 06:52:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751761AbeA3Ouj (ORCPT + 99 others); Tue, 30 Jan 2018 09:50:39 -0500 Received: from terminus.zytor.com ([65.50.211.136]:36547 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751698AbeA3Ouh (ORCPT ); Tue, 30 Jan 2018 09:50:37 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w0UEnJao011946; Tue, 30 Jan 2018 06:49:19 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w0UEnJGt011942; Tue, 30 Jan 2018 06:49:19 -0800 Date: Tue, 30 Jan 2018 06:49:19 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Dou Liyang Message-ID: Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, misono.tomohiro@jp.fujitsu.com, douly.fnst@cn.fujitsu.com, tglx@linutronix.de Reply-To: mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, douly.fnst@cn.fujitsu.com, misono.tomohiro@jp.fujitsu.com, hpa@zytor.com In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/pti] x86/spectre: Check CONFIG_RETPOLINE in command line parser Git-Commit-ID: 9471eee9186a46893726e22ebb54cade3f9bc043 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 9471eee9186a46893726e22ebb54cade3f9bc043 Gitweb: https://git.kernel.org/tip/9471eee9186a46893726e22ebb54cade3f9bc043 Author: Dou Liyang AuthorDate: Tue, 30 Jan 2018 14:13:50 +0800 Committer: Thomas Gleixner CommitDate: Tue, 30 Jan 2018 15:30:35 +0100 x86/spectre: Check CONFIG_RETPOLINE in command line parser The spectre_v2 option 'auto' does not check whether CONFIG_RETPOLINE is enabled. As a consequence it fails to emit the appropriate warning and sets feature flags which have no effect at all. Add the missing IS_ENABLED() check. Fixes: da285121560e ("x86/spectre: Add boot time option to select Spectre v2 mitigation") Signed-off-by: Dou Liyang Signed-off-by: Thomas Gleixner Cc: ak@linux.intel.com Cc: peterz@infradead.org Cc: Tomohiro" Cc: dave.hansen@intel.com Cc: bp@alien8.de Cc: arjan@linux.intel.com Cc: dwmw@amazon.co.uk Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/f5892721-7528-3647-08fb-f8d10e65ad87@cn.fujitsu.com --- arch/x86/kernel/cpu/bugs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 3bfb2b2..400c34e 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -213,10 +213,10 @@ static void __init spectre_v2_select_mitigation(void) return; case SPECTRE_V2_CMD_FORCE: - /* FALLTRHU */ case SPECTRE_V2_CMD_AUTO: - goto retpoline_auto; - + if (IS_ENABLED(CONFIG_RETPOLINE)) + goto retpoline_auto; + break; case SPECTRE_V2_CMD_RETPOLINE_AMD: if (IS_ENABLED(CONFIG_RETPOLINE)) goto retpoline_amd;