Skip to content

Commit f6e9456

Browse files
Robert RichterH. Peter Anvin
authored andcommitted
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: c70dcb7 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: Robert Richter <robert.richter@amd.com> LKML-Reference: <1279731838-1522-8-git-send-email-robert.richter@amd.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
1 parent ad41a1e commit f6e9456

11 files changed

Lines changed: 15 additions & 18 deletions

File tree

‎arch/x86/include/asm/apb_timer.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ extern struct clock_event_device *global_clock_event;
5454
extern unsigned long apbt_quick_calibrate(void);
5555
extern int arch_setup_apbt_irqs(int irq, int trigger, int mask, int cpu);
5656
extern void apbt_setup_secondary_clock(void);
57-
extern unsigned int boot_cpu_id;
5857

5958
extern struct sfi_timer_table_entry *sfi_get_mtmr(int hint);
6059
extern void sfi_free_mtmr(struct sfi_timer_table_entry *mtmr);

‎arch/x86/include/asm/cpu.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,5 @@ extern void arch_unregister_cpu(int);
3232

3333
DECLARE_PER_CPU(int, cpu_state);
3434

35-
extern unsigned int boot_cpu_id;
3635

3736
#endif /* _ASM_X86_CPU_H */

‎arch/x86/kernel/apb_timer.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ void apbt_setup_secondary_clock(void)
343343

344344
/* Don't register boot CPU clockevent */
345345
cpu = smp_processor_id();
346-
if (cpu == boot_cpu_id)
346+
if (!cpu)
347347
return;
348348
/*
349349
* We need to calculate the scaled math multiplication factor for

‎arch/x86/kernel/apic/io_apic.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ int __init arch_early_irq_init(void)
162162

163163
cfg = irq_cfgx;
164164
count = ARRAY_SIZE(irq_cfgx);
165-
node= cpu_to_node(boot_cpu_id);
165+
node = cpu_to_node(0);
166166

167167
for (i = 0; i < count; i++) {
168168
desc = irq_to_desc(i);
@@ -1483,7 +1483,7 @@ static void __init setup_IO_APIC_irqs(void)
14831483
int notcon = 0;
14841484
struct irq_desc *desc;
14851485
struct irq_cfg *cfg;
1486-
int node = cpu_to_node(boot_cpu_id);
1486+
int node = cpu_to_node(0);
14871487

14881488
apic_printk(APIC_VERBOSE, KERN_DEBUG "init IO_APIC IRQs\n");
14891489

@@ -1548,7 +1548,7 @@ static void __init setup_IO_APIC_irqs(void)
15481548
void setup_IO_APIC_irq_extra(u32 gsi)
15491549
{
15501550
int apic_id = 0, pin, idx, irq;
1551-
int node = cpu_to_node(boot_cpu_id);
1551+
int node = cpu_to_node(0);
15521552
struct irq_desc *desc;
15531553
struct irq_cfg *cfg;
15541554

@@ -2925,7 +2925,7 @@ static inline void __init check_timer(void)
29252925
{
29262926
struct irq_desc *desc = irq_to_desc(0);
29272927
struct irq_cfg *cfg = desc->chip_data;
2928-
int node = cpu_to_node(boot_cpu_id);
2928+
int node = cpu_to_node(0);
29292929
int apic1, pin1, apic2, pin2;
29302930
unsigned long flags;
29312931
int no_pin1 = 0;
@@ -3279,7 +3279,7 @@ unsigned int create_irq_nr(unsigned int irq_want, int node)
32793279

32803280
int create_irq(void)
32813281
{
3282-
int node = cpu_to_node(boot_cpu_id);
3282+
int node = cpu_to_node(0);
32833283
unsigned int irq_want;
32843284
int irq;
32853285

@@ -3901,7 +3901,7 @@ static int __io_apic_set_pci_routing(struct device *dev, int irq,
39013901
if (dev)
39023902
node = dev_to_node(dev);
39033903
else
3904-
node = cpu_to_node(boot_cpu_id);
3904+
node = cpu_to_node(0);
39053905

39063906
desc = irq_to_desc_alloc_node(irq, node);
39073907
if (!desc) {

‎arch/x86/kernel/cpu/amd.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static void __cpuinit amd_k7_smp_check(struct cpuinfo_x86 *c)
148148
{
149149
#ifdef CONFIG_SMP
150150
/* calling is from identify_secondary_cpu() ? */
151-
if (c->cpu_index == boot_cpu_id)
151+
if (!c->cpu_index)
152152
return;
153153

154154
/*

‎arch/x86/kernel/cpu/common.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
665665
this_cpu->c_early_init(c);
666666

667667
#ifdef CONFIG_SMP
668-
c->cpu_index = boot_cpu_id;
668+
c->cpu_index = 0;
669669
#endif
670670
filter_cpuid_features(c, false);
671671
}

‎arch/x86/kernel/cpu/intel.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static void __cpuinit intel_smp_check(struct cpuinfo_x86 *c)
169169
{
170170
#ifdef CONFIG_SMP
171171
/* calling is from identify_secondary_cpu() ? */
172-
if (c->cpu_index == boot_cpu_id)
172+
if (!c->cpu_index)
173173
return;
174174

175175
/*

‎arch/x86/kernel/reboot.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static int __init reboot_setup(char *str)
8484
}
8585
/* we will leave sorting out the final value
8686
when we are ready to reboot, since we might not
87-
have set up boot_cpu_id or smp_num_cpu */
87+
have detected BSP APIC ID or smp_num_cpu */
8888
break;
8989
#endif /* CONFIG_SMP */
9090

‎arch/x86/kernel/setup.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ unsigned long max_pfn_mapped;
125125
RESERVE_BRK(dmi_alloc, 65536);
126126
#endif
127127

128-
unsigned int boot_cpu_id __read_mostly;
129128

130129
static __initdata unsigned long _brk_start = (unsigned long)__brk_base;
131130
unsigned long _brk_end = (unsigned long)__brk_base;

‎arch/x86/kernel/setup_percpu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ void __init setup_per_cpu_areas(void)
253253
* Up to this point, the boot CPU has been using .init.data
254254
* area. Reload any changed state for the boot CPU.
255255
*/
256-
if (cpu == boot_cpu_id)
256+
if (!cpu)
257257
switch_to_new_gdt(cpu);
258258
}
259259

0 commit comments

Comments
 (0)