Commit 8dce5f3d authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'cpuinit-delete' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux

Pull first stage of __cpuinit removal from Paul Gortmaker:
 "The two commits here 1) dummy out all the __cpuinit macros so that we
  no longer generate such sections, and then 2) remove all the section
  processing that we used to do for those sections.

  This makes all the __cpuinit and friends no-ops, so that we can remove
  the use cases of it at our leisure.  Expect stage 2, which does the
  tree wide removal sweep at the end of the merge window."

* 'cpuinit-delete' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
  modpost: remove all traces of cpuinit/cpuexit sections
  init.h: remove __cpuinit sections from the kernel
parents 21884a83 e24f6628
...@@ -174,8 +174,6 @@ ...@@ -174,8 +174,6 @@
*(.data) \ *(.data) \
*(.ref.data) \ *(.ref.data) \
*(.data..shared_aligned) /* percpu related */ \ *(.data..shared_aligned) /* percpu related */ \
CPU_KEEP(init.data) \
CPU_KEEP(exit.data) \
MEM_KEEP(init.data) \ MEM_KEEP(init.data) \
MEM_KEEP(exit.data) \ MEM_KEEP(exit.data) \
*(.data.unlikely) \ *(.data.unlikely) \
...@@ -355,8 +353,6 @@ ...@@ -355,8 +353,6 @@
/* __*init sections */ \ /* __*init sections */ \
__init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \ __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \
*(.ref.rodata) \ *(.ref.rodata) \
CPU_KEEP(init.rodata) \
CPU_KEEP(exit.rodata) \
MEM_KEEP(init.rodata) \ MEM_KEEP(init.rodata) \
MEM_KEEP(exit.rodata) \ MEM_KEEP(exit.rodata) \
} \ } \
...@@ -397,8 +393,6 @@ ...@@ -397,8 +393,6 @@
*(.text.hot) \ *(.text.hot) \
*(.text) \ *(.text) \
*(.ref.text) \ *(.ref.text) \
CPU_KEEP(init.text) \
CPU_KEEP(exit.text) \
MEM_KEEP(init.text) \ MEM_KEEP(init.text) \
MEM_KEEP(exit.text) \ MEM_KEEP(exit.text) \
*(.text.unlikely) *(.text.unlikely)
...@@ -482,14 +476,12 @@ ...@@ -482,14 +476,12 @@
/* init and exit section handling */ /* init and exit section handling */
#define INIT_DATA \ #define INIT_DATA \
*(.init.data) \ *(.init.data) \
CPU_DISCARD(init.data) \
MEM_DISCARD(init.data) \ MEM_DISCARD(init.data) \
KERNEL_CTORS() \ KERNEL_CTORS() \
MCOUNT_REC() \ MCOUNT_REC() \
*(.init.rodata) \ *(.init.rodata) \
FTRACE_EVENTS() \ FTRACE_EVENTS() \
TRACE_SYSCALLS() \ TRACE_SYSCALLS() \
CPU_DISCARD(init.rodata) \
MEM_DISCARD(init.rodata) \ MEM_DISCARD(init.rodata) \
CLK_OF_TABLES() \ CLK_OF_TABLES() \
CLKSRC_OF_TABLES() \ CLKSRC_OF_TABLES() \
...@@ -498,19 +490,15 @@ ...@@ -498,19 +490,15 @@
#define INIT_TEXT \ #define INIT_TEXT \
*(.init.text) \ *(.init.text) \
CPU_DISCARD(init.text) \
MEM_DISCARD(init.text) MEM_DISCARD(init.text)
#define EXIT_DATA \ #define EXIT_DATA \
*(.exit.data) \ *(.exit.data) \
CPU_DISCARD(exit.data) \
CPU_DISCARD(exit.rodata) \
MEM_DISCARD(exit.data) \ MEM_DISCARD(exit.data) \
MEM_DISCARD(exit.rodata) MEM_DISCARD(exit.rodata)
#define EXIT_TEXT \ #define EXIT_TEXT \
*(.exit.text) \ *(.exit.text) \
CPU_DISCARD(exit.text) \
MEM_DISCARD(exit.text) MEM_DISCARD(exit.text)
#define EXIT_CALL \ #define EXIT_CALL \
......
...@@ -93,13 +93,13 @@ ...@@ -93,13 +93,13 @@
#define __exit __section(.exit.text) __exitused __cold notrace #define __exit __section(.exit.text) __exitused __cold notrace
/* Used for HOTPLUG_CPU */ /* temporary, until all users are removed */
#define __cpuinit __section(.cpuinit.text) __cold notrace #define __cpuinit
#define __cpuinitdata __section(.cpuinit.data) #define __cpuinitdata
#define __cpuinitconst __constsection(.cpuinit.rodata) #define __cpuinitconst
#define __cpuexit __section(.cpuexit.text) __exitused __cold notrace #define __cpuexit
#define __cpuexitdata __section(.cpuexit.data) #define __cpuexitdata
#define __cpuexitconst __constsection(.cpuexit.rodata) #define __cpuexitconst
/* Used for MEMORY_HOTPLUG */ /* Used for MEMORY_HOTPLUG */
#define __meminit __section(.meminit.text) __cold notrace #define __meminit __section(.meminit.text) __cold notrace
...@@ -118,9 +118,8 @@ ...@@ -118,9 +118,8 @@
#define __INITRODATA .section ".init.rodata","a",%progbits #define __INITRODATA .section ".init.rodata","a",%progbits
#define __FINITDATA .previous #define __FINITDATA .previous
#define __CPUINIT .section ".cpuinit.text", "ax" /* temporary, until all users are removed */
#define __CPUINITDATA .section ".cpuinit.data", "aw" #define __CPUINIT
#define __CPUINITRODATA .section ".cpuinit.rodata", "a"
#define __MEMINIT .section ".meminit.text", "ax" #define __MEMINIT .section ".meminit.text", "ax"
#define __MEMINITDATA .section ".meminit.data", "aw" #define __MEMINITDATA .section ".meminit.data", "aw"
......
...@@ -861,24 +861,23 @@ static void check_section(const char *modname, struct elf_info *elf, ...@@ -861,24 +861,23 @@ static void check_section(const char *modname, struct elf_info *elf,
#define ALL_INIT_DATA_SECTIONS \ #define ALL_INIT_DATA_SECTIONS \
".init.setup$", ".init.rodata$", \ ".init.setup$", ".init.rodata$", ".meminit.rodata$", \
".cpuinit.rodata$", ".meminit.rodata$", \ ".init.data$", ".meminit.data$"
".init.data$", ".cpuinit.data$", ".meminit.data$"
#define ALL_EXIT_DATA_SECTIONS \ #define ALL_EXIT_DATA_SECTIONS \
".exit.data$", ".cpuexit.data$", ".memexit.data$" ".exit.data$", ".memexit.data$"
#define ALL_INIT_TEXT_SECTIONS \ #define ALL_INIT_TEXT_SECTIONS \
".init.text$", ".cpuinit.text$", ".meminit.text$" ".init.text$", ".meminit.text$"
#define ALL_EXIT_TEXT_SECTIONS \ #define ALL_EXIT_TEXT_SECTIONS \
".exit.text$", ".cpuexit.text$", ".memexit.text$" ".exit.text$", ".memexit.text$"
#define ALL_PCI_INIT_SECTIONS \ #define ALL_PCI_INIT_SECTIONS \
".pci_fixup_early$", ".pci_fixup_header$", ".pci_fixup_final$", \ ".pci_fixup_early$", ".pci_fixup_header$", ".pci_fixup_final$", \
".pci_fixup_enable$", ".pci_fixup_resume$", \ ".pci_fixup_enable$", ".pci_fixup_resume$", \
".pci_fixup_resume_early$", ".pci_fixup_suspend$" ".pci_fixup_resume_early$", ".pci_fixup_suspend$"
#define ALL_XXXINIT_SECTIONS CPU_INIT_SECTIONS, MEM_INIT_SECTIONS #define ALL_XXXINIT_SECTIONS MEM_INIT_SECTIONS
#define ALL_XXXEXIT_SECTIONS CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS #define ALL_XXXEXIT_SECTIONS MEM_EXIT_SECTIONS
#define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS #define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS
#define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS #define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS
...@@ -887,11 +886,9 @@ static void check_section(const char *modname, struct elf_info *elf, ...@@ -887,11 +886,9 @@ static void check_section(const char *modname, struct elf_info *elf,
#define TEXT_SECTIONS ".text$", ".text.unlikely$" #define TEXT_SECTIONS ".text$", ".text.unlikely$"
#define INIT_SECTIONS ".init.*" #define INIT_SECTIONS ".init.*"
#define CPU_INIT_SECTIONS ".cpuinit.*"
#define MEM_INIT_SECTIONS ".meminit.*" #define MEM_INIT_SECTIONS ".meminit.*"
#define EXIT_SECTIONS ".exit.*" #define EXIT_SECTIONS ".exit.*"
#define CPU_EXIT_SECTIONS ".cpuexit.*"
#define MEM_EXIT_SECTIONS ".memexit.*" #define MEM_EXIT_SECTIONS ".memexit.*"
/* init data sections */ /* init data sections */
...@@ -979,48 +976,20 @@ const struct sectioncheck sectioncheck[] = { ...@@ -979,48 +976,20 @@ const struct sectioncheck sectioncheck[] = {
.mismatch = DATA_TO_ANY_EXIT, .mismatch = DATA_TO_ANY_EXIT,
.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
}, },
/* Do not reference init code/data from cpuinit/meminit code/data */ /* Do not reference init code/data from meminit code/data */
{ {
.fromsec = { ALL_XXXINIT_SECTIONS, NULL }, .fromsec = { ALL_XXXINIT_SECTIONS, NULL },
.tosec = { INIT_SECTIONS, NULL }, .tosec = { INIT_SECTIONS, NULL },
.mismatch = XXXINIT_TO_SOME_INIT, .mismatch = XXXINIT_TO_SOME_INIT,
.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
}, },
/* Do not reference cpuinit code/data from meminit code/data */ /* Do not reference exit code/data from memexit code/data */
{
.fromsec = { MEM_INIT_SECTIONS, NULL },
.tosec = { CPU_INIT_SECTIONS, NULL },
.mismatch = XXXINIT_TO_SOME_INIT,
.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
},
/* Do not reference meminit code/data from cpuinit code/data */
{
.fromsec = { CPU_INIT_SECTIONS, NULL },
.tosec = { MEM_INIT_SECTIONS, NULL },
.mismatch = XXXINIT_TO_SOME_INIT,
.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
},
/* Do not reference exit code/data from cpuexit/memexit code/data */
{ {
.fromsec = { ALL_XXXEXIT_SECTIONS, NULL }, .fromsec = { ALL_XXXEXIT_SECTIONS, NULL },
.tosec = { EXIT_SECTIONS, NULL }, .tosec = { EXIT_SECTIONS, NULL },
.mismatch = XXXEXIT_TO_SOME_EXIT, .mismatch = XXXEXIT_TO_SOME_EXIT,
.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
}, },
/* Do not reference cpuexit code/data from memexit code/data */
{
.fromsec = { MEM_EXIT_SECTIONS, NULL },
.tosec = { CPU_EXIT_SECTIONS, NULL },
.mismatch = XXXEXIT_TO_SOME_EXIT,
.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
},
/* Do not reference memexit code/data from cpuexit code/data */
{
.fromsec = { CPU_EXIT_SECTIONS, NULL },
.tosec = { MEM_EXIT_SECTIONS, NULL },
.mismatch = XXXEXIT_TO_SOME_EXIT,
.symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
},
/* Do not use exit code/data from init code */ /* Do not use exit code/data from init code */
{ {
.fromsec = { ALL_INIT_SECTIONS, NULL }, .fromsec = { ALL_INIT_SECTIONS, NULL },
...@@ -1089,8 +1058,6 @@ static const struct sectioncheck *section_mismatch( ...@@ -1089,8 +1058,6 @@ static const struct sectioncheck *section_mismatch(
* Pattern 2: * Pattern 2:
* Many drivers utilise a *driver container with references to * Many drivers utilise a *driver container with references to
* add, remove, probe functions etc. * add, remove, probe functions etc.
* These functions may often be marked __cpuinit and we do not want to
* warn here.
* the pattern is identified by: * the pattern is identified by:
* tosec = init or exit section * tosec = init or exit section
* fromsec = data section * fromsec = data section
...@@ -1249,7 +1216,6 @@ static Elf_Sym *find_elf_symbol2(struct elf_info *elf, Elf_Addr addr, ...@@ -1249,7 +1216,6 @@ static Elf_Sym *find_elf_symbol2(struct elf_info *elf, Elf_Addr addr,
/* /*
* Convert a section name to the function/data attribute * Convert a section name to the function/data attribute
* .init.text => __init * .init.text => __init
* .cpuinit.data => __cpudata
* .memexitconst => __memconst * .memexitconst => __memconst
* etc. * etc.
* *
......
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