aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-03-19 13:25:58 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:02 -0400
commitc70dcb74309cedfa64f0060f4a84792e873ceb53 (patch)
treeeb2d31f3a9060632e82d4b6e0b648657b4d31859 /arch/x86/kernel
parent9d97d0da71ad6c7ceb76b4e29b02bed1ee9d4cd2 (diff)
x86: change boot_cpu_id to boot_cpu_physical_apicid
This is to match i386. The former name was cuter, but the current is more meaningful and more general, since cpu_id can be a logical id. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/apic_64.c13
-rw-r--r--arch/x86/kernel/mpparse_64.c12
-rw-r--r--arch/x86/kernel/smpboot_64.c18
3 files changed, 23 insertions, 20 deletions
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c
index 8a475793f736..868ec1deb19a 100644
--- a/arch/x86/kernel/apic_64.c
+++ b/arch/x86/kernel/apic_64.c
@@ -431,7 +431,8 @@ void __cpuinit check_boot_apic_timer_broadcast(void)
431 lapic_clockevent.features |= CLOCK_EVT_FEAT_DUMMY; 431 lapic_clockevent.features |= CLOCK_EVT_FEAT_DUMMY;
432 432
433 local_irq_enable(); 433 local_irq_enable();
434 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_FORCE, &boot_cpu_id); 434 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_FORCE,
435 &boot_cpu_physical_apicid);
435 local_irq_disable(); 436 local_irq_disable();
436} 437}
437 438
@@ -857,7 +858,7 @@ static int __init detect_init_APIC(void)
857 } 858 }
858 859
859 mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; 860 mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
860 boot_cpu_id = 0; 861 boot_cpu_physical_apicid = 0;
861 return 0; 862 return 0;
862} 863}
863 864
@@ -882,7 +883,7 @@ void __init early_init_lapic_mapping(void)
882 * Fetch the APIC ID of the BSP in case we have a 883 * Fetch the APIC ID of the BSP in case we have a
883 * default configuration (or the MP table is broken). 884 * default configuration (or the MP table is broken).
884 */ 885 */
885 boot_cpu_id = GET_APIC_ID(apic_read(APIC_ID)); 886 boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
886} 887}
887 888
888/** 889/**
@@ -909,7 +910,7 @@ void __init init_apic_mappings(void)
909 * Fetch the APIC ID of the BSP in case we have a 910 * Fetch the APIC ID of the BSP in case we have a
910 * default configuration (or the MP table is broken). 911 * default configuration (or the MP table is broken).
911 */ 912 */
912 boot_cpu_id = GET_APIC_ID(apic_read(APIC_ID)); 913 boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
913} 914}
914 915
915/* 916/*
@@ -930,8 +931,8 @@ int __init APIC_init_uniprocessor(void)
930 931
931 verify_local_APIC(); 932 verify_local_APIC();
932 933
933 phys_cpu_present_map = physid_mask_of_physid(boot_cpu_id); 934 phys_cpu_present_map = physid_mask_of_physid(boot_cpu_physical_apicid);
934 apic_write(APIC_ID, SET_APIC_ID(boot_cpu_id)); 935 apic_write(APIC_ID, SET_APIC_ID(boot_cpu_physical_apicid));
935 936
936 setup_local_APIC(); 937 setup_local_APIC();
937 938
diff --git a/arch/x86/kernel/mpparse_64.c b/arch/x86/kernel/mpparse_64.c
index 03ef1a8b53e8..20a345dd425b 100644
--- a/arch/x86/kernel/mpparse_64.c
+++ b/arch/x86/kernel/mpparse_64.c
@@ -59,8 +59,8 @@ unsigned long mp_lapic_addr = 0;
59 59
60 60
61/* Processor that is doing the boot up */ 61/* Processor that is doing the boot up */
62unsigned int boot_cpu_id = -1U; 62unsigned int boot_cpu_physical_apicid = -1U;
63EXPORT_SYMBOL(boot_cpu_id); 63EXPORT_SYMBOL(boot_cpu_physical_apicid);
64 64
65/* Internal processor count */ 65/* Internal processor count */
66unsigned int num_processors; 66unsigned int num_processors;
@@ -107,7 +107,7 @@ static void __cpuinit MP_processor_info(struct mpc_config_processor *m)
107 } 107 }
108 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) { 108 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) {
109 bootup_cpu = " (Bootup-CPU)"; 109 bootup_cpu = " (Bootup-CPU)";
110 boot_cpu_id = m->mpc_apicid; 110 boot_cpu_physical_apicid = m->mpc_apicid;
111 } 111 }
112 112
113 printk(KERN_INFO "Processor #%d%s\n", m->mpc_apicid, bootup_cpu); 113 printk(KERN_INFO "Processor #%d%s\n", m->mpc_apicid, bootup_cpu);
@@ -665,8 +665,8 @@ void __init mp_register_lapic_address(u64 address)
665{ 665{
666 mp_lapic_addr = (unsigned long) address; 666 mp_lapic_addr = (unsigned long) address;
667 set_fixmap_nocache(FIX_APIC_BASE, mp_lapic_addr); 667 set_fixmap_nocache(FIX_APIC_BASE, mp_lapic_addr);
668 if (boot_cpu_id == -1U) 668 if (boot_cpu_physical_apicid == -1U)
669 boot_cpu_id = GET_APIC_ID(apic_read(APIC_ID)); 669 boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
670} 670}
671 671
672void __cpuinit mp_register_lapic (u8 id, u8 enabled) 672void __cpuinit mp_register_lapic (u8 id, u8 enabled)
@@ -674,7 +674,7 @@ void __cpuinit mp_register_lapic (u8 id, u8 enabled)
674 struct mpc_config_processor processor; 674 struct mpc_config_processor processor;
675 int boot_cpu = 0; 675 int boot_cpu = 0;
676 676
677 if (id == boot_cpu_id) 677 if (id == boot_cpu_physical_apicid)
678 boot_cpu = 1; 678 boot_cpu = 1;
679 679
680 processor.mpc_type = MP_PROCESSOR; 680 processor.mpc_type = MP_PROCESSOR;
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c
index 7ec96218a97e..420ae4a33548 100644
--- a/arch/x86/kernel/smpboot_64.c
+++ b/arch/x86/kernel/smpboot_64.c
@@ -602,7 +602,8 @@ static __init void disable_smp(void)
602 cpu_present_map = cpumask_of_cpu(0); 602 cpu_present_map = cpumask_of_cpu(0);
603 cpu_possible_map = cpumask_of_cpu(0); 603 cpu_possible_map = cpumask_of_cpu(0);
604 if (smp_found_config) 604 if (smp_found_config)
605 phys_cpu_present_map = physid_mask_of_physid(boot_cpu_id); 605 phys_cpu_present_map =
606 physid_mask_of_physid(boot_cpu_physical_apicid);
606 else 607 else
607 phys_cpu_present_map = physid_mask_of_physid(0); 608 phys_cpu_present_map = physid_mask_of_physid(0);
608 cpu_set(0, per_cpu(cpu_sibling_map, 0)); 609 cpu_set(0, per_cpu(cpu_sibling_map, 0));
@@ -637,9 +638,10 @@ static int __init smp_sanity_check(unsigned max_cpus)
637 * Should not be necessary because the MP table should list the boot 638 * Should not be necessary because the MP table should list the boot
638 * CPU too, but we do it for the sake of robustness anyway. 639 * CPU too, but we do it for the sake of robustness anyway.
639 */ 640 */
640 if (!physid_isset(boot_cpu_id, phys_cpu_present_map)) { 641 if (!physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map)) {
641 printk(KERN_NOTICE "weird, boot CPU (#%d) not listed by the BIOS.\n", 642 printk(KERN_NOTICE
642 boot_cpu_id); 643 "weird, boot CPU (#%d) not listed by the BIOS.\n",
644 boot_cpu_physical_apicid);
643 physid_set(hard_smp_processor_id(), phys_cpu_present_map); 645 physid_set(hard_smp_processor_id(), phys_cpu_present_map);
644 } 646 }
645 647
@@ -648,7 +650,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
648 */ 650 */
649 if (!cpu_has_apic) { 651 if (!cpu_has_apic) {
650 printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n", 652 printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
651 boot_cpu_id); 653 boot_cpu_physical_apicid);
652 printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n"); 654 printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n");
653 nr_ioapics = 0; 655 nr_ioapics = 0;
654 return -1; 656 return -1;
@@ -709,9 +711,9 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
709 enable_IO_APIC(); 711 enable_IO_APIC();
710 end_local_APIC_setup(); 712 end_local_APIC_setup();
711 713
712 if (GET_APIC_ID(apic_read(APIC_ID)) != boot_cpu_id) { 714 if (GET_APIC_ID(apic_read(APIC_ID)) != boot_cpu_physical_apicid) {
713 panic("Boot APIC ID in local APIC unexpected (%d vs %d)", 715 panic("Boot APIC ID in local APIC unexpected (%d vs %d)",
714 GET_APIC_ID(apic_read(APIC_ID)), boot_cpu_id); 716 GET_APIC_ID(apic_read(APIC_ID)), boot_cpu_physical_apicid);
715 /* Or can we switch back to PIC here? */ 717 /* Or can we switch back to PIC here? */
716 } 718 }
717 719
@@ -756,7 +758,7 @@ int __cpuinit native_cpu_up(unsigned int cpu)
756 758
757 Dprintk("++++++++++++++++++++=_---CPU UP %u\n", cpu); 759 Dprintk("++++++++++++++++++++=_---CPU UP %u\n", cpu);
758 760
759 if (apicid == BAD_APICID || apicid == boot_cpu_id || 761 if (apicid == BAD_APICID || apicid == boot_cpu_physical_apicid ||
760 !physid_isset(apicid, phys_cpu_present_map)) { 762 !physid_isset(apicid, phys_cpu_present_map)) {
761 printk("__cpu_up: bad cpu %d\n", cpu); 763 printk("__cpu_up: bad cpu %d\n", cpu);
762 return -EINVAL; 764 return -EINVAL;