Received: by 10.223.185.116 with SMTP id b49csp3215429wrg; Mon, 5 Mar 2018 16:45:01 -0800 (PST) X-Google-Smtp-Source: AG47ELtGUa2AQSWbBNKYTFvBqhZ2KPy9Amvf+sA/Wk8P4opuzESp5FWraZf9O4PsNifj5RahCAp/ X-Received: by 10.99.116.90 with SMTP id e26mr13309028pgn.16.1520297101696; Mon, 05 Mar 2018 16:45:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520297101; cv=none; d=google.com; s=arc-20160816; b=KlXioGvUam4wXtif1Q5wKmCTwwF7qxaZM3Rui/BPcr6FnXpOzqQbI10usGIqlE1DCh BjnMluiV5GPQlVHqdqBSYbouq+7aJa54c+XGxAZW0n9xOEFDjG0a8TRs0jnRGpBfqlTq LULROIowp1PczcjUioauAYvChKu1isLa4x42CHVhftE9fg+LvSbrcXWT5kXO9pkt2Z0u POKHXJ4HWfE7LncX2XGWdrQ8S5rwj8wiFKCKG6yz8p11o7BWeKkHE3pdA5SxpLwW/+9m fQKd2OuEf9YU5VHMeIv8p8/vTcaklR64xVo0bPDEmEZEYm3SW0f67WODVaftJtdCnLeH Q7Wg== 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=7JCwPZhWmhXE8JhuZ96IN4amCZr1NWomJ5OlnuqK8rY=; b=Uw+An92Oc6Lu6wn1gouugp0GbR9LNdj1Tz+i7UsP7/Rxfyh6tAO46je5imjrul938D +JyPpewDNgfU+7SvLbTyHd0jQleSE8WINfaXHD8B1BiFotqT6KxNGaVs1qLI9tTslpHi xrknkBTsARgva+9M5O5Z/e8Ws/wXZhQjE8/iNEoxeeZLdAGHV0/KzckOa00Q2A6Fioa8 qmHcAMFRI/SIufHbn4bhTsLRPBh4t3c2+InquHHcqr4AmIrfbwApdIFUhN5S/0OfBDrk ttsow5LMi5MjTw4jndWHKLVBkIj8UMr0hfelsVIRmUBJ26G/ILYi73tHGgiWXKBJXAyM ceoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=oG02c+pa; 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 y10si9017890pgv.456.2018.03.05.16.44.47; Mon, 05 Mar 2018 16:45:01 -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=oG02c+pa; 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 S933127AbeCFAnK (ORCPT + 99 others); Mon, 5 Mar 2018 19:43:10 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:34688 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932406AbeCFA0E (ORCPT ); Mon, 5 Mar 2018 19:26:04 -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 w260M1gN115409; Tue, 6 Mar 2018 00:26:00 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=7JCwPZhWmhXE8JhuZ96IN4amCZr1NWomJ5OlnuqK8rY=; b=oG02c+pahVMKW/D46/CUox+clqmaz82dbWYLCifru6CmeAlN0rQMPA6TejmDpZlU2X5D pVqgTekwkh74YzUnqJWgfvEDKoAUaWI9DbYXOTavS9Q5bBNKlOgE6TVloP4IkF+Vzqj1 yZncUPz7ne29GbpObAT3WnZvbxaNUb5fZl9iYOgU2tKboflbPRXxJORUjpf6BPZjAHGF 1fzSvdZJlcoqX6B2xk0z5VQzCslUKMUS8/QxjHWbIapgZQLj/mpIcnrMlRSNmirdFX7K 7wrffJI4cyMpG9gXTwE8ODEV/G4iR/DL07IeJS8GVCN8yOl9j9hjIdAqkGTxiKg3imKC eQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2ghdxf8k43-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Mar 2018 00:26:00 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w260PxCJ023861 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Mar 2018 00:25:59 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 w260PxYD024877; Tue, 6 Mar 2018 00:25:59 GMT Received: from localhost.localdomain (/98.216.35.41) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 05 Mar 2018 16:25:58 -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 03/65] x86/mm: Add a 'noinvpcid' boot option to turn off INVPCID Date: Mon, 5 Mar 2018 19:24:36 -0500 Message-Id: <20180306002538.1761-4-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 d12a72b844a49d4162f24cefdab30bed3f86730e upstream. This adds a chicken bit to turn off INVPCID in case something goes wrong. It's an early_param() because we do TLB flushes before we parse __setup() parameters. Signed-off-by: Andy Lutomirski Reviewed-by: Borislav Petkov Cc: Andrew Morton Cc: Andrey Ryabinin Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Dave Hansen Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Luis R. Rodriguez Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Toshi Kani Cc: linux-mm@kvack.org Link: http://lkml.kernel.org/r/f586317ed1bc2b87aee652267e515b90051af385.1454096309.git.luto@kernel.org Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 791a0f3fecdabe18cc291e5f9b7ebbdc81895975) Signed-off-by: Pavel Tatashin --- Documentation/kernel-parameters.txt | 2 ++ arch/x86/kernel/cpu/common.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 08dc303d0d47..ceaab09a279e 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -2435,6 +2435,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. nointroute [IA-64] + noinvpcid [X86] Disable the INVPCID cpu feature. + nojitter [IA-64] Disables jitter checking for ITC timers. no-kvmclock [X86,KVM] Disable paravirtualized KVM clock driver diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 5732326ec126..90ef802d9d90 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -172,6 +172,22 @@ static int __init x86_xsaves_setup(char *s) } __setup("noxsaves", x86_xsaves_setup); +static int __init x86_noinvpcid_setup(char *s) +{ + /* noinvpcid doesn't accept parameters */ + if (s) + return -EINVAL; + + /* do not emit a message if the feature is not present */ + if (!boot_cpu_has(X86_FEATURE_INVPCID)) + return 0; + + setup_clear_cpu_cap(X86_FEATURE_INVPCID); + pr_info("noinvpcid: INVPCID feature disabled\n"); + return 0; +} +early_param("noinvpcid", x86_noinvpcid_setup); + #ifdef CONFIG_X86_32 static int cachesize_override = -1; static int disable_x86_serial_nr = 1; -- 2.16.2