diff options
-rw-r--r-- | arch/i386/kernel/cpu/amd.c | 16 | ||||
-rw-r--r-- | arch/x86_64/kernel/setup.c | 22 | ||||
-rw-r--r-- | include/asm-x86_64/msr.h | 1 |
3 files changed, 29 insertions, 10 deletions
diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c index 73aeaf5a9d4e..4c1ddf2b57cc 100644 --- a/arch/i386/kernel/cpu/amd.c +++ b/arch/i386/kernel/cpu/amd.c | |||
@@ -28,6 +28,22 @@ static void __init init_amd(struct cpuinfo_x86 *c) | |||
28 | int mbytes = num_physpages >> (20-PAGE_SHIFT); | 28 | int mbytes = num_physpages >> (20-PAGE_SHIFT); |
29 | int r; | 29 | int r; |
30 | 30 | ||
31 | #ifdef CONFIG_SMP | ||
32 | unsigned long value; | ||
33 | |||
34 | /* Disable TLB flush filter by setting HWCR.FFDIS on K8 | ||
35 | * bit 6 of msr C001_0015 | ||
36 | * | ||
37 | * Errata 63 for SH-B3 steppings | ||
38 | * Errata 122 for all steppings (F+ have it disabled by default) | ||
39 | */ | ||
40 | if (c->x86 == 15) { | ||
41 | rdmsrl(MSR_K7_HWCR, value); | ||
42 | value |= 1 << 6; | ||
43 | wrmsrl(MSR_K7_HWCR, value); | ||
44 | } | ||
45 | #endif | ||
46 | |||
31 | /* | 47 | /* |
32 | * FIXME: We should handle the K5 here. Set up the write | 48 | * FIXME: We should handle the K5 here. Set up the write |
33 | * range and also turn on MSR 83 bits 4 and 31 (write alloc, | 49 | * range and also turn on MSR 83 bits 4 and 31 (write alloc, |
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index 238f73e1a834..257f5ba17902 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c | |||
@@ -831,8 +831,6 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c) | |||
831 | #endif | 831 | #endif |
832 | } | 832 | } |
833 | 833 | ||
834 | #define HWCR 0xc0010015 | ||
835 | |||
836 | static int __init init_amd(struct cpuinfo_x86 *c) | 834 | static int __init init_amd(struct cpuinfo_x86 *c) |
837 | { | 835 | { |
838 | int r; | 836 | int r; |
@@ -841,14 +839,18 @@ static int __init init_amd(struct cpuinfo_x86 *c) | |||
841 | #ifdef CONFIG_SMP | 839 | #ifdef CONFIG_SMP |
842 | unsigned long value; | 840 | unsigned long value; |
843 | 841 | ||
844 | // Disable TLB flush filter by setting HWCR.FFDIS: | 842 | /* |
845 | // bit 6 of msr C001_0015 | 843 | * Disable TLB flush filter by setting HWCR.FFDIS on K8 |
846 | // | 844 | * bit 6 of msr C001_0015 |
847 | // Errata 63 for SH-B3 steppings | 845 | * |
848 | // Errata 122 for all(?) steppings | 846 | * Errata 63 for SH-B3 steppings |
849 | rdmsrl(HWCR, value); | 847 | * Errata 122 for all steppings (F+ have it disabled by default) |
850 | value |= 1 << 6; | 848 | */ |
851 | wrmsrl(HWCR, value); | 849 | if (c->x86 == 15) { |
850 | rdmsrl(MSR_K8_HWCR, value); | ||
851 | value |= 1 << 6; | ||
852 | wrmsrl(MSR_K8_HWCR, value); | ||
853 | } | ||
852 | #endif | 854 | #endif |
853 | 855 | ||
854 | /* Bit 31 in normal CPUID used for nonstandard 3DNow ID; | 856 | /* Bit 31 in normal CPUID used for nonstandard 3DNow ID; |
diff --git a/include/asm-x86_64/msr.h b/include/asm-x86_64/msr.h index 4d727f3f5550..5a7fe3c6c3d8 100644 --- a/include/asm-x86_64/msr.h +++ b/include/asm-x86_64/msr.h | |||
@@ -234,6 +234,7 @@ static inline unsigned int cpuid_edx(unsigned int op) | |||
234 | #define MSR_K8_TOP_MEM1 0xC001001A | 234 | #define MSR_K8_TOP_MEM1 0xC001001A |
235 | #define MSR_K8_TOP_MEM2 0xC001001D | 235 | #define MSR_K8_TOP_MEM2 0xC001001D |
236 | #define MSR_K8_SYSCFG 0xC0010010 | 236 | #define MSR_K8_SYSCFG 0xC0010010 |
237 | #define MSR_K8_HWCR 0xC0010015 | ||
237 | 238 | ||
238 | /* K6 MSRs */ | 239 | /* K6 MSRs */ |
239 | #define MSR_K6_EFER 0xC0000080 | 240 | #define MSR_K6_EFER 0xC0000080 |