From: Andy Lutomirski <luto@kernel.org>
To: Borislav Petkov <bp@alien8.de>,
security@kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Rudolf Marek <r.marek@assembler.cz>,
Andy Lutomirski <luto@kernel.org>
Subject: [PATCH v3 5/7] x86/cpu: Move X86_BUG_ESPFIX initialization to generic_identify
Date: Thu, 7 Apr 2016 17:31:48 -0700 [thread overview]
Message-ID: <0949337f13660461edca08ab67d1a841441289c9.1460075211.git.luto@kernel.org> (raw)
In-Reply-To: <cover.1460075211.git.luto@kernel.org>
In-Reply-To: <cover.1460075211.git.luto@kernel.org>
It was in detect_nopl, which was either a mistake by me or some kind
of mis-merge.
Fixes: ff236456f072 ("x86/cpu: Move X86_BUG_ESPFIX initialization to generic_identify")
Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
arch/x86/kernel/cpu/common.c | 50 ++++++++++++++++++++++----------------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index ceef584ae8b0..9ede8aa41f18 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -862,31 +862,6 @@ static void detect_nopl(struct cpuinfo_x86 *c)
#else
set_cpu_cap(c, X86_FEATURE_NOPL);
#endif
-
- /*
- * ESPFIX is a strange bug. All real CPUs have it. Paravirt
- * systems that run Linux at CPL > 0 may or may not have the
- * issue, but, even if they have the issue, there's absolutely
- * nothing we can do about it because we can't use the real IRET
- * instruction.
- *
- * NB: For the time being, only 32-bit kernels support
- * X86_BUG_ESPFIX as such. 64-bit kernels directly choose
- * whether to apply espfix using paravirt hooks. If any
- * non-paravirt system ever shows up that does *not* have the
- * ESPFIX issue, we can change this.
- */
-#ifdef CONFIG_X86_32
-#ifdef CONFIG_PARAVIRT
- do {
- extern void native_iret(void);
- if (pv_cpu_ops.iret == native_iret)
- set_cpu_bug(c, X86_BUG_ESPFIX);
- } while (0);
-#else
- set_cpu_bug(c, X86_BUG_ESPFIX);
-#endif
-#endif
}
static void detect_null_seg_behavior(struct cpuinfo_x86 *c)
@@ -952,6 +927,31 @@ static void generic_identify(struct cpuinfo_x86 *c)
detect_nopl(c);
detect_null_seg_behavior(c);
+
+ /*
+ * ESPFIX is a strange bug. All real CPUs have it. Paravirt
+ * systems that run Linux at CPL > 0 may or may not have the
+ * issue, but, even if they have the issue, there's absolutely
+ * nothing we can do about it because we can't use the real IRET
+ * instruction.
+ *
+ * NB: For the time being, only 32-bit kernels support
+ * X86_BUG_ESPFIX as such. 64-bit kernels directly choose
+ * whether to apply espfix using paravirt hooks. If any
+ * non-paravirt system ever shows up that does *not* have the
+ * ESPFIX issue, we can change this.
+ */
+#ifdef CONFIG_X86_32
+#ifdef CONFIG_PARAVIRT
+ do {
+ extern void native_iret(void);
+ if (pv_cpu_ops.iret == native_iret)
+ set_cpu_bug(c, X86_BUG_ESPFIX);
+ } while (0);
+#else
+ set_cpu_bug(c, X86_BUG_ESPFIX);
+#endif
+#endif
}
static void x86_init_cache_qos(struct cpuinfo_x86 *c)
--
2.5.5
next prev parent reply other threads:[~2016-04-08 0:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-08 0:31 [PATCH v3 0/7] x86: Pile o' FS/GS changes Andy Lutomirski
2016-04-08 0:31 ` [PATCH v3 1/7] selftests/x86: Test the FSBASE/GSBASE API and context switching Andy Lutomirski
2016-04-13 11:28 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2016-04-08 0:31 ` Andy Lutomirski [this message]
2016-04-13 11:30 ` [tip:x86/asm] x86/cpu: Move X86_BUG_ESPFIX initialization to generic_identify() tip-bot for Andy Lutomirski
2016-04-08 0:31 ` [PATCH v3 7/7] x86/entry: Make gs_change a local label Andy Lutomirski
2016-04-13 11:31 ` [tip:x86/asm] x86/entry/64: " tip-bot for Borislav Petkov
2016-04-08 10:39 ` [PATCH v3 0/7] x86: Pile o' FS/GS changes Borislav Petkov
2016-04-08 10:40 ` Borislav Petkov
[not found] ` <c6e7b507c72ca3bdbf6c7a8a3ceaa0334e873bd9.1460075211.git.luto@kernel.org>
2016-04-08 7:13 ` [PATCH v3 2/7] x86/arch_prctl: Fix ARCH_GET_FS and ARCH_GET_GS Ingo Molnar
2016-04-08 9:39 ` Dmitry Safonov
2016-04-08 16:03 ` Andy Lutomirski
2016-04-13 11:29 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
[not found] ` <aec6b2df1bfc56101d4e9e2e5d5d570bf41663c6.1460075211.git.luto@kernel.org>
2016-04-08 1:40 ` [PATCH v3 6/7] x86/cpu: Add Erratum 88 detection on AMD Andy Lutomirski
2016-04-08 9:51 ` Borislav Petkov
2016-04-13 11:30 ` [tip:x86/asm] " tip-bot for Borislav Petkov
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=0949337f13660461edca08ab67d1a841441289c9.1460075211.git.luto@kernel.org \
--to=luto@kernel.org \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=r.marek@assembler.cz \
--cc=security@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®