|
20 | 20 |
|
21 | 21 | #include "cpu.h"
|
22 | 22 |
|
| 23 | +static const int amd_erratum_383[]; |
| 24 | +static const int amd_erratum_400[]; |
| 25 | +static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum); |
| 26 | + |
23 | 27 | /*
|
24 | 28 | * nodes_per_socket: Stores the number of nodes per socket.
|
25 | 29 | * Refer to Fam15h Models 00-0fh BKDG - CPUID Fn8000_001E_ECX
|
@@ -589,11 +593,16 @@ static void early_init_amd(struct cpuinfo_x86 *c)
|
589 | 593 | /* F16h erratum 793, CVE-2013-6885 */
|
590 | 594 | if (c->x86 == 0x16 && c->x86_model <= 0xf)
|
591 | 595 | msr_set_bit(MSR_AMD64_LS_CFG, 15);
|
592 |
| -} |
593 | 596 |
|
594 |
| -static const int amd_erratum_383[]; |
595 |
| -static const int amd_erratum_400[]; |
596 |
| -static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum); |
| 597 | + /* |
| 598 | + * Check whether the machine is affected by erratum 400. This is |
| 599 | + * used to select the proper idle routine and to enable the check |
| 600 | + * whether the machine is affected in arch_post_acpi_init(), which |
| 601 | + * sets the X86_BUG_AMD_APIC_C1E bug depending on the MSR check. |
| 602 | + */ |
| 603 | + if (cpu_has_amd_erratum(c, amd_erratum_400)) |
| 604 | + set_cpu_bug(c, X86_BUG_AMD_E400); |
| 605 | +} |
597 | 606 |
|
598 | 607 | static void init_amd_k8(struct cpuinfo_x86 *c)
|
599 | 608 | {
|
@@ -774,9 +783,6 @@ static void init_amd(struct cpuinfo_x86 *c)
|
774 | 783 | if (c->x86 > 0x11)
|
775 | 784 | set_cpu_cap(c, X86_FEATURE_ARAT);
|
776 | 785 |
|
777 |
| - if (cpu_has_amd_erratum(c, amd_erratum_400)) |
778 |
| - set_cpu_bug(c, X86_BUG_AMD_APIC_C1E); |
779 |
| - |
780 | 786 | rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy);
|
781 | 787 |
|
782 | 788 | /* 3DNow or LM implies PREFETCHW */
|
|
0 commit comments