|
@@ -20,6 +20,10 @@
|
|
|
|
|
|
#include "cpu.h"
|
|
|
|
|
|
+static const int amd_erratum_383[];
|
|
|
+static const int amd_erratum_400[];
|
|
|
+static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum);
|
|
|
+
|
|
|
/*
|
|
|
* nodes_per_socket: Stores the number of nodes per socket.
|
|
|
* Refer to Fam15h Models 00-0fh BKDG - CPUID Fn8000_001E_ECX
|
|
@@ -589,11 +593,16 @@ static void early_init_amd(struct cpuinfo_x86 *c)
|
|
|
/* F16h erratum 793, CVE-2013-6885 */
|
|
|
if (c->x86 == 0x16 && c->x86_model <= 0xf)
|
|
|
msr_set_bit(MSR_AMD64_LS_CFG, 15);
|
|
|
-}
|
|
|
|
|
|
-static const int amd_erratum_383[];
|
|
|
-static const int amd_erratum_400[];
|
|
|
-static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum);
|
|
|
+ /*
|
|
|
+ * Check whether the machine is affected by erratum 400. This is
|
|
|
+ * used to select the proper idle routine and to enable the check
|
|
|
+ * whether the machine is affected in arch_post_acpi_init(), which
|
|
|
+ * sets the X86_BUG_AMD_APIC_C1E bug depending on the MSR check.
|
|
|
+ */
|
|
|
+ if (cpu_has_amd_erratum(c, amd_erratum_400))
|
|
|
+ set_cpu_bug(c, X86_BUG_AMD_E400);
|
|
|
+}
|
|
|
|
|
|
static void init_amd_k8(struct cpuinfo_x86 *c)
|
|
|
{
|
|
@@ -774,9 +783,6 @@ static void init_amd(struct cpuinfo_x86 *c)
|
|
|
if (c->x86 > 0x11)
|
|
|
set_cpu_cap(c, X86_FEATURE_ARAT);
|
|
|
|
|
|
- if (cpu_has_amd_erratum(c, amd_erratum_400))
|
|
|
- set_cpu_bug(c, X86_BUG_AMD_APIC_C1E);
|
|
|
-
|
|
|
rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy);
|
|
|
|
|
|
/* 3DNow or LM implies PREFETCHW */
|