From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb0-f200.google.com (mail-yb0-f200.google.com [209.85.213.200]) by kanga.kvack.org (Postfix) with ESMTP id 29E346B0005 for ; Mon, 5 Mar 2018 11:09:51 -0500 (EST) Received: by mail-yb0-f200.google.com with SMTP id r3-v6so7723839ybg.7 for ; Mon, 05 Mar 2018 08:09:51 -0800 (PST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id t141si2178044ywf.332.2018.03.05.08.09.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 08:09:50 -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: Denys Vlasenko Message-ID: Date: Mon, 5 Mar 2018 17:09:44 +0100 MIME-Version: 1.0 In-Reply-To: <1520245563-8444-35-git-send-email-joro@8bytes.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 , 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 11: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"); Isn't it a bit too dramatic? Not one, but two lines of big fat warnings? There are people who run 32-bit kernels on purpose, not because they did not yet realize 64 bits are upon us. E.g. industrial setups with strict regulations and licensing requirements. In many such cases they already are more than satisfied with CPU speeds, thus not interested in 64-bit migration for performance reasons, and avoid it because it would incur mountains of paperwork with no tangible gains. The big fat warning on every boot would be irritating. -- 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