From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x226g7SufHuE7+CdwdpgH55jJBVReEG4oJ9sIn5Hzi0kx61YHTdOdo9Z/4KFKyfARBw/dIO+V ARC-Seal: i=1; a=rsa-sha256; t=1516610515; cv=none; d=google.com; s=arc-20160816; b=VwvGht1nyO9k5KPiEGMvVttTKL0ZzLLHPRf+9DwtstpEsdFlI/Z9a3X69kHVUK0Tul vQSuh7lR9GCzg1uGErT0S7sd4XdR3h8TvnXJ558/0mm/1E22sItcjveKPTexQjfjGf7/ twC1NtJ43IMsn7Wc2q3+sqwjTIe4pxUzHpa37Cs73nlJCh8YglWcDimPsW1qXYZdTg9k 9xmaC0Ge5x9NFfuxKLKSajiVzDiWRXlHpsu7mEN0btePXX0+wLShEvVBoRALKrDFYmHj Ptzsal8J6hTyfQm8RdtnEotv+LzszDlE7CBsg5tuAoYiFA3a1k4Cl6rumy4mr7eYyuYq eRvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=YHFGw8eFcxx0MZHQW+1Dk8yx3/tjSSREadkM9MT1ng8=; b=S+fTrIkb4lwqyrC41T9N0PsdxtTBdIfEuXsHBlza/6p9hYq9FIDEznc0iPdVYw+Bpd rHpJVidFxg7hWzG/nfMst0GDcOwVLsSaPTAA8FmgPpc7AizVuvfmCbONwwAFzD5yXbIf Med8Ku94HJuJuKvnx00uYDHZ9zw6e3pT38eWzN22SnW6zk/hT406hXuiE3PLfjbwG8S1 3OmuqY2/QeziOVmfCaiwoejz3dmAzwHV8+36miD9YpIohg56sC6INROHtPtROWC1AP3B eF/E+THtINAvL4WriQ6sv5/dLbxDZRiVFBPsLoNihFmLHi+1Xw/3BeRnr4iBdQ4GLcRE QwSw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590281387937247356?= X-GMAIL-MSGID: =?utf-8?q?1590281387937247356?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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)