Re: [PATCH] x86: fdiv bug detection fix

From: Jeremy Fitzhardinge
Date: Thu Jul 31 2008 - 18:04:38 EST


Andrew Morton wrote:
"fwait\n\t"
"fninit"
- : "=m" (*&boot_cpu_data.fdiv_bug)
+ : "=m" (*&fdiv_bug)
: "m" (*&x), "m" (*&y));

This (*&foo) construct is strange. Just "m" (foo) should be enough.

+
+ boot_cpu_data.fdiv_bug = fdiv_bug;
if (boot_cpu_data.fdiv_bug)
printk("Hmm, FPU with FDIV bug.\n");
}

hm, the code seems to have been that way for quite some time. I wonder
why nobody noticed this before.

It would trash f00f_bug, coma_bug and some padding. You'd have to be running a Cyrix or Intel chip dating from somewhere around 1997-1998 to even be subject to those bugs, and even if you were, they wouldn't hurt day to day. And if it snoops for those bugs after the fdiv bug, then they'd get updated properly anyway.

Change looks correct.

J
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/