Received: by 10.223.176.46 with SMTP id f43csp2694522wra; Mon, 22 Jan 2018 01:45:13 -0800 (PST) X-Google-Smtp-Source: AH8x2242M+x8AYHFTWUhCelBih+Y60NMmraZp9DLnaRr1NM0vuMFB6CmJEmqd4U5gfruk1eTAwKD X-Received: by 10.98.58.194 with SMTP id v63mr8011630pfj.36.1516614313650; Mon, 22 Jan 2018 01:45:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516614313; cv=none; d=google.com; s=arc-20160816; b=vnCZE9wJyEsPJRi/v60PwxUp/Wj9I2Xd3lkDEmGvgepd+YGqqfKoMYDfCeokVHLc2Y lUPt9Upk57mhIPWd3REC+2H+xusSH26Tb/ZTBp05uOeyswYsueqUj4LdDLKRTGazRdsI Jr3Sz96AQHii0T98Wl6NJDP6kluKLBnBGpJkyFzzVnvyxpPQtlJqV2Ft87lGcqhhy2ys SFLwgE4nKZuVDGaR0gC1jYZ5Gb8S3KIYMNSWq/gOvpWL9LSrkPBjDoip3c+CreNnxmWS 4KpffahtezZQnwGVwxAq7kllyWXiAXffQPN+03vlcrKyIZCbYRwSH9zWrlyMK36MMMBD de8A== 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=YHFGw8eFcxx0MZHQW+1Dk8yx3/tjSSREadkM9MT1ng8=; b=ABCi9PP0tnI5j1mup7GG3PstOqQjflYEhJ9SKRtPPP0humiVLPstBb+cTx/h6yOqJu uLwSbjpAh6K1qdq7nm/pveXAf7mNJ4B/rf7/lbfDRmCNjqlRwxok3UVQXkrE9BDMgtSj xTUTzkJxit2iBIEa0Vom44q1YKrjvfeX/ePzN4f6STNQlKW5ztuPryjKx06M5ze1iOk4 Xz9xmkJo5HjBpQUQbcI/L10GmXUlQjZ68RGCf0GtBe661ynicUSK4sojR5iK82FRCHrx nl+/ZH55ZTBTZbUzjPrxKtXuUIJwTajMub5iFM25iCDHZXSLIoBij3dLTVVhQrmNbiir Rnxg== 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 k7si10028798pgq.759.2018.01.22.01.44.59; Mon, 22 Jan 2018 01:45:13 -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 S1751389AbeAVJoF (ORCPT + 99 others); Mon, 22 Jan 2018 04:44:05 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:58694 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751571AbeAVIly (ORCPT ); Mon, 22 Jan 2018 03:41:54 -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 00229EFC; Mon, 22 Jan 2018 08:41:53 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Lutomirski , Borislav Petkov , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , David Woodhouse Subject: [PATCH 4.4 04/53] x86/mm/32: Move setup_clear_cpu_cap(X86_FEATURE_PCID) earlier Date: Mon, 22 Jan 2018 09:39:56 +0100 Message-Id: <20180122083910.488931225@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083910.299610926@linuxfoundation.org> References: <20180122083910.299610926@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.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andy Lutomirski commit b8b7abaed7a49b350f8ba659ddc264b04931d581 upstream. Otherwise we might have the PCID feature bit set during cpu_init(). This is just for robustness. I haven't seen any actual bugs here. Signed-off-by: Andy Lutomirski Cc: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Fixes: cba4671af755 ("x86/mm: Disable PCID on 32-bit kernels") Link: http://lkml.kernel.org/r/b16dae9d6b0db5d9801ddbebbfd83384097c61f3.1505663533.git.luto@kernel.org Signed-off-by: Ingo Molnar Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/bugs.c | 8 -------- arch/x86/kernel/cpu/common.c | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -22,14 +22,6 @@ void __init check_bugs(void) { -#ifdef CONFIG_X86_32 - /* - * Regardless of whether PCID is enumerated, the SDM says - * that it can't be enabled in 32-bit mode. - */ - setup_clear_cpu_cap(X86_FEATURE_PCID); -#endif - identify_boot_cpu(); if (!IS_ENABLED(CONFIG_SMP)) { --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -838,6 +838,14 @@ static void __init early_identify_cpu(st setup_force_cpu_bug(X86_BUG_SPECTRE_V2); fpu__init_system(c); + +#ifdef CONFIG_X86_32 + /* + * Regardless of whether PCID is enumerated, the SDM says + * that it can't be enabled in 32-bit mode. + */ + setup_clear_cpu_cap(X86_FEATURE_PCID); +#endif } void __init early_cpu_init(void)