All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Tom Lendacky <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: dave.hansen@linux.intel.com, bp@suse.de, luto@kernel.org,
	linux-kernel@vger.kernel.org, hpa@zytor.com,
	thomas.lendacky@amd.com, mingo@kernel.org, tglx@linutronix.de
Subject: [tip:x86/pti] x86/cpu, x86/pti: Do not enable PTI on AMD processors
Date: Wed, 3 Jan 2018 08:21:47 -0800	[thread overview]
Message-ID: <tip-694d99d40972f12e59a3696effee8a376b79d7c8@git.kernel.org> (raw)
In-Reply-To: <20171227054354.20369.94587.stgit@tlendack-t1.amdoffice.net>

Commit-ID:  694d99d40972f12e59a3696effee8a376b79d7c8
Gitweb:     https://git.kernel.org/tip/694d99d40972f12e59a3696effee8a376b79d7c8
Author:     Tom Lendacky <thomas.lendacky@amd.com>
AuthorDate: Tue, 26 Dec 2017 23:43:54 -0600
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 3 Jan 2018 15:57:59 +0100

x86/cpu, x86/pti: Do not enable PTI on AMD processors

AMD processors are not subject to the types of attacks that the kernel
page table isolation feature protects against.  The AMD microarchitecture
does not allow memory references, including speculative references, that
access higher privileged data when running in a lesser privileged mode
when that access would result in a page fault.

Disable page table isolation by default on AMD processors by not setting
the X86_BUG_CPU_INSECURE feature, which controls whether X86_FEATURE_PTI
is set.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Borislav Petkov <bp@suse.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20171227054354.20369.94587.stgit@tlendack-t1.amdoffice.net

---
 arch/x86/kernel/cpu/common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index f2a94df..b1be494 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -899,8 +899,8 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 
 	setup_force_cpu_cap(X86_FEATURE_ALWAYS);
 
-	/* Assume for now that ALL x86 CPUs are insecure */
-	setup_force_cpu_bug(X86_BUG_CPU_INSECURE);
+	if (c->x86_vendor != X86_VENDOR_AMD)
+		setup_force_cpu_bug(X86_BUG_CPU_INSECURE);
 
 	fpu__init_system(c);
 

  parent reply	other threads:[~2018-01-03 16:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-27  5:43 [PATCH] x86/cpu, x86/pti: Do not enable PTI on AMD processors Tom Lendacky
2017-12-27  8:48 ` Dave Hansen
2017-12-27 14:47   ` Tom Lendacky
2017-12-28  0:20 ` Borislav Petkov
2018-01-03 16:21 ` tip-bot for Tom Lendacky [this message]
2018-02-12 15:26 ` Pavel Machek
2018-02-12 15:37   ` Brian Gerst
2018-02-13 13:21   ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-694d99d40972f12e59a3696effee8a376b79d7c8@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bp@suse.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.