All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: fdiv bug detection fix
@ 2008-07-31 21:43 Krzysztof Helt
  2008-07-31 21:49 ` Andrew Morton
  2008-07-31 21:57 ` Ingo Molnar
  0 siblings, 2 replies; 5+ messages in thread
From: Krzysztof Helt @ 2008-07-31 21:43 UTC (permalink / raw)
  To: hpa; +Cc: LKML, Andrew Morton

From: Krzysztof Helt <krzysztof.h1@wp.pl>

The fdiv detection code writes s32 integer into
the boot_cpu_data.fdiv_bug. 
However, the boot_cpu_data.fdiv_bug is only char (s8)
field so the detection overwrites already set fields for
other bugs, e.g. the f00f bug field.

Use local s32 variable to receive result.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
---

This is a partial fix to Bugzilla #9928  - fixes wrong 
information about the f00f bug (tested) and probably
for coma bug (I have no cpu to test this).

diff -urp linux-alsa/arch/x86/kernel/cpu/bugs.c linux-new/arch/x86/kernel/cpu/bugs.c
--- linux-alsa/arch/x86/kernel/cpu/bugs.c	2008-07-31 12:40:31.000000000 +0200
+++ linux-new/arch/x86/kernel/cpu/bugs.c	2008-07-31 23:24:07.722657435 +0200
@@ -50,6 +50,8 @@ static double __initdata y = 3145727.0;
  */
 static void __init check_fpu(void)
 {
+	s32 fdiv_bug;
+
 	if (!boot_cpu_data.hard_math) {
 #ifndef CONFIG_MATH_EMULATION
 		printk(KERN_EMERG "No coprocessor found and no math emulation present.\n");
@@ -74,8 +76,10 @@ static void __init check_fpu(void)
 		"fistpl %0\n\t"
 		"fwait\n\t"
 		"fninit"
-		: "=m" (*&boot_cpu_data.fdiv_bug)
+		: "=m" (*&fdiv_bug)
 		: "m" (*&x), "m" (*&y));
+
+	boot_cpu_data.fdiv_bug = fdiv_bug;
 	if (boot_cpu_data.fdiv_bug)
 		printk("Hmm, FPU with FDIV bug.\n");
 }

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-07-31 22:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-31 21:43 [PATCH] x86: fdiv bug detection fix Krzysztof Helt
2008-07-31 21:49 ` Andrew Morton
2008-07-31 22:04   ` Jeremy Fitzhardinge
2008-07-31 22:11   ` Willy Tarreau
2008-07-31 21:57 ` Ingo Molnar

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.