| #include <asm/fpu/internal.h> |
| * Boot time CPU/FPU FDIV bug detection code: |
| static double __initdata x = 4195835.0; |
| static double __initdata y = 3145727.0; |
| * This used to check for exceptions.. |
| * However, it turns out that to support that, |
| * the XMM trap handlers basically had to |
| * be buggy. So let's have a correct XMM trap |
| * handler, and forget about printing out |
| * We should really only care about bugs here |
| void __init fpu__init_check_bugs(void) |
| /* kernel_fpu_begin/end() relies on patched alternative instructions. */ |
| if (!boot_cpu_has(X86_FEATURE_FPU)) |
| /* We might have CR0::TS set already, clear it: */ |
| write_cr0(cr0_saved & ~X86_CR0_TS); |
| * trap_init() enabled FXSR and company _before_ testing for FP |
| * Test for the divl bug: http://en.wikipedia.org/wiki/Fdiv_bug |
| set_cpu_bug(&boot_cpu_data, X86_BUG_FDIV); |
| pr_warn("Hmm, FPU with FDIV bug\n"); |