1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 1994 Linus Torvalds
5 * Cyrix stuff, June 1998 by:
6 * - Rafael R. Reilova (moved everything from head.S),
7 * <rreilova@ececs.uc.edu>
8 * - Channing Corn (tests & fixes),
9 * - Andrew D. Balsa (code cleanup).
11 #include <linux/init.h>
12 #include <linux/utsname.h>
14 #include <asm/processor.h>
15 #include <asm/processor-flags.h>
16 #include <asm/fpu/internal.h>
18 #include <asm/paravirt.h>
19 #include <asm/alternative.h>
20 #include <asm/pgtable.h>
21 #include <asm/set_memory.h>
23 void __init check_bugs(void)
27 if (!IS_ENABLED(CONFIG_SMP)) {
29 print_cpu_info(&boot_cpu_data);
34 * Check whether we are able to run this kernel safely on SMP.
36 * - i386 is no longer supported.
37 * - In order to run on anything without a TSC, we need to be
38 * compiled for a i486.
40 if (boot_cpu_data.x86 < 4)
41 panic("Kernel requires i486+ for 'invlpg' and other features");
43 init_utsname()->machine[1] =
44 '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86);
45 alternative_instructions();
47 fpu__init_check_bugs();
48 #else /* CONFIG_X86_64 */
49 alternative_instructions();
52 * Make sure the first 2MB area is not mapped by huge pages
53 * There are typically fixed size MTRRs in there and overlapping
54 * MTRRs into large pages causes slow downs.
56 * Right now we don't do that with gbpages because there seems
57 * very little benefit for that case.
60 set_memory_4k((unsigned long)__va(0), 1);