Received: by 10.223.185.116 with SMTP id b49csp2450276wrg; Mon, 5 Mar 2018 03:09:42 -0800 (PST) X-Google-Smtp-Source: AG47ELuu33YqEorbcKciKWXlOK7FbSloBQzpbfp44neBT4Twk5+PuUAEyyrn4URGWaz/18zdIm69 X-Received: by 10.99.127.69 with SMTP id p5mr11816554pgn.346.1520248182487; Mon, 05 Mar 2018 03:09:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520248182; cv=none; d=google.com; s=arc-20160816; b=mVijO11L03ibrEi5fGzEQ4DYfZgwdGxZUCiSl2rfRM4zSu9MoSMRoJ244ToFT+D3kA BUGp6S0K5hQhjhynX4iiLV6Vry8fdTxb6OfEb8LiXXlYrkCnaoYE+9EzIuWtIO/1iUP3 +anEYEmRk4vqYANwtg4WUpQA5fc8BlFVZooGET8AI/h3Ka/28c5QYCghJIvXlkPao2gq 6p8xRPhXESFWKjkyabzuTsNDkuF0GoMEKj65m9IX/W+Tsd3TRHqrU0EpLqrywsQOFb5b OpFhHMk5numwSC2FR3I/XfKvx7lG1xA7h/nPez+Oqit73adf1UuQVyfawlt0YouSBM7u wFNQ== 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:cc:to:from:dkim-signature:arc-authentication-results; bh=Bb0yXFnnfWeJuIId9R35QPqjkYX4kDq1nzrBg7fvyCM=; b=nMJxQfxrZxccf1fvvr8kGDFcPGfR4mBLbLSv5bFhr2L7EiNq9zXbsOG89Py6QMCI/6 zS0qWG8QRwtwHBl/9J4pIirxklA8Zl1AWcNLzWStQyNgJfrzK8EawuOS79ocGHJQJJ+N WZnRk72BV9A7dwzF8Gp9JMIyozcY4Yq6454pOC9sgHqOmcSuRAl8VP/BqU/a4Tw00G/B 5bdU5i8yUIuvC2dm8IYkDnc0bZxvkLmVplM9VTtPZ3XbVOX5MOwV06HIJugsBH2nwO/c MxejsAEaRoBx8um/VEl4nPBn8JTVk5Glx2G9ZaVx8yjjngmAPul6/bPmZzNV5SF0rFF7 yrbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=hsmbDYuS; 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=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e12si8277741pgu.155.2018.03.05.03.09.27; Mon, 05 Mar 2018 03:09:42 -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=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=hsmbDYuS; 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=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933972AbeCEK1U (ORCPT + 99 others); Mon, 5 Mar 2018 05:27:20 -0500 Received: from 8bytes.org ([81.169.241.247]:55548 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933841AbeCEK0Z (ORCPT ); Mon, 5 Mar 2018 05:26:25 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id 122B85021; Mon, 5 Mar 2018 11:26:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1520245571; bh=njZcqQuOV1EEYiKtx3pflbvC4GelfKQmYBMtPkLNq5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hsmbDYuSR2yVreiH1H4ZbYukhmmJDwlH0qMV5dzyLvFFVMAHorwTuisfF6ZSqrbPd ReCdrxz29qZruWJfuZfivh6MSW2ZgmBOiqmVmM6zDjNcREBBvirU+VY5VISpew1oPn Mg1t7jH5Sk7kWpl2PKwCIcsR4CLYjpfKQvzZ9CYfMEB0j2JtLBz6kVv1eFKQtc8KO4 5dKkyiZ/UTj/DqocRe0K1XltFnR1bV5wUo88UvOIZ9L+jgbCBU0t74jUTKBub+mvZ9 GwY78JfckpzqIE/SywMKGjXdy+C5aMX4yvsGJFiztBPJy9VfQ3ZKzWv5H0b0fsDyaW 2yi2zrr5xvI1w== 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 , jroedel@suse.de, joro@8bytes.org Subject: [PATCH 34/34] x86/mm/pti: Add Warning when booting on a PCIE capable CPU Date: Mon, 5 Mar 2018 11:26:03 +0100 Message-Id: <1520245563-8444-35-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520245563-8444-1-git-send-email-joro@8bytes.org> References: <1520245563-8444-1-git-send-email-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(); -- 2.7.4