Commit f6e9456c authored by Robert Richter's avatar Robert Richter Committed by H. Peter Anvin

x86, cleanup: Remove obsolete boot_cpu_id variable

boot_cpu_id is there for historical reasons and was renamed to
boot_cpu_physical_apicid in patch:

 c70dcb74 x86: change boot_cpu_id to boot_cpu_physical_apicid

However, there are some remaining occurrences of boot_cpu_id that are
never touched in the kernel and thus its value is always 0.

This patch removes boot_cpu_id completely.
Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
LKML-Reference: <1279731838-1522-8-git-send-email-robert.richter@amd.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent ad41a1e0
...@@ -54,7 +54,6 @@ extern struct clock_event_device *global_clock_event; ...@@ -54,7 +54,6 @@ extern struct clock_event_device *global_clock_event;
extern unsigned long apbt_quick_calibrate(void); extern unsigned long apbt_quick_calibrate(void);
extern int arch_setup_apbt_irqs(int irq, int trigger, int mask, int cpu); extern int arch_setup_apbt_irqs(int irq, int trigger, int mask, int cpu);
extern void apbt_setup_secondary_clock(void); extern void apbt_setup_secondary_clock(void);
extern unsigned int boot_cpu_id;
extern struct sfi_timer_table_entry *sfi_get_mtmr(int hint); extern struct sfi_timer_table_entry *sfi_get_mtmr(int hint);
extern void sfi_free_mtmr(struct sfi_timer_table_entry *mtmr); extern void sfi_free_mtmr(struct sfi_timer_table_entry *mtmr);
......
...@@ -32,6 +32,5 @@ extern void arch_unregister_cpu(int); ...@@ -32,6 +32,5 @@ extern void arch_unregister_cpu(int);
DECLARE_PER_CPU(int, cpu_state); DECLARE_PER_CPU(int, cpu_state);
extern unsigned int boot_cpu_id;
#endif /* _ASM_X86_CPU_H */ #endif /* _ASM_X86_CPU_H */
...@@ -343,7 +343,7 @@ void apbt_setup_secondary_clock(void) ...@@ -343,7 +343,7 @@ void apbt_setup_secondary_clock(void)
/* Don't register boot CPU clockevent */ /* Don't register boot CPU clockevent */
cpu = smp_processor_id(); cpu = smp_processor_id();
if (cpu == boot_cpu_id) if (!cpu)
return; return;
/* /*
* We need to calculate the scaled math multiplication factor for * We need to calculate the scaled math multiplication factor for
......
...@@ -162,7 +162,7 @@ int __init arch_early_irq_init(void) ...@@ -162,7 +162,7 @@ int __init arch_early_irq_init(void)
cfg = irq_cfgx; cfg = irq_cfgx;
count = ARRAY_SIZE(irq_cfgx); count = ARRAY_SIZE(irq_cfgx);
node= cpu_to_node(boot_cpu_id); node = cpu_to_node(0);
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
desc = irq_to_desc(i); desc = irq_to_desc(i);
...@@ -1483,7 +1483,7 @@ static void __init setup_IO_APIC_irqs(void) ...@@ -1483,7 +1483,7 @@ static void __init setup_IO_APIC_irqs(void)
int notcon = 0; int notcon = 0;
struct irq_desc *desc; struct irq_desc *desc;
struct irq_cfg *cfg; struct irq_cfg *cfg;
int node = cpu_to_node(boot_cpu_id); int node = cpu_to_node(0);
apic_printk(APIC_VERBOSE, KERN_DEBUG "init IO_APIC IRQs\n"); apic_printk(APIC_VERBOSE, KERN_DEBUG "init IO_APIC IRQs\n");
...@@ -1548,7 +1548,7 @@ static void __init setup_IO_APIC_irqs(void) ...@@ -1548,7 +1548,7 @@ static void __init setup_IO_APIC_irqs(void)
void setup_IO_APIC_irq_extra(u32 gsi) void setup_IO_APIC_irq_extra(u32 gsi)
{ {
int apic_id = 0, pin, idx, irq; int apic_id = 0, pin, idx, irq;
int node = cpu_to_node(boot_cpu_id); int node = cpu_to_node(0);
struct irq_desc *desc; struct irq_desc *desc;
struct irq_cfg *cfg; struct irq_cfg *cfg;
...@@ -2925,7 +2925,7 @@ static inline void __init check_timer(void) ...@@ -2925,7 +2925,7 @@ static inline void __init check_timer(void)
{ {
struct irq_desc *desc = irq_to_desc(0); struct irq_desc *desc = irq_to_desc(0);
struct irq_cfg *cfg = desc->chip_data; struct irq_cfg *cfg = desc->chip_data;
int node = cpu_to_node(boot_cpu_id); int node = cpu_to_node(0);
int apic1, pin1, apic2, pin2; int apic1, pin1, apic2, pin2;
unsigned long flags; unsigned long flags;
int no_pin1 = 0; int no_pin1 = 0;
...@@ -3279,7 +3279,7 @@ unsigned int create_irq_nr(unsigned int irq_want, int node) ...@@ -3279,7 +3279,7 @@ unsigned int create_irq_nr(unsigned int irq_want, int node)
int create_irq(void) int create_irq(void)
{ {
int node = cpu_to_node(boot_cpu_id); int node = cpu_to_node(0);
unsigned int irq_want; unsigned int irq_want;
int irq; int irq;
...@@ -3901,7 +3901,7 @@ static int __io_apic_set_pci_routing(struct device *dev, int irq, ...@@ -3901,7 +3901,7 @@ static int __io_apic_set_pci_routing(struct device *dev, int irq,
if (dev) if (dev)
node = dev_to_node(dev); node = dev_to_node(dev);
else else
node = cpu_to_node(boot_cpu_id); node = cpu_to_node(0);
desc = irq_to_desc_alloc_node(irq, node); desc = irq_to_desc_alloc_node(irq, node);
if (!desc) { if (!desc) {
......
...@@ -148,7 +148,7 @@ static void __cpuinit amd_k7_smp_check(struct cpuinfo_x86 *c) ...@@ -148,7 +148,7 @@ static void __cpuinit amd_k7_smp_check(struct cpuinfo_x86 *c)
{ {
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* calling is from identify_secondary_cpu() ? */ /* calling is from identify_secondary_cpu() ? */
if (c->cpu_index == boot_cpu_id) if (!c->cpu_index)
return; return;
/* /*
......
...@@ -665,7 +665,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c) ...@@ -665,7 +665,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
this_cpu->c_early_init(c); this_cpu->c_early_init(c);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
c->cpu_index = boot_cpu_id; c->cpu_index = 0;
#endif #endif
filter_cpuid_features(c, false); filter_cpuid_features(c, false);
} }
......
...@@ -169,7 +169,7 @@ static void __cpuinit intel_smp_check(struct cpuinfo_x86 *c) ...@@ -169,7 +169,7 @@ static void __cpuinit intel_smp_check(struct cpuinfo_x86 *c)
{ {
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* calling is from identify_secondary_cpu() ? */ /* calling is from identify_secondary_cpu() ? */
if (c->cpu_index == boot_cpu_id) if (!c->cpu_index)
return; return;
/* /*
......
...@@ -84,7 +84,7 @@ static int __init reboot_setup(char *str) ...@@ -84,7 +84,7 @@ static int __init reboot_setup(char *str)
} }
/* we will leave sorting out the final value /* we will leave sorting out the final value
when we are ready to reboot, since we might not when we are ready to reboot, since we might not
have set up boot_cpu_id or smp_num_cpu */ have detected BSP APIC ID or smp_num_cpu */
break; break;
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
......
...@@ -125,7 +125,6 @@ unsigned long max_pfn_mapped; ...@@ -125,7 +125,6 @@ unsigned long max_pfn_mapped;
RESERVE_BRK(dmi_alloc, 65536); RESERVE_BRK(dmi_alloc, 65536);
#endif #endif
unsigned int boot_cpu_id __read_mostly;
static __initdata unsigned long _brk_start = (unsigned long)__brk_base; static __initdata unsigned long _brk_start = (unsigned long)__brk_base;
unsigned long _brk_end = (unsigned long)__brk_base; unsigned long _brk_end = (unsigned long)__brk_base;
......
...@@ -253,7 +253,7 @@ void __init setup_per_cpu_areas(void) ...@@ -253,7 +253,7 @@ void __init setup_per_cpu_areas(void)
* Up to this point, the boot CPU has been using .init.data * Up to this point, the boot CPU has been using .init.data
* area. Reload any changed state for the boot CPU. * area. Reload any changed state for the boot CPU.
*/ */
if (cpu == boot_cpu_id) if (!cpu)
switch_to_new_gdt(cpu); switch_to_new_gdt(cpu);
} }
......
...@@ -54,8 +54,8 @@ static __init int find_northbridge(void) ...@@ -54,8 +54,8 @@ static __init int find_northbridge(void)
static __init void early_get_boot_cpu_id(void) static __init void early_get_boot_cpu_id(void)
{ {
/* /*
* need to get boot_cpu_id so can use that to create apicid_to_node * need to get the APIC ID of the BSP so can use that to
* in k8_scan_nodes() * create apicid_to_node in k8_scan_nodes()
*/ */
#ifdef CONFIG_X86_MPPARSE #ifdef CONFIG_X86_MPPARSE
/* /*
...@@ -212,7 +212,7 @@ int __init k8_scan_nodes(void) ...@@ -212,7 +212,7 @@ int __init k8_scan_nodes(void)
bits = boot_cpu_data.x86_coreid_bits; bits = boot_cpu_data.x86_coreid_bits;
cores = (1<<bits); cores = (1<<bits);
apicid_base = 0; apicid_base = 0;
/* need to get boot_cpu_id early for system with apicid lifting */ /* get the APIC ID of the BSP early for systems with apicid lifting */
early_get_boot_cpu_id(); early_get_boot_cpu_id();
if (boot_cpu_physical_apicid > 0) { if (boot_cpu_physical_apicid > 0) {
pr_info("BSP APIC ID: %02x\n", boot_cpu_physical_apicid); pr_info("BSP APIC ID: %02x\n", boot_cpu_physical_apicid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment