From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f198.google.com (mail-qt0-f198.google.com [209.85.216.198]) by kanga.kvack.org (Postfix) with ESMTP id 1AD416B0024 for ; Mon, 5 Mar 2018 08:39:36 -0500 (EST) Received: by mail-qt0-f198.google.com with SMTP id g13so14147968qtj.15 for ; Mon, 05 Mar 2018 05:39:36 -0800 (PST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id r129si4377490qkd.206.2018.03.05.05.39.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 05:39:34 -0800 (PST) Subject: Re: [PATCH 34/34] x86/mm/pti: Add Warning when booting on a PCIE capable CPU References: <1520245563-8444-1-git-send-email-joro@8bytes.org> <1520245563-8444-35-git-send-email-joro@8bytes.org> From: Waiman Long Message-ID: Date: Mon, 5 Mar 2018 08:39:28 -0500 MIME-Version: 1.0 In-Reply-To: <1520245563-8444-35-git-send-email-joro@8bytes.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: owner-linux-mm@kvack.org List-ID: To: Joerg Roedel , 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 , jroedel@suse.de On 03/05/2018 05:26 AM, Joerg Roedel wrote: > 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 3ffd923..8f5aa0d 100644 > --- a/arch/x86/mm/pti.c > +++ b/arch/x86/mm/pti.c > @@ -385,6 +385,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(); > pti_clone_entry_text(); > pti_setup_espfix64(); Typo in the patch title: PCIE => PCID. -Longman -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org