aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-09-04 23:09:10 -0400
committerIngo Molnar <mingo@elte.hu>2008-09-05 03:40:54 -0400
commit6627d2423067f2c6eedb422a59fba9270a3c5e36 (patch)
tree89c5e002b289a337902f5f5a413a18ba81403951 /arch
parent5122c890ba969e6efeaba9ed45f5936e62d3c6d5 (diff)
x86: cpu/common*.c, merge early_identify_cpu()
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/cpu/common.c4
-rw-r--r--arch/x86/kernel/cpu/common_64.c19
2 files changed, 20 insertions, 3 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index ffc2f5ed09a3..61a70748213e 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -490,7 +490,11 @@ static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c)
490 */ 490 */
491static void __init early_identify_cpu(struct cpuinfo_x86 *c) 491static void __init early_identify_cpu(struct cpuinfo_x86 *c)
492{ 492{
493#ifdef CONFIG_X86_64
494 c->x86_clflush_size = 64;
495#else
493 c->x86_clflush_size = 32; 496 c->x86_clflush_size = 32;
497#endif
494 c->x86_cache_alignment = c->x86_clflush_size; 498 c->x86_cache_alignment = c->x86_clflush_size;
495 499
496 if (!have_cpuid_p()) 500 if (!have_cpuid_p())
diff --git a/arch/x86/kernel/cpu/common_64.c b/arch/x86/kernel/cpu/common_64.c
index 75bb7ff99ee3..6475548d64eb 100644
--- a/arch/x86/kernel/cpu/common_64.c
+++ b/arch/x86/kernel/cpu/common_64.c
@@ -482,15 +482,28 @@ static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c)
482#endif 482#endif
483} 483}
484 484
485/* Do some early cpuid on the boot CPU to get some parameter that are 485/*
486 needed before check_bugs. Everything advanced is in identify_cpu 486 * Do minimum CPU detection early.
487 below. */ 487 * Fields really needed: vendor, cpuid_level, family, model, mask,
488 * cache alignment.
489 * The others are not touched to avoid unwanted side effects.
490 *
491 * WARNING: this function is only called on the BP. Don't add code here
492 * that is supposed to run on all CPUs.
493 */
488static void __init early_identify_cpu(struct cpuinfo_x86 *c) 494static void __init early_identify_cpu(struct cpuinfo_x86 *c)
489{ 495{
490 496
497#ifdef CONFIG_X86_64
491 c->x86_clflush_size = 64; 498 c->x86_clflush_size = 64;
499#else
500 c->x86_clflush_size = 32;
501#endif
492 c->x86_cache_alignment = c->x86_clflush_size; 502 c->x86_cache_alignment = c->x86_clflush_size;
493 503
504 if (!have_cpuid_p())
505 return;
506
494 memset(&c->x86_capability, 0, sizeof c->x86_capability); 507 memset(&c->x86_capability, 0, sizeof c->x86_capability);
495 508
496 c->extended_cpuid_level = 0; 509 c->extended_cpuid_level = 0;