@@ -59,10 +59,6 @@ static u32 nodes_per_socket = 1;
59
59
#define AMD_MODEL_RANGE_START (range ) (((range) >> 12) & 0xfff)
60
60
#define AMD_MODEL_RANGE_END (range ) ((range) & 0xfff)
61
61
62
- static const int amd_erratum_400 [] =
63
- AMD_OSVW_ERRATUM (1 , AMD_MODEL_RANGE (0xf , 0x41 , 0x2 , 0xff , 0xf ),
64
- AMD_MODEL_RANGE (0x10 , 0x2 , 0x1 , 0xff , 0xf ));
65
-
66
62
static const int amd_erratum_1485 [] =
67
63
AMD_LEGACY_ERRATUM (AMD_MODEL_RANGE (0x19 , 0x10 , 0x0 , 0x1f , 0xf ),
68
64
AMD_MODEL_RANGE (0x19 , 0x60 , 0x0 , 0xaf , 0xf ));
@@ -765,15 +761,6 @@ static void early_init_amd(struct cpuinfo_x86 *c)
765
761
if (c -> x86 == 0x16 && c -> x86_model <= 0xf )
766
762
msr_set_bit (MSR_AMD64_LS_CFG , 15 );
767
763
768
- /*
769
- * Check whether the machine is affected by erratum 400. This is
770
- * used to select the proper idle routine and to enable the check
771
- * whether the machine is affected in arch_post_acpi_init(), which
772
- * sets the X86_BUG_AMD_APIC_C1E bug depending on the MSR check.
773
- */
774
- if (cpu_has_amd_erratum (c , amd_erratum_400 ))
775
- set_cpu_bug (c , X86_BUG_AMD_E400 );
776
-
777
764
early_detect_mem_encrypt (c );
778
765
779
766
/* Re-enable TopologyExtensions if switched off by BIOS */
@@ -840,6 +827,16 @@ static void init_amd_k8(struct cpuinfo_x86 *c)
840
827
msr_set_bit (MSR_K7_HWCR , 6 );
841
828
#endif
842
829
set_cpu_bug (c , X86_BUG_SWAPGS_FENCE );
830
+
831
+ /*
832
+ * Check models and steppings affected by erratum 400. This is
833
+ * used to select the proper idle routine and to enable the
834
+ * check whether the machine is affected in arch_post_acpi_subsys_init()
835
+ * which sets the X86_BUG_AMD_APIC_C1E bug depending on the MSR check.
836
+ */
837
+ if (c -> x86_model > 0x41 ||
838
+ (c -> x86_model == 0x41 && c -> x86_stepping >= 0x2 ))
839
+ setup_force_cpu_bug (X86_BUG_AMD_E400 );
843
840
}
844
841
845
842
static void init_amd_gh (struct cpuinfo_x86 * c )
@@ -874,6 +871,16 @@ static void init_amd_gh(struct cpuinfo_x86 *c)
874
871
msr_clear_bit (MSR_AMD64_BU_CFG2 , 24 );
875
872
876
873
set_cpu_bug (c , X86_BUG_AMD_TLB_MMATCH );
874
+
875
+ /*
876
+ * Check models and steppings affected by erratum 400. This is
877
+ * used to select the proper idle routine and to enable the
878
+ * check whether the machine is affected in arch_post_acpi_subsys_init()
879
+ * which sets the X86_BUG_AMD_APIC_C1E bug depending on the MSR check.
880
+ */
881
+ if (c -> x86_model > 0x2 ||
882
+ (c -> x86_model == 0x2 && c -> x86_stepping >= 0x1 ))
883
+ setup_force_cpu_bug (X86_BUG_AMD_E400 );
877
884
}
878
885
879
886
static void init_amd_ln (struct cpuinfo_x86 * c )
0 commit comments