Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752688AbdGEKia (ORCPT ); Wed, 5 Jul 2017 06:38:30 -0400 Received: from terminus.zytor.com ([65.50.211.136]:36801 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751696AbdGEKi3 (ORCPT ); Wed, 5 Jul 2017 06:38:29 -0400 Date: Wed, 5 Jul 2017 03:32:43 -0700 From: tip-bot for Andy Lutomirski Message-ID: Cc: hpa@zytor.com, mingo@kernel.org, akpm@linux-foundation.org, arjan@linux.intel.com, bp@suse.de, linux-kernel@vger.kernel.org, mgorman@suse.de, torvalds@linux-foundation.org, riel@redhat.com, luto@kernel.org, dave.hansen@intel.com, peterz@infradead.org, tglx@linutronix.de, nadav.amit@gmail.com, bp@alien8.de Reply-To: mgorman@suse.de, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, luto@kernel.org, riel@redhat.com, arjan@linux.intel.com, bp@suse.de, hpa@zytor.com, mingo@kernel.org, akpm@linux-foundation.org, nadav.amit@gmail.com, bp@alien8.de, tglx@linutronix.de, peterz@infradead.org, dave.hansen@intel.com In-Reply-To: <8bbb2e65bcd249a5f18bfb8128b4689f08ac2b60.1498751203.git.luto@kernel.org> References: <8bbb2e65bcd249a5f18bfb8128b4689f08ac2b60.1498751203.git.luto@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/mm] x86/mm: Add the 'nopcid' boot option to turn off PCID Git-Commit-ID: 0790c9aad84901ca1bdc14746175549c8b5da215 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2648 Lines: 74 Commit-ID: 0790c9aad84901ca1bdc14746175549c8b5da215 Gitweb: http://git.kernel.org/tip/0790c9aad84901ca1bdc14746175549c8b5da215 Author: Andy Lutomirski AuthorDate: Thu, 29 Jun 2017 08:53:20 -0700 Committer: Ingo Molnar CommitDate: Wed, 5 Jul 2017 10:52:57 +0200 x86/mm: Add the 'nopcid' boot option to turn off PCID The parameter is only present on x86_64 systems to save a few bytes, as PCID is always disabled on x86_32. Signed-off-by: Andy Lutomirski Reviewed-by: Nadav Amit Reviewed-by: Borislav Petkov Reviewed-by: Thomas Gleixner Cc: Andrew Morton Cc: Arjan van de Ven Cc: Borislav Petkov Cc: Dave Hansen Cc: Linus Torvalds Cc: Mel Gorman Cc: Peter Zijlstra Cc: Rik van Riel Cc: linux-mm@kvack.org Link: http://lkml.kernel.org/r/8bbb2e65bcd249a5f18bfb8128b4689f08ac2b60.1498751203.git.luto@kernel.org Signed-off-by: Ingo Molnar --- Documentation/admin-guide/kernel-parameters.txt | 2 ++ arch/x86/kernel/cpu/common.c | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 9b0b3de..7037a0f 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2657,6 +2657,8 @@ nopat [X86] Disable PAT (page attribute table extension of pagetables) support. + nopcid [X86-64] Disable the PCID cpu feature. + norandmaps Don't use address space randomization. Equivalent to echo 0 > /proc/sys/kernel/randomize_va_space diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index c8b3987..904485e 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -168,6 +168,24 @@ static int __init x86_mpx_setup(char *s) } __setup("nompx", x86_mpx_setup); +#ifdef CONFIG_X86_64 +static int __init x86_pcid_setup(char *s) +{ + /* require an exact match without trailing characters */ + if (strlen(s)) + return 0; + + /* do not emit a message if the feature is not present */ + if (!boot_cpu_has(X86_FEATURE_PCID)) + return 1; + + setup_clear_cpu_cap(X86_FEATURE_PCID); + pr_info("nopcid: PCID feature disabled\n"); + return 1; +} +__setup("nopcid", x86_pcid_setup); +#endif + static int __init x86_noinvpcid_setup(char *s) { /* noinvpcid doesn't accept parameters */