]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blame - arch/x86/kernel/cpu/bugs.c
Input: wm97xx: add new AC97 bus support
[mirror_ubuntu-focal-kernel.git] / arch / x86 / kernel / cpu / bugs.c
CommitLineData
1353ebb4 1/*
1353ebb4
JF
2 * Copyright (C) 1994 Linus Torvalds
3 *
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).
9 */
10#include <linux/init.h>
11#include <linux/utsname.h>
91eb1b79 12#include <asm/bugs.h>
1353ebb4 13#include <asm/processor.h>
7ebad705 14#include <asm/processor-flags.h>
952f07ec 15#include <asm/fpu/internal.h>
1353ebb4
JF
16#include <asm/msr.h>
17#include <asm/paravirt.h>
18#include <asm/alternative.h>
62a67e12 19#include <asm/pgtable.h>
d1163651 20#include <asm/set_memory.h>
1353ebb4 21
1353ebb4
JF
22void __init check_bugs(void)
23{
cba4671a
AL
24#ifdef CONFIG_X86_32
25 /*
26 * Regardless of whether PCID is enumerated, the SDM says
27 * that it can't be enabled in 32-bit mode.
28 */
29 setup_clear_cpu_cap(X86_FEATURE_PCID);
30#endif
31
1353ebb4 32 identify_boot_cpu();
55a36b65 33
62a67e12
BP
34 if (!IS_ENABLED(CONFIG_SMP)) {
35 pr_info("CPU: ");
36 print_cpu_info(&boot_cpu_data);
37 }
38
39#ifdef CONFIG_X86_32
55a36b65
BP
40 /*
41 * Check whether we are able to run this kernel safely on SMP.
42 *
43 * - i386 is no longer supported.
44 * - In order to run on anything without a TSC, we need to be
45 * compiled for a i486.
46 */
47 if (boot_cpu_data.x86 < 4)
48 panic("Kernel requires i486+ for 'invlpg' and other features");
49
bfe4bb15
MV
50 init_utsname()->machine[1] =
51 '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86);
1353ebb4 52 alternative_instructions();
304bceda 53
4d164092 54 fpu__init_check_bugs();
62a67e12
BP
55#else /* CONFIG_X86_64 */
56 alternative_instructions();
57
58 /*
59 * Make sure the first 2MB area is not mapped by huge pages
60 * There are typically fixed size MTRRs in there and overlapping
61 * MTRRs into large pages causes slow downs.
62 *
63 * Right now we don't do that with gbpages because there seems
64 * very little benefit for that case.
65 */
66 if (!direct_gbpages)
67 set_memory_4k((unsigned long)__va(0), 1);
68#endif
1353ebb4 69}