From: tip-bot for Borislav Petkov <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
tglx@linutronix.de, bp@suse.de
Subject: [tip:x86/cpu] x86, cpu: Convert F00F bug detection
Date: Tue, 2 Apr 2013 12:33:39 -0700 [thread overview]
Message-ID: <tip-e2604b49e8a8827e8bc5b61bc0c5a889e028fdad@git.kernel.org> (raw)
In-Reply-To: <1363788448-31325-3-git-send-email-bp@alien8.de>
Commit-ID: e2604b49e8a8827e8bc5b61bc0c5a889e028fdad
Gitweb: http://git.kernel.org/tip/e2604b49e8a8827e8bc5b61bc0c5a889e028fdad
Author: Borislav Petkov <bp@suse.de>
AuthorDate: Wed, 20 Mar 2013 15:07:24 +0100
Committer: H. Peter Anvin <hpa@zytor.com>
CommitDate: Tue, 2 Apr 2013 10:12:52 -0700
x86, cpu: Convert F00F bug detection
... to using the new facility and drop the cpuinfo_x86 member.
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: http://lkml.kernel.org/r/1363788448-31325-3-git-send-email-bp@alien8.de
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
arch/x86/include/asm/cpufeature.h | 2 ++
arch/x86/include/asm/processor.h | 1 -
arch/x86/kernel/cpu/intel.c | 4 ++--
arch/x86/kernel/cpu/proc.c | 2 +-
arch/x86/mm/fault.c | 2 +-
5 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 16190ab..c0ad7e7 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -222,6 +222,8 @@
*/
#define X86_BUG(x) (NCAPINTS*32 + (x))
+#define X86_BUG_F00F X86_BUG(0) /* Intel F00F */
+
#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
#include <asm/asm.h>
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 23c8081..1e55e2d 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -92,7 +92,6 @@ struct cpuinfo_x86 {
char hard_math;
char rfu;
char fdiv_bug;
- char f00f_bug;
char coma_bug;
char pad0;
#else
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 1905ce9..1acdd42 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -209,11 +209,11 @@ static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c)
* system.
* Note that the workaround only should be initialized once...
*/
- c->f00f_bug = 0;
+ clear_cpu_bug(c, X86_BUG_F00F);
if (!paravirt_enabled() && c->x86 == 5) {
static int f00f_workaround_enabled;
- c->f00f_bug = 1;
+ set_cpu_bug(c, X86_BUG_F00F);
if (!f00f_workaround_enabled) {
trap_init_f00f_bug();
printk(KERN_NOTICE "Intel Pentium with F0 0F bug - workaround enabled.\n");
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index e280253..2d60b2b 100644
--- a/arch/x86/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
@@ -35,7 +35,7 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
"cpuid level\t: %d\n"
"wp\t\t: %s\n",
c->fdiv_bug ? "yes" : "no",
- c->f00f_bug ? "yes" : "no",
+ static_cpu_has_bug(X86_BUG_F00F) ? "yes" : "no",
c->coma_bug ? "yes" : "no",
c->hard_math ? "yes" : "no",
c->hard_math ? "yes" : "no",
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 2b97525..a1ce1fa 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -555,7 +555,7 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address)
/*
* Pentium F0 0F C7 C8 bug workaround:
*/
- if (boot_cpu_data.f00f_bug) {
+ if (boot_cpu_has_bug(X86_BUG_F00F)) {
nr = (address - idt_descr.address) >> 3;
if (nr == 6) {
next prev parent reply other threads:[~2013-04-02 19:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-20 14:07 [PATCH 0/6] x86, cpu: Expand ->x86_capability flags with bugs bitvector, v2 Borislav Petkov
2013-03-20 14:07 ` [PATCH 1/6] x86, cpu: Expand cpufeature facility to include cpu bugs Borislav Petkov
2013-04-02 19:32 ` [tip:x86/cpu] " tip-bot for Borislav Petkov
2013-03-20 14:07 ` [PATCH 2/6] x86, cpu: Convert F00F bug detection Borislav Petkov
2013-04-02 19:33 ` tip-bot for Borislav Petkov [this message]
2013-03-20 14:07 ` [PATCH 3/6] x86, cpu: Convert FDIV " Borislav Petkov
2013-04-02 19:34 ` [tip:x86/cpu] " tip-bot for Borislav Petkov
2013-03-20 14:07 ` [PATCH 4/6] x86, cpu: Convert Cyrix coma " Borislav Petkov
2013-04-02 19:36 ` [tip:x86/cpu] " tip-bot for Borislav Petkov
2013-03-20 14:07 ` [PATCH 5/6] x86, cpu: Convert AMD Erratum 383 Borislav Petkov
2013-04-02 19:37 ` [tip:x86/cpu] " tip-bot for Borislav Petkov
2013-03-20 14:07 ` [PATCH 6/6] x86, cpu: Convert AMD Erratum 400 Borislav Petkov
2013-04-02 19:38 ` [tip:x86/cpu] " 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=tip-e2604b49e8a8827e8bc5b61bc0c5a889e028fdad@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@suse.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).