diff options
author | Andi Kleen <ak@suse.de> | 2008-01-30 07:32:40 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:40 -0500 |
commit | 2b16a2353814a513cdb5c5c739b76a19d7ea39ce (patch) | |
tree | caee8a54a0e85b4839078286114f4c9f920ac89e /arch/x86/kernel/cpu/amd.c | |
parent | 68071a96655c883b316da9ef497f6dec8953529f (diff) |
x86: move X86_FEATURE_CONSTANT_TSC into early cpu feature detection
Need this in the next patch in time_init and that happens early.
This includes a minor fix on i386 where early_intel_workarounds()
[which is now called early_init_intel] really executes early as
the comments say.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/cpu/amd.c')
-rw-r--r-- | arch/x86/kernel/cpu/amd.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index aaa8101d3d80..cd2fe15ff4b5 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
@@ -63,6 +63,15 @@ static __cpuinit int amd_apic_timer_broken(void) | |||
63 | 63 | ||
64 | int force_mwait __cpuinitdata; | 64 | int force_mwait __cpuinitdata; |
65 | 65 | ||
66 | void __cpuinit early_init_amd(struct cpuinfo_x86 *c) | ||
67 | { | ||
68 | if (cpuid_eax(0x80000000) >= 0x80000007) { | ||
69 | c->x86_power = cpuid_edx(0x80000007); | ||
70 | if (c->x86_power & (1<<8)) | ||
71 | set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability); | ||
72 | } | ||
73 | } | ||
74 | |||
66 | static void __cpuinit init_amd(struct cpuinfo_x86 *c) | 75 | static void __cpuinit init_amd(struct cpuinfo_x86 *c) |
67 | { | 76 | { |
68 | u32 l, h; | 77 | u32 l, h; |
@@ -85,6 +94,8 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) | |||
85 | } | 94 | } |
86 | #endif | 95 | #endif |
87 | 96 | ||
97 | early_init_amd(c); | ||
98 | |||
88 | /* | 99 | /* |
89 | * FIXME: We should handle the K5 here. Set up the write | 100 | * FIXME: We should handle the K5 here. Set up the write |
90 | * range and also turn on MSR 83 bits 4 and 31 (write alloc, | 101 | * range and also turn on MSR 83 bits 4 and 31 (write alloc, |
@@ -257,12 +268,6 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) | |||
257 | c->x86_max_cores = (cpuid_ecx(0x80000008) & 0xff) + 1; | 268 | c->x86_max_cores = (cpuid_ecx(0x80000008) & 0xff) + 1; |
258 | } | 269 | } |
259 | 270 | ||
260 | if (cpuid_eax(0x80000000) >= 0x80000007) { | ||
261 | c->x86_power = cpuid_edx(0x80000007); | ||
262 | if (c->x86_power & (1<<8)) | ||
263 | set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability); | ||
264 | } | ||
265 | |||
266 | #ifdef CONFIG_X86_HT | 271 | #ifdef CONFIG_X86_HT |
267 | /* | 272 | /* |
268 | * On a AMD multi core setup the lower bits of the APIC id | 273 | * On a AMD multi core setup the lower bits of the APIC id |