From patchwork Wed Jul 11 11:29:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 10519533 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F3B326032A for ; Wed, 11 Jul 2018 11:32:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0002C28592 for ; Wed, 11 Jul 2018 11:32:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E788D285A5; Wed, 11 Jul 2018 11:32:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8935728592 for ; Wed, 11 Jul 2018 11:32:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 08DEB6B0295; Wed, 11 Jul 2018 07:30:25 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EFEB46B0298; Wed, 11 Jul 2018 07:30:24 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E16856B0299; Wed, 11 Jul 2018 07:30:24 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by kanga.kvack.org (Postfix) with ESMTP id 7BFB66B0295 for ; Wed, 11 Jul 2018 07:30:24 -0400 (EDT) Received: by mail-ed1-f69.google.com with SMTP id o5-v6so9873637edq.15 for ; Wed, 11 Jul 2018 04:30:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=Jm3ELZVAO9y47w496qRPKDWNmP1hoS4UMWx7P7JpYZk=; b=uKHoNwH7aFsO9FaYO7bfmYCbYyr+yM9HLozAolQahG6VJp4UxGhuGWDV73FvJkB4M7 3cvRpNvn4YDC8wSDCUuayfNv/aDIohFIIYr/m66r0Je4A/Cne1E+5+9/wsn/UrxYXPyp g7j1FvaL0AxhfjGhZ3d82JufwnE7LkKIoIBE6bTAAyWOA5eAOUe7IXfVPExT1yzyhD8H OcGjWhNB0eGhxv5QEg/sPKKiUcJ707uBPJewdu9qLxViP+sG2SHIHe7NjlgNUxoWOxr9 cBXop51lSSAVNJXEdYONXIWFs/hz0QdbCjFCem9caoqNiU3scFZ+hR38UnPr9MXMk8On Zvfw== X-Gm-Message-State: APt69E0n77UwT3rnzJUp5zh/hE4118NXRsY9O+dy49NqtrAErcyX4nDn FNwyulYSl1jynl03WMwp60xBLTXUTKAJEiALYrdu79IBBBWgY+D4tKoVZ+Rr+0dNRMfg3U3NiBh eNOVmodEAEbf78wYKll+EKmh0IrZamISg1FZIm87RBY2/W3C5v6eY8WdOMl0pcyXHiw== X-Received: by 2002:a50:a7a2:: with SMTP id i31-v6mr2145352edc.296.1531308624070; Wed, 11 Jul 2018 04:30:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfAM+VwWGGAYUBgdiaGsXDAEQsguj0PH2mHgQ5n/lMFUygsgrvUyux2QktjTZe6Pal9PSiZ X-Received: by 2002:a50:a7a2:: with SMTP id i31-v6mr2145313edc.296.1531308623430; Wed, 11 Jul 2018 04:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531308623; cv=none; d=google.com; s=arc-20160816; b=lcGSNjootPLcOPwA76Qk2i7rOutU/YNdBEdRC+y3OTXsdbV7l+cucLR+xIVytxJQdU WWEraIaH66h03TC1db5aLIiXG5LmiDir3ZEl5R6tgEPEn2+j5dElWoIVGsTJXe7hw2Ry k0Q3Zfje5dUFV17zwVWjrcghGB7n6DCxd6OjYAQPxXuA/kfZ6dog4yrNcqNBhQH/FS0T ntZcxJXgk8YGwwx8UToQhxkbSHr2oNZd+0tgZM2Rszq5z5Y+RUl9SUMiQfp3zYjYo0PY X9DxDUOXS/jroZrJy8CSLpWxmzHyfiWEvGXX+9E56Zmpy3TDc27aB7EPC0jC9wjcL33K MxtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Jm3ELZVAO9y47w496qRPKDWNmP1hoS4UMWx7P7JpYZk=; b=vLTydhjCP66cAtvQmClqVgpqC7+LSUMvk7cLsOkVOdYjYaz1OpPhbiCqRWf1kkzqHC bnQeTJau5mwxZZyMw6tJrvycwBH08O2KhrWfX6lgFD/Op/kBFDblbEPb5/yGOkZAnvJt oPfYtUTKkdbQKlMRS4kJ3SgAhcfP/Nv9NZZnZ/gxVAmOiTAlUKpOrcB8oDq6LlSmyo9M OTVhF5LdAFiDD3k57U73rL5LWYljDa6lwJzgYc7Nwq1yj4/z9bYWCRxk27sC/6qcD97a dqUXnJpknR7aO9muNl5MPwflTHB0NOebdREaAm62nmjZH7UW31uHoHrsKz/u032hyokz chHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=dcjsN+fd; spf=pass (google.com: domain of joro@8bytes.org designates 81.169.241.247 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: from theia.8bytes.org (8bytes.org. [81.169.241.247]) by mx.google.com with ESMTPS id e40-v6si603734ede.100.2018.07.11.04.30.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jul 2018 04:30:23 -0700 (PDT) Received-SPF: pass (google.com: domain of joro@8bytes.org designates 81.169.241.247 as permitted sender) client-ip=81.169.241.247; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=dcjsN+fd; spf=pass (google.com: domain of joro@8bytes.org designates 81.169.241.247 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: by theia.8bytes.org (Postfix, from userid 1000) id 96B1D30A1; Wed, 11 Jul 2018 13:30:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1531308608; bh=q4CDuLWy3KUGtyRWaR7mKNryqS8EfWnYZUNiGDPgwws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dcjsN+fdyD/eABUYXNehLSTwSiZ+fVn4PluV5xFnfAA7Q/JToPEJe+krzna9AUhgn Kk5cPin97S2GAu+wPSU/g+dtH1cXIDpOcs8X8D9ksoIwFMFjfuk91PXG2YErwNDHdW bZxq0FInJYteOFuQHlktk0uadFZs0yj1K40uNXYt1ihHA+/IEjIaSuEqplspa9Hk6l K4oedkC7rFWx8GRUBrPFMMIH6nYOKHXEhDQei7uVruKMVXMjj5Gu3mEPK4POwwMBfH cM58DtMuvLADy0ajIIGt4590qdqWqhmh9xIfEyB1zfMjVnxTNCRTffLFdp8+TSOmFc WTZ1AJEm5Nzkg== From: Joerg Roedel To: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , Andy Lutomirski , Dave Hansen , Josh Poimboeuf , Juergen Gross , Peter Zijlstra , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , Brian Gerst , David Laight , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , aliguori@amazon.com, daniel.gruss@iaik.tugraz.at, hughd@google.com, keescook@google.com, Andrea Arcangeli , Waiman Long , Pavel Machek , "David H . Gutteridge" , jroedel@suse.de, joro@8bytes.org Subject: [PATCH 38/39] x86/mm/pti: Add Warning when booting on a PCID capable CPU Date: Wed, 11 Jul 2018 13:29:45 +0200 Message-Id: <1531308586-29340-39-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531308586-29340-1-git-send-email-joro@8bytes.org> References: <1531308586-29340-1-git-send-email-joro@8bytes.org> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Joerg Roedel Warn the user in case the performance can be significantly improved by switching to a 64-bit kernel. Suggested-by: Andy Lutomirski Signed-off-by: Joerg Roedel --- arch/x86/mm/pti.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index b879ccd..e20283fa 100644 --- a/arch/x86/mm/pti.c +++ b/arch/x86/mm/pti.c @@ -517,6 +517,22 @@ void __init pti_init(void) pr_info("enabled\n"); +#ifdef CONFIG_X86_32 + if (boot_cpu_has(X86_FEATURE_PCID)) { + /* Use printk to work around pr_fmt() */ + printk(KERN_WARNING "\n"); + printk(KERN_WARNING "************************************************************\n"); + printk(KERN_WARNING "** WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! **\n"); + printk(KERN_WARNING "** **\n"); + printk(KERN_WARNING "** You are using 32-bit PTI on a 64-bit PCID-capable CPU. **\n"); + printk(KERN_WARNING "** Your performance will increase dramatically if you **\n"); + printk(KERN_WARNING "** switch to a 64-bit kernel! **\n"); + printk(KERN_WARNING "** **\n"); + printk(KERN_WARNING "** WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! **\n"); + printk(KERN_WARNING "************************************************************\n"); + } +#endif + pti_clone_user_shared(); /* Undo all global bits from the init pagetables in head_64.S: */