Received: by 10.223.185.116 with SMTP id b49csp3212316wrg; Mon, 5 Mar 2018 16:40:06 -0800 (PST) X-Google-Smtp-Source: AG47ELtlpKRGd9/hZ1QmrgoPHjbbtvK8nx9HrAmO+u7V7WxPQkMtiiPwDWXnkwUd5zzJy8I4VANJ X-Received: by 2002:a17:902:68cc:: with SMTP id x12-v6mr14829063plm.198.1520296806707; Mon, 05 Mar 2018 16:40:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520296806; cv=none; d=google.com; s=arc-20160816; b=gIxBfe4IbPLno0s1Ksb6W5jArygrqiBicdx8u7tpvGG9M97+gtDP4sq7f+7YA9BXA9 EsLfcnc0EpGtb+dvmqWgFyyhqaFUvuq8muRDl/UqXY/pvMJSh100SEbmt6eH8+ok7Xpv 4b4g+FLWOKsmaAy86yNeB8dTdGpdsYcGqftv5mgHt45jHoMzvkhI2baBmmkYf0ecND1x QzuJHF71Qo60MldyJP9ECxysHxHBMFekS4nfws2pCJaToNZQPGdhbcHwWD/efHca3dnn K+Lkl2pzAhNTXvIu+Aho1omDGnpjYSf+Lmduj/qly9MOIMqUkmrkWgZ6sY79BEn9/Bq3 b7og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:arc-authentication-results; bh=NnoxVu0rYiqiDvjwEt6ao/PM8XzFNUz5pLfQ1GinYCw=; b=Uz66nTzrqn2eaYJ1raXL4gO/2Vh5rdTebw3wdVA43Yh9Gil31S1fiGuLvgJQNEDzHK T8XujLR+zzNPYhF58EjPvTOLXewX7oBbiSgQNAWP83E4NnZuJ7EBSAD11qDuGRtPA0OF gBwTfnEeOS7OhEVOPSWJCA55B5Ec/kjGlefNKcMESCI4rKpF9l0TcX8kIE2nH2bHz0sI 3FvKqAfol8iz1nQ4kKyaH3WxpA9mf5XPNBjOLqPeo+RXHECQCLUihwqLXba9lumpGybj 9Q0knaEnA1Fj/NpRjjbKxjiKXrNgA8MGahORmKBr5/1M4Di3V7f9DHVXxSK6u9w7fYZU 3vBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=ghz8Gs/o; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y64si11212282pfj.47.2018.03.05.16.39.51; Mon, 05 Mar 2018 16:40: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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=ghz8Gs/o; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933688AbeCFAiU (ORCPT + 99 others); Mon, 5 Mar 2018 19:38:20 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:34860 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933077AbeCFA0U (ORCPT ); Mon, 5 Mar 2018 19:26:20 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w260Lv2t115133; Tue, 6 Mar 2018 00:26:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=NnoxVu0rYiqiDvjwEt6ao/PM8XzFNUz5pLfQ1GinYCw=; b=ghz8Gs/oJ3SIcY9hVVM5GSOoWlwgsLXOrx80FUoJNWSfDjDoK8TXI+LFXji5u9krZVNI CKp0giYEKr/yq9xXsVxqGVgQJY2EcKM3GCs93thOGvW/03pKq0XWnrLNS9S1r3d8Hz7U JG2Oq3wgMATMEXBZsfu3ZDp9Ptm2fXOI+RvSe7xtdwPtujVw8qB1+UcKZSwnnns4y5P6 QY2WOEtm23ltBxZJEuTAToEIFd1XgvHgZtLRk7xuvk93StmJ7rQhtTvIeCtAhD/OhFV0 QxVpSwcXMc1KubNvDKWwTkAelGj96v2BJC5ky9tx9jGgmJJSxlX+U8QJHbJWh40yx1mD ZQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2ghdxf8k4s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Mar 2018 00:26:16 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w260QFhb030030 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Mar 2018 00:26:15 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w260QERO025051; Tue, 6 Mar 2018 00:26:15 GMT Received: from localhost.localdomain (/98.216.35.41) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 05 Mar 2018 16:26:14 -0800 From: Pavel Tatashin To: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux-kernel@vger.kernel.org, Alexander.Levin@microsoft.com, dan.j.williams@intel.com, sathyanarayanan.kuppuswamy@intel.com, pankaj.laxminarayan.bharadiya@intel.com, akuster@mvista.com, cminyard@mvista.com, pasha.tatashin@oracle.com, gregkh@linuxfoundation.org, stable@vger.kernel.org Subject: [PATCH 4.1 19/65] x86/mm: Add the 'nopcid' boot option to turn off PCID Date: Mon, 5 Mar 2018 19:24:52 -0500 Message-Id: <20180306002538.1761-20-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180306002538.1761-1-pasha.tatashin@oracle.com> References: <20180306002538.1761-1-pasha.tatashin@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8823 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803060003 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Lutomirski commit 0790c9aad84901ca1bdc14746175549c8b5da215 upstream. 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 Cc: Hugh Dickins Signed-off-by: Greg Kroah-Hartman (cherry picked from commit dcccd3c266e24ce80ecf592765315c54c222ac33) Signed-off-by: Pavel Tatashin --- Documentation/kernel-parameters.txt | 2 ++ arch/x86/kernel/cpu/common.c | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index ceaab09a279e..97bc24101896 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -2471,6 +2471,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. 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 90ef802d9d90..843be1de5ddb 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -172,6 +172,24 @@ static int __init x86_xsaves_setup(char *s) } __setup("noxsaves", x86_xsaves_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 */ -- 2.16.2