diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-07 14:01:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-07 14:01:19 -0400 |
commit | 8dce5f3dee21bf976193ddb06426b9727cf5d1a2 (patch) | |
tree | a2e44ee8cc3283b258ff05ad9a5065a5fc2b39ac | |
parent | 21884a83b2192a00885d7244a1dda32debd2fbc7 (diff) | |
parent | e24f6628811e2d4531b443684b598f7050932012 (diff) |
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
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 12 | ||||
-rw-r--r-- | include/linux/init.h | 19 | ||||
-rw-r--r-- | scripts/mod/modpost.c | 52 |
3 files changed, 18 insertions, 65 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index c74d88baea60..69732d279e8b 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -174,8 +174,6 @@ | |||
174 | *(.data) \ | 174 | *(.data) \ |
175 | *(.ref.data) \ | 175 | *(.ref.data) \ |
176 | *(.data..shared_aligned) /* percpu related */ \ | 176 | *(.data..shared_aligned) /* percpu related */ \ |
177 | CPU_KEEP(init.data) \ | ||
178 | CPU_KEEP(exit.data) \ | ||
179 | MEM_KEEP(init.data) \ | 177 | MEM_KEEP(init.data) \ |
180 | MEM_KEEP(exit.data) \ | 178 | MEM_KEEP(exit.data) \ |
181 | *(.data.unlikely) \ | 179 | *(.data.unlikely) \ |
@@ -355,8 +353,6 @@ | |||
355 | /* __*init sections */ \ | 353 | /* __*init sections */ \ |
356 | __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \ | 354 | __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \ |
357 | *(.ref.rodata) \ | 355 | *(.ref.rodata) \ |
358 | CPU_KEEP(init.rodata) \ | ||
359 | CPU_KEEP(exit.rodata) \ | ||
360 | MEM_KEEP(init.rodata) \ | 356 | MEM_KEEP(init.rodata) \ |
361 | MEM_KEEP(exit.rodata) \ | 357 | MEM_KEEP(exit.rodata) \ |
362 | } \ | 358 | } \ |
@@ -397,8 +393,6 @@ | |||
397 | *(.text.hot) \ | 393 | *(.text.hot) \ |
398 | *(.text) \ | 394 | *(.text) \ |
399 | *(.ref.text) \ | 395 | *(.ref.text) \ |
400 | CPU_KEEP(init.text) \ | ||
401 | CPU_KEEP(exit.text) \ | ||
402 | MEM_KEEP(init.text) \ | 396 | MEM_KEEP(init.text) \ |
403 | MEM_KEEP(exit.text) \ | 397 | MEM_KEEP(exit.text) \ |
404 | *(.text.unlikely) | 398 | *(.text.unlikely) |
@@ -482,14 +476,12 @@ | |||
482 | /* init and exit section handling */ | 476 | /* init and exit section handling */ |
483 | #define INIT_DATA \ | 477 | #define INIT_DATA \ |
484 | *(.init.data) \ | 478 | *(.init.data) \ |
485 | CPU_DISCARD(init.data) \ | ||
486 | MEM_DISCARD(init.data) \ | 479 | MEM_DISCARD(init.data) \ |
487 | KERNEL_CTORS() \ | 480 | KERNEL_CTORS() \ |
488 | MCOUNT_REC() \ | 481 | MCOUNT_REC() \ |
489 | *(.init.rodata) \ | 482 | *(.init.rodata) \ |
490 | FTRACE_EVENTS() \ | 483 | FTRACE_EVENTS() \ |
491 | TRACE_SYSCALLS() \ | 484 | TRACE_SYSCALLS() \ |
492 | CPU_DISCARD(init.rodata) \ | ||
493 | MEM_DISCARD(init.rodata) \ | 485 | MEM_DISCARD(init.rodata) \ |
494 | CLK_OF_TABLES() \ | 486 | CLK_OF_TABLES() \ |
495 | CLKSRC_OF_TABLES() \ | 487 | CLKSRC_OF_TABLES() \ |
@@ -498,19 +490,15 @@ | |||
498 | 490 | ||
499 | #define INIT_TEXT \ | 491 | #define INIT_TEXT \ |
500 | *(.init.text) \ | 492 | *(.init.text) \ |
501 | CPU_DISCARD(init.text) \ | ||
502 | MEM_DISCARD(init.text) | 493 | MEM_DISCARD(init.text) |
503 | 494 | ||
504 | #define EXIT_DATA \ | 495 | #define EXIT_DATA \ |
505 | *(.exit.data) \ | 496 | *(.exit.data) \ |
506 | CPU_DISCARD(exit.data) \ | ||
507 | CPU_DISCARD(exit.rodata) \ | ||
508 | MEM_DISCARD(exit.data) \ | 497 | MEM_DISCARD(exit.data) \ |
509 | MEM_DISCARD(exit.rodata) | 498 | MEM_DISCARD(exit.rodata) |
510 | 499 | ||
511 | #define EXIT_TEXT \ | 500 | #define EXIT_TEXT \ |
512 | *(.exit.text) \ | 501 | *(.exit.text) \ |
513 | CPU_DISCARD(exit.text) \ | ||
514 | MEM_DISCARD(exit.text) | 502 | MEM_DISCARD(exit.text) |
515 | 503 | ||
516 | #define EXIT_CALL \ | 504 | #define EXIT_CALL \ |
diff --git a/include/linux/init.h b/include/linux/init.h index 861814710d52..e73f2b708525 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -93,13 +93,13 @@ | |||
93 | 93 | ||
94 | #define __exit __section(.exit.text) __exitused __cold notrace | 94 | #define __exit __section(.exit.text) __exitused __cold notrace |
95 | 95 | ||
96 | /* Used for HOTPLUG_CPU */ | 96 | /* temporary, until all users are removed */ |
97 | #define __cpuinit __section(.cpuinit.text) __cold notrace | 97 | #define __cpuinit |
98 | #define __cpuinitdata __section(.cpuinit.data) | 98 | #define __cpuinitdata |
99 | #define __cpuinitconst __constsection(.cpuinit.rodata) | 99 | #define __cpuinitconst |
100 | #define __cpuexit __section(.cpuexit.text) __exitused __cold notrace | 100 | #define __cpuexit |
101 | #define __cpuexitdata __section(.cpuexit.data) | 101 | #define __cpuexitdata |
102 | #define __cpuexitconst __constsection(.cpuexit.rodata) | 102 | #define __cpuexitconst |
103 | 103 | ||
104 | /* Used for MEMORY_HOTPLUG */ | 104 | /* Used for MEMORY_HOTPLUG */ |
105 | #define __meminit __section(.meminit.text) __cold notrace | 105 | #define __meminit __section(.meminit.text) __cold notrace |
@@ -118,9 +118,8 @@ | |||
118 | #define __INITRODATA .section ".init.rodata","a",%progbits | 118 | #define __INITRODATA .section ".init.rodata","a",%progbits |
119 | #define __FINITDATA .previous | 119 | #define __FINITDATA .previous |
120 | 120 | ||
121 | #define __CPUINIT .section ".cpuinit.text", "ax" | 121 | /* temporary, until all users are removed */ |
122 | #define __CPUINITDATA .section ".cpuinit.data", "aw" | 122 | #define __CPUINIT |
123 | #define __CPUINITRODATA .section ".cpuinit.rodata", "a" | ||
124 | 123 | ||
125 | #define __MEMINIT .section ".meminit.text", "ax" | 124 | #define __MEMINIT .section ".meminit.text", "ax" |
126 | #define __MEMINITDATA .section ".meminit.data", "aw" | 125 | #define __MEMINITDATA .section ".meminit.data", "aw" |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 3d155dd27eb6..62164348ecf7 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -861,24 +861,23 @@ static void check_section(const char *modname, struct elf_info *elf, | |||
861 | 861 | ||
862 | 862 | ||
863 | #define ALL_INIT_DATA_SECTIONS \ | 863 | #define ALL_INIT_DATA_SECTIONS \ |
864 | ".init.setup$", ".init.rodata$", \ | 864 | ".init.setup$", ".init.rodata$", ".meminit.rodata$", \ |
865 | ".cpuinit.rodata$", ".meminit.rodata$", \ | 865 | ".init.data$", ".meminit.data$" |
866 | ".init.data$", ".cpuinit.data$", ".meminit.data$" | ||
867 | #define ALL_EXIT_DATA_SECTIONS \ | 866 | #define ALL_EXIT_DATA_SECTIONS \ |
868 | ".exit.data$", ".cpuexit.data$", ".memexit.data$" | 867 | ".exit.data$", ".memexit.data$" |
869 | 868 | ||
870 | #define ALL_INIT_TEXT_SECTIONS \ | 869 | #define ALL_INIT_TEXT_SECTIONS \ |
871 | ".init.text$", ".cpuinit.text$", ".meminit.text$" | 870 | ".init.text$", ".meminit.text$" |
872 | #define ALL_EXIT_TEXT_SECTIONS \ | 871 | #define ALL_EXIT_TEXT_SECTIONS \ |
873 | ".exit.text$", ".cpuexit.text$", ".memexit.text$" | 872 | ".exit.text$", ".memexit.text$" |
874 | 873 | ||
875 | #define ALL_PCI_INIT_SECTIONS \ | 874 | #define ALL_PCI_INIT_SECTIONS \ |
876 | ".pci_fixup_early$", ".pci_fixup_header$", ".pci_fixup_final$", \ | 875 | ".pci_fixup_early$", ".pci_fixup_header$", ".pci_fixup_final$", \ |
877 | ".pci_fixup_enable$", ".pci_fixup_resume$", \ | 876 | ".pci_fixup_enable$", ".pci_fixup_resume$", \ |
878 | ".pci_fixup_resume_early$", ".pci_fixup_suspend$" | 877 | ".pci_fixup_resume_early$", ".pci_fixup_suspend$" |
879 | 878 | ||
880 | #define ALL_XXXINIT_SECTIONS CPU_INIT_SECTIONS, MEM_INIT_SECTIONS | 879 | #define ALL_XXXINIT_SECTIONS MEM_INIT_SECTIONS |
881 | #define ALL_XXXEXIT_SECTIONS CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS | 880 | #define ALL_XXXEXIT_SECTIONS MEM_EXIT_SECTIONS |
882 | 881 | ||
883 | #define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS | 882 | #define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS |
884 | #define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS | 883 | #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 | #define TEXT_SECTIONS ".text$", ".text.unlikely$" | 886 | #define TEXT_SECTIONS ".text$", ".text.unlikely$" |
888 | 887 | ||
889 | #define INIT_SECTIONS ".init.*" | 888 | #define INIT_SECTIONS ".init.*" |
890 | #define CPU_INIT_SECTIONS ".cpuinit.*" | ||
891 | #define MEM_INIT_SECTIONS ".meminit.*" | 889 | #define MEM_INIT_SECTIONS ".meminit.*" |
892 | 890 | ||
893 | #define EXIT_SECTIONS ".exit.*" | 891 | #define EXIT_SECTIONS ".exit.*" |
894 | #define CPU_EXIT_SECTIONS ".cpuexit.*" | ||
895 | #define MEM_EXIT_SECTIONS ".memexit.*" | 892 | #define MEM_EXIT_SECTIONS ".memexit.*" |
896 | 893 | ||
897 | /* init data sections */ | 894 | /* init data sections */ |
@@ -979,48 +976,20 @@ const struct sectioncheck sectioncheck[] = { | |||
979 | .mismatch = DATA_TO_ANY_EXIT, | 976 | .mismatch = DATA_TO_ANY_EXIT, |
980 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | 977 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, |
981 | }, | 978 | }, |
982 | /* Do not reference init code/data from cpuinit/meminit code/data */ | 979 | /* Do not reference init code/data from meminit code/data */ |
983 | { | 980 | { |
984 | .fromsec = { ALL_XXXINIT_SECTIONS, NULL }, | 981 | .fromsec = { ALL_XXXINIT_SECTIONS, NULL }, |
985 | .tosec = { INIT_SECTIONS, NULL }, | 982 | .tosec = { INIT_SECTIONS, NULL }, |
986 | .mismatch = XXXINIT_TO_SOME_INIT, | 983 | .mismatch = XXXINIT_TO_SOME_INIT, |
987 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | 984 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, |
988 | }, | 985 | }, |
989 | /* Do not reference cpuinit code/data from meminit code/data */ | 986 | /* Do not reference exit code/data from memexit code/data */ |
990 | { | ||
991 | .fromsec = { MEM_INIT_SECTIONS, NULL }, | ||
992 | .tosec = { CPU_INIT_SECTIONS, NULL }, | ||
993 | .mismatch = XXXINIT_TO_SOME_INIT, | ||
994 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
995 | }, | ||
996 | /* Do not reference meminit code/data from cpuinit code/data */ | ||
997 | { | ||
998 | .fromsec = { CPU_INIT_SECTIONS, NULL }, | ||
999 | .tosec = { MEM_INIT_SECTIONS, NULL }, | ||
1000 | .mismatch = XXXINIT_TO_SOME_INIT, | ||
1001 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
1002 | }, | ||
1003 | /* Do not reference exit code/data from cpuexit/memexit code/data */ | ||
1004 | { | 987 | { |
1005 | .fromsec = { ALL_XXXEXIT_SECTIONS, NULL }, | 988 | .fromsec = { ALL_XXXEXIT_SECTIONS, NULL }, |
1006 | .tosec = { EXIT_SECTIONS, NULL }, | 989 | .tosec = { EXIT_SECTIONS, NULL }, |
1007 | .mismatch = XXXEXIT_TO_SOME_EXIT, | 990 | .mismatch = XXXEXIT_TO_SOME_EXIT, |
1008 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | 991 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, |
1009 | }, | 992 | }, |
1010 | /* Do not reference cpuexit code/data from memexit code/data */ | ||
1011 | { | ||
1012 | .fromsec = { MEM_EXIT_SECTIONS, NULL }, | ||
1013 | .tosec = { CPU_EXIT_SECTIONS, NULL }, | ||
1014 | .mismatch = XXXEXIT_TO_SOME_EXIT, | ||
1015 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
1016 | }, | ||
1017 | /* Do not reference memexit code/data from cpuexit code/data */ | ||
1018 | { | ||
1019 | .fromsec = { CPU_EXIT_SECTIONS, NULL }, | ||
1020 | .tosec = { MEM_EXIT_SECTIONS, NULL }, | ||
1021 | .mismatch = XXXEXIT_TO_SOME_EXIT, | ||
1022 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
1023 | }, | ||
1024 | /* Do not use exit code/data from init code */ | 993 | /* Do not use exit code/data from init code */ |
1025 | { | 994 | { |
1026 | .fromsec = { ALL_INIT_SECTIONS, NULL }, | 995 | .fromsec = { ALL_INIT_SECTIONS, NULL }, |
@@ -1089,8 +1058,6 @@ static const struct sectioncheck *section_mismatch( | |||
1089 | * Pattern 2: | 1058 | * Pattern 2: |
1090 | * Many drivers utilise a *driver container with references to | 1059 | * Many drivers utilise a *driver container with references to |
1091 | * add, remove, probe functions etc. | 1060 | * add, remove, probe functions etc. |
1092 | * These functions may often be marked __cpuinit and we do not want to | ||
1093 | * warn here. | ||
1094 | * the pattern is identified by: | 1061 | * the pattern is identified by: |
1095 | * tosec = init or exit section | 1062 | * tosec = init or exit section |
1096 | * fromsec = data section | 1063 | * fromsec = data section |
@@ -1249,7 +1216,6 @@ static Elf_Sym *find_elf_symbol2(struct elf_info *elf, Elf_Addr addr, | |||
1249 | /* | 1216 | /* |
1250 | * Convert a section name to the function/data attribute | 1217 | * Convert a section name to the function/data attribute |
1251 | * .init.text => __init | 1218 | * .init.text => __init |
1252 | * .cpuinit.data => __cpudata | ||
1253 | * .memexitconst => __memconst | 1219 | * .memexitconst => __memconst |
1254 | * etc. | 1220 | * etc. |
1255 | * | 1221 | * |