Received: by 10.223.176.5 with SMTP id f5csp707533wra; Fri, 9 Feb 2018 06:02:05 -0800 (PST) X-Google-Smtp-Source: AH8x225BhuwBttKu+JIyrKD/nvUuK3I2BOOSCKl2ECvSnvSC7AlZ6ydqgUuHjMo23o5k42DRMg0G X-Received: by 10.98.157.213 with SMTP id a82mr2963568pfk.242.1518184925548; Fri, 09 Feb 2018 06:02:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518184925; cv=none; d=google.com; s=arc-20160816; b=HJZuYsdXHLCJCiwXDC4QYRnGXttvzVW/jbqQVVKy/UWOgIC55qcd8Wra2HiCJR+v1A N2QnJDwQ5Nl5PWg4p416UWuQA1A9WvotukM5phC72qpv2NFzzJP292MxDtkuFc5iqyyG TAdnhczheDY6Iii67GdZzddqY1IrXmEheHPOHsxxOQv83C1MpV9G7Se8ff3esPVCPgX0 NwXyT9/YLWpxAdBy7PcB9+vRNQQZcKxZR0Yp6Mo9JK2k+dKC47b2gn2dMEK6766yPCZp orWxG0yfieqd//yQpDA9nbREZIMzmqe2zL8U7FJZBM12KziWqIyATwgOkUh/G6DZUyQc s8Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=v9rzUzpjy0DEcO1lU6jhY1+82fO0Bsp68eZX0UiYKDI=; b=bG8aJne6eEi+aaWOooIJ4hCK4P0MSS/ZUe2stbnd0yozi0FX7gF1KbPjAMBwCwDvjR v88DHR7SQ8fnZlJ/qjPRg3CWyxdw/Zcg0wu5ixjZaupt3W6suC7JL+j3mk+LeoPYPp+Z GW+A856f3uT9NqygCYsBtVTqKBmvL3nAFTP1UGdjs2tocW+le/yXHbt/JlS3/z0wzles S7Asi6AgCbdw1s26P7kOSkSxvjVWqCx51Q27k8CyZomraCdKhN5J8+YbyXn3Kb0y1zea 5ITQZb4GSI5WNA1uqT6SbLYsIk0d8NuTTEIslnYbc2Zp/45lMSrXobHZCbsbdAhfdmAB en9w== 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 f74si1055745pfa.365.2018.02.09.06.01.45; Fri, 09 Feb 2018 06:02:05 -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 S1753604AbeBIN7q (ORCPT + 99 others); Fri, 9 Feb 2018 08:59:46 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:51352 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752995AbeBINoV (ORCPT ); Fri, 9 Feb 2018 08:44:21 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6DCAC1080; Fri, 9 Feb 2018 13:44:20 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dou Liyang , Thomas Gleixner , ak@linux.intel.com, peterz@infradead.org, Tomohiro , dave.hansen@intel.com, bp@alien8.de, arjan@linux.intel.com, dwmw@amazon.co.uk Subject: [PATCH 4.9 52/92] x86/spectre: Check CONFIG_RETPOLINE in command line parser Date: Fri, 9 Feb 2018 14:39:21 +0100 Message-Id: <20180209133934.972811022@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180209133931.211869118@linuxfoundation.org> References: <20180209133931.211869118@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dou Liyang (cherry picked from commit 9471eee9186a46893726e22ebb54cade3f9bc043) 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 Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/bugs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -212,10 +212,10 @@ static void __init spectre_v2_select_mit 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;