diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-09-06 04:52:28 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-06 08:09:14 -0400 |
commit | e3224234717b4228c235cee401af89212f17a3a4 (patch) | |
tree | 10cc3810fa160e168fc29fb392929ab00a91bacb | |
parent | 1b05d60d60e81c6594da8298107a05b506f01797 (diff) |
x86, cpu init: call early_init_xxx in init_xxx
so we:
1. could set some cap to ap
2. restore some cap after memset in identify_cpu for boot cpu
esp for CONSTANT_TSC this matters, as:
before this patch:
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow rep_good nopl pni monitor cx16 lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs
after this patch:
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl pni monitor cx16 lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs
so constant_tsc is back...
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/cpu/amd.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/amd_64.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/centaur_64.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/intel_64.c | 2 |
5 files changed, 12 insertions, 8 deletions
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index e0ba2c7c5a18..c3175da7bc69 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
@@ -26,11 +26,8 @@ __asm__(".align 4\nvide: ret"); | |||
26 | 26 | ||
27 | static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) | 27 | static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) |
28 | { | 28 | { |
29 | if (cpuid_eax(0x80000000) >= 0x80000007) { | 29 | if (c->x86_power & (1<<8)) |
30 | c->x86_power = cpuid_edx(0x80000007); | 30 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); |
31 | if (c->x86_power & (1<<8)) | ||
32 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); | ||
33 | } | ||
34 | 31 | ||
35 | /* Set MTRR capability flag if appropriate */ | 32 | /* Set MTRR capability flag if appropriate */ |
36 | if (c->x86_model == 13 || c->x86_model == 9 || | 33 | if (c->x86_model == 13 || c->x86_model == 9 || |
diff --git a/arch/x86/kernel/cpu/amd_64.c b/arch/x86/kernel/cpu/amd_64.c index c5fbf7477ead..8c2d07f06f1d 100644 --- a/arch/x86/kernel/cpu/amd_64.c +++ b/arch/x86/kernel/cpu/amd_64.c | |||
@@ -140,6 +140,8 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) | |||
140 | } | 140 | } |
141 | #endif | 141 | #endif |
142 | 142 | ||
143 | early_init_amd(c); | ||
144 | |||
143 | /* Bit 31 in normal CPUID used for nonstandard 3DNow ID; | 145 | /* Bit 31 in normal CPUID used for nonstandard 3DNow ID; |
144 | 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */ | 146 | 3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */ |
145 | clear_cpu_cap(c, 0*32+31); | 147 | clear_cpu_cap(c, 0*32+31); |
diff --git a/arch/x86/kernel/cpu/centaur_64.c b/arch/x86/kernel/cpu/centaur_64.c index 49cfc6d2f2fb..0e5cf17a3c89 100644 --- a/arch/x86/kernel/cpu/centaur_64.c +++ b/arch/x86/kernel/cpu/centaur_64.c | |||
@@ -16,6 +16,8 @@ static void __cpuinit early_init_centaur(struct cpuinfo_x86 *c) | |||
16 | 16 | ||
17 | static void __cpuinit init_centaur(struct cpuinfo_x86 *c) | 17 | static void __cpuinit init_centaur(struct cpuinfo_x86 *c) |
18 | { | 18 | { |
19 | early_init_centaur(c); | ||
20 | |||
19 | if (c->x86 == 0x6 && c->x86_model >= 0xf) { | 21 | if (c->x86 == 0x6 && c->x86_model >= 0xf) { |
20 | c->x86_cache_alignment = c->x86_clflush_size * 2; | 22 | c->x86_cache_alignment = c->x86_clflush_size * 2; |
21 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); | 23 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index a8b9b7242428..e8045c4ef1c1 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -473,9 +473,6 @@ static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c) | |||
473 | c->x86_capability[2] = cpuid_edx(0x80860001); | 473 | c->x86_capability[2] = cpuid_edx(0x80860001); |
474 | } | 474 | } |
475 | 475 | ||
476 | if (c->extended_cpuid_level >= 0x80000007) | ||
477 | c->x86_power = cpuid_edx(0x80000007); | ||
478 | |||
479 | if (c->extended_cpuid_level >= 0x80000008) { | 476 | if (c->extended_cpuid_level >= 0x80000008) { |
480 | u32 eax = cpuid_eax(0x80000008); | 477 | u32 eax = cpuid_eax(0x80000008); |
481 | 478 | ||
@@ -483,6 +480,10 @@ static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c) | |||
483 | c->x86_phys_bits = eax & 0xff; | 480 | c->x86_phys_bits = eax & 0xff; |
484 | } | 481 | } |
485 | #endif | 482 | #endif |
483 | |||
484 | if (c->extended_cpuid_level >= 0x80000007) | ||
485 | c->x86_power = cpuid_edx(0x80000007); | ||
486 | |||
486 | } | 487 | } |
487 | /* | 488 | /* |
488 | * Do minimum CPU detection early. | 489 | * Do minimum CPU detection early. |
diff --git a/arch/x86/kernel/cpu/intel_64.c b/arch/x86/kernel/cpu/intel_64.c index 0c0a58dfe099..14a2cd98d480 100644 --- a/arch/x86/kernel/cpu/intel_64.c +++ b/arch/x86/kernel/cpu/intel_64.c | |||
@@ -54,6 +54,8 @@ static void __cpuinit srat_detect_node(void) | |||
54 | 54 | ||
55 | static void __cpuinit init_intel(struct cpuinfo_x86 *c) | 55 | static void __cpuinit init_intel(struct cpuinfo_x86 *c) |
56 | { | 56 | { |
57 | early_init_intel(c); | ||
58 | |||
57 | init_intel_cacheinfo(c); | 59 | init_intel_cacheinfo(c); |
58 | if (c->cpuid_level > 9) { | 60 | if (c->cpuid_level > 9) { |
59 | unsigned eax = cpuid_eax(10); | 61 | unsigned eax = cpuid_eax(10); |