aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-09-04 23:09:12 -0400
committerIngo Molnar <mingo@elte.hu>2008-09-05 03:40:55 -0400
commitb89d3b3e2caeab3d895301d1aee3cd2a91eddb79 (patch)
tree90142c95160dd8593a6931501c50a78d9480acd1 /arch/x86
parent56f0d033be2ebb983993e5d7f24ae232c9a1e7f9 (diff)
x86: cpu/common*.c, merge generic_identify()
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/cpu/common.c15
-rw-r--r--arch/x86/kernel/cpu/common_64.c19
2 files changed, 28 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 61a70748213e..f35baa7f3036 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -548,6 +548,10 @@ void __init early_cpu_init(void)
548 * of early VIA chips and (more importantly) broken virtualizers that 548 * of early VIA chips and (more importantly) broken virtualizers that
549 * are not easy to detect. Hence, probe for it based on first 549 * are not easy to detect. Hence, probe for it based on first
550 * principles. 550 * principles.
551 *
552 * Note: no 64-bit chip is known to lack these, but put the code here
553 * for consistency with 32 bits, and to make it utterly trivial to
554 * diagnose the problem should it ever surface.
551 */ 555 */
552static void __cpuinit detect_nopl(struct cpuinfo_x86 *c) 556static void __cpuinit detect_nopl(struct cpuinfo_x86 *c)
553{ 557{
@@ -586,11 +590,16 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
586 590
587 if (c->cpuid_level >= 0x00000001) { 591 if (c->cpuid_level >= 0x00000001) {
588 c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xFF; 592 c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xFF;
589#ifdef CONFIG_X86_HT 593#ifdef CONFIG_X86_32
594# ifdef CONFIG_X86_HT
590 c->apicid = phys_pkg_id(c->initial_apicid, 0); 595 c->apicid = phys_pkg_id(c->initial_apicid, 0);
591 c->phys_proc_id = c->initial_apicid; 596# else
592#else
593 c->apicid = c->initial_apicid; 597 c->apicid = c->initial_apicid;
598# endif
599#endif
600
601#ifdef CONFIG_X86_HT
602 c->phys_proc_id = c->initial_apicid;
594#endif 603#endif
595 } 604 }
596 605
diff --git a/arch/x86/kernel/cpu/common_64.c b/arch/x86/kernel/cpu/common_64.c
index 68b06a39dcac..869a6ff9f7dc 100644
--- a/arch/x86/kernel/cpu/common_64.c
+++ b/arch/x86/kernel/cpu/common_64.c
@@ -581,6 +581,9 @@ static void __cpuinit detect_nopl(struct cpuinfo_x86 *c)
581 581
582static void __cpuinit generic_identify(struct cpuinfo_x86 *c) 582static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
583{ 583{
584 if (!have_cpuid_p())
585 return;
586
584 c->extended_cpuid_level = 0; 587 c->extended_cpuid_level = 0;
585 588
586 cpu_detect(c); 589 cpu_detect(c);
@@ -589,11 +592,21 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
589 592
590 get_cpu_cap(c); 593 get_cpu_cap(c);
591 594
592 c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xff; 595 if (c->cpuid_level >= 0x00000001) {
593#ifdef CONFIG_SMP 596 c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xFF;
594 c->phys_proc_id = c->initial_apicid; 597#ifdef CONFIG_X86_32
598# ifdef CONFIG_X86_HT
599 c->apicid = phys_pkg_id(c->initial_apicid, 0);
600# else
601 c->apicid = c->initial_apicid;
602# endif
595#endif 603#endif
596 604
605#ifdef CONFIG_X86_HT
606 c->phys_proc_id = c->initial_apicid;
607#endif
608 }
609
597 if (c->extended_cpuid_level >= 0x80000004) 610 if (c->extended_cpuid_level >= 0x80000004)
598 get_model_name(c); /* Default name */ 611 get_model_name(c); /* Default name */
599 612