4 #include <asm/fpu/internal.h>
7 * Boot time CPU/FPU FDIV bug detection code:
10 static double __initdata x = 4195835.0;
11 static double __initdata y = 3145727.0;
14 * This used to check for exceptions..
15 * However, it turns out that to support that,
16 * the XMM trap handlers basically had to
17 * be buggy. So let's have a correct XMM trap
18 * handler, and forget about printing out
19 * some status at boot.
21 * We should really only care about bugs here
22 * anyway. Not features.
24 void __init fpu__init_check_bugs(void)
28 /* kernel_fpu_begin/end() relies on patched alternative instructions. */
29 if (!boot_cpu_has(X86_FEATURE_FPU))
35 * trap_init() enabled FXSR and company _before_ testing for FP
38 * Test for the divl bug: http://en.wikipedia.org/wiki/Fdiv_bug
45 "fsubp %%st,%%st(1)\n\t"
50 : "m" (*&x), "m" (*&y));
55 set_cpu_bug(&boot_cpu_data, X86_BUG_FDIV);
56 pr_warn("Hmm, FPU with FDIV bug\n");