diff options
Diffstat (limited to 'arch/x86/kernel/cpu/amd.c')
| -rw-r--r-- | arch/x86/kernel/cpu/amd.c | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 25423a5b80e..7e4a459daa6 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <asm/io.h> | 5 | #include <asm/io.h> |
| 6 | #include <asm/processor.h> | 6 | #include <asm/processor.h> |
| 7 | #include <asm/apic.h> | 7 | #include <asm/apic.h> |
| 8 | #include <asm/cpu.h> | ||
| 8 | 9 | ||
| 9 | #ifdef CONFIG_X86_64 | 10 | #ifdef CONFIG_X86_64 |
| 10 | # include <asm/numa_64.h> | 11 | # include <asm/numa_64.h> |
| @@ -141,6 +142,55 @@ static void __cpuinit init_amd_k6(struct cpuinfo_x86 *c) | |||
| 141 | } | 142 | } |
| 142 | } | 143 | } |
| 143 | 144 | ||
| 145 | static void __cpuinit amd_k7_smp_check(struct cpuinfo_x86 *c) | ||
| 146 | { | ||
| 147 | #ifdef CONFIG_SMP | ||
| 148 | /* calling is from identify_secondary_cpu() ? */ | ||
| 149 | if (c->cpu_index == boot_cpu_id) | ||
| 150 | return; | ||
| 151 | |||
| 152 | /* | ||
| 153 | * Certain Athlons might work (for various values of 'work') in SMP | ||
| 154 | * but they are not certified as MP capable. | ||
| 155 | */ | ||
| 156 | /* Athlon 660/661 is valid. */ | ||
| 157 | if ((c->x86_model == 6) && ((c->x86_mask == 0) || | ||
| 158 | (c->x86_mask == 1))) | ||
| 159 | goto valid_k7; | ||
| 160 | |||
| 161 | /* Duron 670 is valid */ | ||
| 162 | if ((c->x86_model == 7) && (c->x86_mask == 0)) | ||
| 163 | goto valid_k7; | ||
| 164 | |||
| 165 | /* | ||
| 166 | * Athlon 662, Duron 671, and Athlon >model 7 have capability | ||
| 167 | * bit. It's worth noting that the A5 stepping (662) of some | ||
| 168 | * Athlon XP's have the MP bit set. | ||
| 169 | * See http://www.heise.de/newsticker/data/jow-18.10.01-000 for | ||
| 170 | * more. | ||
| 171 | */ | ||
| 172 | if (((c->x86_model == 6) && (c->x86_mask >= 2)) || | ||
| 173 | ((c->x86_model == 7) && (c->x86_mask >= 1)) || | ||
| 174 | (c->x86_model > 7)) | ||
| 175 | if (cpu_has_mp) | ||
| 176 | goto valid_k7; | ||
| 177 | |||
| 178 | /* If we get here, not a certified SMP capable AMD system. */ | ||
| 179 | |||
| 180 | /* | ||
| 181 | * Don't taint if we are running SMP kernel on a single non-MP | ||
| 182 | * approved Athlon | ||
| 183 | */ | ||
| 184 | WARN_ONCE(1, "WARNING: This combination of AMD" | ||
| 185 | "processors is not suitable for SMP.\n"); | ||
| 186 | if (!test_taint(TAINT_UNSAFE_SMP)) | ||
| 187 | add_taint(TAINT_UNSAFE_SMP); | ||
| 188 | |||
| 189 | valid_k7: | ||
| 190 | ; | ||
| 191 | #endif | ||
| 192 | } | ||
| 193 | |||
| 144 | static void __cpuinit init_amd_k7(struct cpuinfo_x86 *c) | 194 | static void __cpuinit init_amd_k7(struct cpuinfo_x86 *c) |
| 145 | { | 195 | { |
| 146 | u32 l, h; | 196 | u32 l, h; |
| @@ -175,6 +225,8 @@ static void __cpuinit init_amd_k7(struct cpuinfo_x86 *c) | |||
| 175 | } | 225 | } |
| 176 | 226 | ||
| 177 | set_cpu_cap(c, X86_FEATURE_K7); | 227 | set_cpu_cap(c, X86_FEATURE_K7); |
| 228 | |||
| 229 | amd_k7_smp_check(c); | ||
| 178 | } | 230 | } |
| 179 | #endif | 231 | #endif |
| 180 | 232 | ||
| @@ -450,7 +502,7 @@ static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 *c, unsigned int | |||
| 450 | } | 502 | } |
| 451 | #endif | 503 | #endif |
| 452 | 504 | ||
| 453 | static struct cpu_dev amd_cpu_dev __cpuinitdata = { | 505 | static const struct cpu_dev __cpuinitconst amd_cpu_dev = { |
| 454 | .c_vendor = "AMD", | 506 | .c_vendor = "AMD", |
| 455 | .c_ident = { "AuthenticAMD" }, | 507 | .c_ident = { "AuthenticAMD" }, |
| 456 | #ifdef CONFIG_X86_32 | 508 | #ifdef CONFIG_X86_32 |
