2 * Copyright (C) 1994 Linus Torvalds
4 * Cyrix stuff, June 1998 by:
5 * - Rafael R. Reilova (moved everything from head.S),
6 * <rreilova@ececs.uc.edu>
7 * - Channing Corn (tests & fixes),
8 * - Andrew D. Balsa (code cleanup).
10 #include <linux/init.h>
11 #include <linux/utsname.h>
13 #include <asm/processor.h>
14 #include <asm/processor-flags.h>
17 #include <asm/paravirt.h>
18 #include <asm/alternative.h>
20 static double __initdata x
= 4195835.0;
21 static double __initdata y
= 3145727.0;
24 * This used to check for exceptions..
25 * However, it turns out that to support that,
26 * the XMM trap handlers basically had to
27 * be buggy. So let's have a correct XMM trap
28 * handler, and forget about printing out
29 * some status at boot.
31 * We should really only care about bugs here
32 * anyway. Not features.
34 static void __init
check_fpu(void)
41 * trap_init() enabled FXSR and company _before_ testing for FP
44 * Test for the divl bug: http://en.wikipedia.org/wiki/Fdiv_bug
51 "fsubp %%st,%%st(1)\n\t"
56 : "m" (*&x
), "m" (*&y
));
61 set_cpu_bug(&boot_cpu_data
, X86_BUG_FDIV
);
62 pr_warn("Hmm, FPU with FDIV bug\n");
66 void __init
check_bugs(void)
71 print_cpu_info(&boot_cpu_data
);
75 * Check whether we are able to run this kernel safely on SMP.
77 * - i386 is no longer supported.
78 * - In order to run on anything without a TSC, we need to be
79 * compiled for a i486.
81 if (boot_cpu_data
.x86
< 4)
82 panic("Kernel requires i486+ for 'invlpg' and other features");
84 init_utsname()->machine
[1] =
85 '0' + (boot_cpu_data
.x86
> 6 ? 6 : boot_cpu_data
.x86
);
86 alternative_instructions();
89 * kernel_fpu_begin/end() in check_fpu() relies on the patched
90 * alternative instructions.