aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/cpu/amd_64.c22
-rw-r--r--arch/x86/kernel/setup_64.c4
2 files changed, 14 insertions, 12 deletions
diff --git a/arch/x86/kernel/cpu/amd_64.c b/arch/x86/kernel/cpu/amd_64.c
index 30b7557c9641..958526d6a74a 100644
--- a/arch/x86/kernel/cpu/amd_64.c
+++ b/arch/x86/kernel/cpu/amd_64.c
@@ -131,7 +131,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
131 * Errata 63 for SH-B3 steppings 131 * Errata 63 for SH-B3 steppings
132 * Errata 122 for all steppings (F+ have it disabled by default) 132 * Errata 122 for all steppings (F+ have it disabled by default)
133 */ 133 */
134 if (c->x86 == 15) { 134 if (c->x86 == 0xf) {
135 rdmsrl(MSR_K8_HWCR, value); 135 rdmsrl(MSR_K8_HWCR, value);
136 value |= 1 << 6; 136 value |= 1 << 6;
137 wrmsrl(MSR_K8_HWCR, value); 137 wrmsrl(MSR_K8_HWCR, value);
@@ -143,10 +143,11 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
143 clear_cpu_cap(c, 0*32+31); 143 clear_cpu_cap(c, 0*32+31);
144 144
145 /* On C+ stepping K8 rep microcode works well for copy/memset */ 145 /* On C+ stepping K8 rep microcode works well for copy/memset */
146 level = cpuid_eax(1); 146 if (c->x86 == 0xf) {
147 if (c->x86 == 15 && ((level >= 0x0f48 && level < 0x0f50) || 147 level = cpuid_eax(1);
148 level >= 0x0f58)) 148 if((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58)
149 set_cpu_cap(c, X86_FEATURE_REP_GOOD); 149 set_cpu_cap(c, X86_FEATURE_REP_GOOD);
150 }
150 if (c->x86 == 0x10 || c->x86 == 0x11) 151 if (c->x86 == 0x10 || c->x86 == 0x11)
151 set_cpu_cap(c, X86_FEATURE_REP_GOOD); 152 set_cpu_cap(c, X86_FEATURE_REP_GOOD);
152 153
@@ -157,7 +158,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
157 level = get_model_name(c); 158 level = get_model_name(c);
158 if (!level) { 159 if (!level) {
159 switch (c->x86) { 160 switch (c->x86) {
160 case 15: 161 case 0xf:
161 /* Should distinguish Models here, but this is only 162 /* Should distinguish Models here, but this is only
162 a fallback anyways. */ 163 a fallback anyways. */
163 strcpy(c->x86_model_id, "Hammer"); 164 strcpy(c->x86_model_id, "Hammer");
@@ -176,14 +177,19 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
176 else 177 else
177 num_cache_leaves = 3; 178 num_cache_leaves = 3;
178 179
179 if (c->x86 == 0xf || c->x86 == 0x10 || c->x86 == 0x11) 180 if (c->x86 >= 0xf && c->x86 <= 0x11)
180 set_cpu_cap(c, X86_FEATURE_K8); 181 set_cpu_cap(c, X86_FEATURE_K8);
181 182
182 /* MFENCE stops RDTSC speculation */ 183 /* MFENCE stops RDTSC speculation */
183 set_cpu_cap(c, X86_FEATURE_MFENCE_RDTSC); 184 set_cpu_cap(c, X86_FEATURE_MFENCE_RDTSC);
184 185
185 if (c->x86 == 0x10) 186 if (c->x86 == 0x10) {
187 /* do this for boot cpu */
188 if (c == &boot_cpu_data)
189 check_enable_amd_mmconf_dmi();
190
186 fam10h_check_enable_mmcfg(); 191 fam10h_check_enable_mmcfg();
192 }
187 193
188 if (c == &boot_cpu_data && c->x86 >= 0xf && c->x86 <= 0x11) { 194 if (c == &boot_cpu_data && c->x86 >= 0xf && c->x86 <= 0x11) {
189 unsigned long long tseg; 195 unsigned long long tseg;
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 175c696ec536..c94464ab04ba 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -72,7 +72,6 @@
72#include <asm/topology.h> 72#include <asm/topology.h>
73#include <asm/trampoline.h> 73#include <asm/trampoline.h>
74#include <asm/pat.h> 74#include <asm/pat.h>
75#include <asm/mmconfig.h>
76 75
77#include <mach_apic.h> 76#include <mach_apic.h>
78#ifdef CONFIG_PARAVIRT 77#ifdef CONFIG_PARAVIRT
@@ -474,9 +473,6 @@ void __init setup_arch(char **cmdline_p)
474 conswitchp = &dummy_con; 473 conswitchp = &dummy_con;
475#endif 474#endif
476#endif 475#endif
477
478 /* do this before identify_cpu for boot cpu */
479 check_enable_amd_mmconf_dmi();
480} 476}
481 477
482struct cpu_dev *cpu_devs[X86_VENDOR_NUM] = {}; 478struct cpu_dev *cpu_devs[X86_VENDOR_NUM] = {};