Skip to content

Commit 148f9bb

Browse files
author
Paul Gortmaker
committed
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense some time ago when RAM was more constrained, but now the savings do not offset the cost and complications. For example, the fix in commit 5e427ec ("x86: Fix bit corruption at CPU resume time") is a good example of the nasty type of bugs that can be created with improper use of the various __init prefixes. After a discussion on LKML[1] it was decided that cpuinit should go the way of devinit and be phased out. Once all the users are gone, we can then finally remove the macros themselves from linux/init.h. Note that some harmless section mismatch warnings may result, since notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c) are flagged as __cpuinit -- so if we remove the __cpuinit from arch specific callers, we will also get section mismatch warnings. As an intermediate step, we intend to turn the linux/init.h cpuinit content into no-ops as early as possible, since that will get rid of these warnings. In any case, they are temporary and harmless. This removes all the arch/x86 uses of the __cpuinit macros from all C files. x86 only had the one __CPUINIT used in assembly files, and it wasn't paired off with a .previous or a __FINIT, so we can delete it directly w/o any corresponding additional change there. [1] https://lkml.org/lkml/2013/5/20/589 Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: x86@kernel.org Acked-by: Ingo Molnar <mingo@kernel.org> Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: H. Peter Anvin <hpa@linux.intel.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
1 parent 70e2a7b commit 148f9bb

71 files changed

Lines changed: 345 additions & 356 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct x86_cpu {
2828
#ifdef CONFIG_HOTPLUG_CPU
2929
extern int arch_register_cpu(int num);
3030
extern void arch_unregister_cpu(int);
31-
extern void __cpuinit start_cpu0(void);
31+
extern void start_cpu0(void);
3232
#ifdef CONFIG_DEBUG_HOTPLUG_CPU0
3333
extern int _debug_hotplug_cpu(int cpu, int action);
3434
#endif

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ static inline void __exit exit_amd_microcode(void) {}
6060
#ifdef CONFIG_MICROCODE_EARLY
6161
#define MAX_UCODE_COUNT 128
6262
extern void __init load_ucode_bsp(void);
63-
extern void __cpuinit load_ucode_ap(void);
63+
extern void load_ucode_ap(void);
6464
extern int __init save_microcode_in_initrd(void);
6565
#else
6666
static inline void __init load_ucode_bsp(void) {}
67-
static inline void __cpuinit load_ucode_ap(void) {}
67+
static inline void load_ucode_ap(void) {}
6868
static inline int __init save_microcode_in_initrd(void)
6969
{
7070
return 0;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ extern enum ucode_state load_microcode_amd(int cpu, const u8 *data, size_t size)
6767
extern u8 amd_bsp_mpb[MPB_MAX_SIZE];
6868
#endif
6969
extern void __init load_ucode_amd_bsp(void);
70-
extern void __cpuinit load_ucode_amd_ap(void);
70+
extern void load_ucode_amd_ap(void);
7171
extern int __init save_microcode_in_initrd_amd(void);
7272
#else
7373
static inline void __init load_ucode_amd_bsp(void) {}
74-
static inline void __cpuinit load_ucode_amd_ap(void) {}
74+
static inline void load_ucode_amd_ap(void) {}
7575
static inline int __init save_microcode_in_initrd_amd(void) { return -EINVAL; }
7676
#endif
7777

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ update_match_revision(struct microcode_header_intel *mc_header, int rev);
6565

6666
#ifdef CONFIG_MICROCODE_INTEL_EARLY
6767
extern void __init load_ucode_intel_bsp(void);
68-
extern void __cpuinit load_ucode_intel_ap(void);
68+
extern void load_ucode_intel_ap(void);
6969
extern void show_ucode_info_early(void);
7070
extern int __init save_microcode_in_initrd_intel(void);
7171
#else
7272
static inline __init void load_ucode_intel_bsp(void) {}
73-
static inline __cpuinit void load_ucode_intel_ap(void) {}
73+
static inline void load_ucode_intel_ap(void) {}
7474
static inline void show_ucode_info_early(void) {}
7575
static inline int __init save_microcode_in_initrd_intel(void) { return -EINVAL; }
7676
#endif

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#define _ASM_X86_MMCONFIG_H
33

44
#ifdef CONFIG_PCI_MMCONFIG
5-
extern void __cpuinit fam10h_check_enable_mmcfg(void);
6-
extern void __cpuinit check_enable_amd_mmconf_dmi(void);
5+
extern void fam10h_check_enable_mmcfg(void);
6+
extern void check_enable_amd_mmconf_dmi(void);
77
#else
88
static inline void fam10h_check_enable_mmcfg(void) { }
99
static inline void check_enable_amd_mmconf_dmi(void) { }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static inline void early_reserve_e820_mpc_new(void) { }
9494
#define default_get_smp_config x86_init_uint_noop
9595
#endif
9696

97-
void __cpuinit generic_processor_info(int apicid, int version);
97+
void generic_processor_info(int apicid, int version);
9898
#ifdef CONFIG_ACPI
9999
extern void mp_register_ioapic(int id, u32 address, u32 gsi_base);
100100
extern void mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static inline void set_apicid_to_node(int apicid, s16 node)
3939
__apicid_to_node[apicid] = node;
4040
}
4141

42-
extern int __cpuinit numa_cpu_node(int cpu);
42+
extern int numa_cpu_node(int cpu);
4343

4444
#else /* CONFIG_NUMA */
4545
static inline void set_apicid_to_node(int apicid, s16 node)
@@ -60,8 +60,8 @@ static inline int numa_cpu_node(int cpu)
6060
extern void numa_set_node(int cpu, int node);
6161
extern void numa_clear_node(int cpu);
6262
extern void __init init_cpu_to_node(void);
63-
extern void __cpuinit numa_add_cpu(int cpu);
64-
extern void __cpuinit numa_remove_cpu(int cpu);
63+
extern void numa_add_cpu(int cpu);
64+
extern void numa_remove_cpu(int cpu);
6565
#else /* CONFIG_NUMA */
6666
static inline void numa_set_node(int cpu, int node) { }
6767
static inline void numa_clear_node(int cpu) { }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ extern const struct seq_operations cpuinfo_op;
164164
#define cache_line_size() (boot_cpu_data.x86_cache_alignment)
165165

166166
extern void cpu_detect(struct cpuinfo_x86 *c);
167-
extern void __cpuinit fpu_detect(struct cpuinfo_x86 *c);
167+
extern void fpu_detect(struct cpuinfo_x86 *c);
168168

169169
extern void early_cpu_init(void);
170170
extern void identify_boot_cpu(void);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern int of_ioapic;
2727
extern u64 initial_dtb;
2828
extern void add_dtb(u64 data);
2929
extern void x86_add_irq_domains(void);
30-
void __cpuinit x86_of_pci_init(void);
30+
void x86_of_pci_init(void);
3131
void x86_dtb_init(void);
3232
#else
3333
static inline void add_dtb(u64 data) { }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ static inline int wbinvd_on_all_cpus(void)
179179
}
180180
#endif /* CONFIG_SMP */
181181

182-
extern unsigned disabled_cpus __cpuinitdata;
182+
extern unsigned disabled_cpus;
183183

184184
#ifdef CONFIG_X86_32_SMP
185185
/*

0 commit comments

Comments
 (0)