Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+18 -65
-12
include/asm-generic/vmlinux.lds.h
··· 174 174 *(.data) \ 175 175 *(.ref.data) \ 176 176 *(.data..shared_aligned) /* percpu related */ \ 177 - CPU_KEEP(init.data) \ 178 - CPU_KEEP(exit.data) \ 179 177 MEM_KEEP(init.data) \ 180 178 MEM_KEEP(exit.data) \ 181 179 *(.data.unlikely) \ ··· 353 355 /* __*init sections */ \ 354 356 __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \ 355 357 *(.ref.rodata) \ 356 - CPU_KEEP(init.rodata) \ 357 - CPU_KEEP(exit.rodata) \ 358 358 MEM_KEEP(init.rodata) \ 359 359 MEM_KEEP(exit.rodata) \ 360 360 } \ ··· 393 397 *(.text.hot) \ 394 398 *(.text) \ 395 399 *(.ref.text) \ 396 - CPU_KEEP(init.text) \ 397 - CPU_KEEP(exit.text) \ 398 400 MEM_KEEP(init.text) \ 399 401 MEM_KEEP(exit.text) \ 400 402 *(.text.unlikely) ··· 476 482 /* init and exit section handling */ 477 483 #define INIT_DATA \ 478 484 *(.init.data) \ 479 - CPU_DISCARD(init.data) \ 480 485 MEM_DISCARD(init.data) \ 481 486 KERNEL_CTORS() \ 482 487 MCOUNT_REC() \ 483 488 *(.init.rodata) \ 484 489 FTRACE_EVENTS() \ 485 490 TRACE_SYSCALLS() \ 486 - CPU_DISCARD(init.rodata) \ 487 491 MEM_DISCARD(init.rodata) \ 488 492 CLK_OF_TABLES() \ 489 493 CLKSRC_OF_TABLES() \ ··· 490 498 491 499 #define INIT_TEXT \ 492 500 *(.init.text) \ 493 - CPU_DISCARD(init.text) \ 494 501 MEM_DISCARD(init.text) 495 502 496 503 #define EXIT_DATA \ 497 504 *(.exit.data) \ 498 - CPU_DISCARD(exit.data) \ 499 - CPU_DISCARD(exit.rodata) \ 500 505 MEM_DISCARD(exit.data) \ 501 506 MEM_DISCARD(exit.rodata) 502 507 503 508 #define EXIT_TEXT \ 504 509 *(.exit.text) \ 505 - CPU_DISCARD(exit.text) \ 506 510 MEM_DISCARD(exit.text) 507 511 508 512 #define EXIT_CALL \
+9 -10
include/linux/init.h
··· 93 93 94 94 #define __exit __section(.exit.text) __exitused __cold notrace 95 95 96 - /* Used for HOTPLUG_CPU */ 97 - #define __cpuinit __section(.cpuinit.text) __cold notrace 98 - #define __cpuinitdata __section(.cpuinit.data) 99 - #define __cpuinitconst __constsection(.cpuinit.rodata) 100 - #define __cpuexit __section(.cpuexit.text) __exitused __cold notrace 101 - #define __cpuexitdata __section(.cpuexit.data) 102 - #define __cpuexitconst __constsection(.cpuexit.rodata) 96 + /* temporary, until all users are removed */ 97 + #define __cpuinit 98 + #define __cpuinitdata 99 + #define __cpuinitconst 100 + #define __cpuexit 101 + #define __cpuexitdata 102 + #define __cpuexitconst 103 103 104 104 /* Used for MEMORY_HOTPLUG */ 105 105 #define __meminit __section(.meminit.text) __cold notrace ··· 118 118 #define __INITRODATA .section ".init.rodata","a",%progbits 119 119 #define __FINITDATA .previous 120 120 121 - #define __CPUINIT .section ".cpuinit.text", "ax" 122 - #define __CPUINITDATA .section ".cpuinit.data", "aw" 123 - #define __CPUINITRODATA .section ".cpuinit.rodata", "a" 121 + /* temporary, until all users are removed */ 122 + #define __CPUINIT 124 123 125 124 #define __MEMINIT .section ".meminit.text", "ax" 126 125 #define __MEMINITDATA .section ".meminit.data", "aw"
+9 -43
scripts/mod/modpost.c
··· 861 861 862 862 863 863 #define ALL_INIT_DATA_SECTIONS \ 864 - ".init.setup$", ".init.rodata$", \ 865 - ".cpuinit.rodata$", ".meminit.rodata$", \ 866 - ".init.data$", ".cpuinit.data$", ".meminit.data$" 864 + ".init.setup$", ".init.rodata$", ".meminit.rodata$", \ 865 + ".init.data$", ".meminit.data$" 867 866 #define ALL_EXIT_DATA_SECTIONS \ 868 - ".exit.data$", ".cpuexit.data$", ".memexit.data$" 867 + ".exit.data$", ".memexit.data$" 869 868 870 869 #define ALL_INIT_TEXT_SECTIONS \ 871 - ".init.text$", ".cpuinit.text$", ".meminit.text$" 870 + ".init.text$", ".meminit.text$" 872 871 #define ALL_EXIT_TEXT_SECTIONS \ 873 - ".exit.text$", ".cpuexit.text$", ".memexit.text$" 872 + ".exit.text$", ".memexit.text$" 874 873 875 874 #define ALL_PCI_INIT_SECTIONS \ 876 875 ".pci_fixup_early$", ".pci_fixup_header$", ".pci_fixup_final$", \ 877 876 ".pci_fixup_enable$", ".pci_fixup_resume$", \ 878 877 ".pci_fixup_resume_early$", ".pci_fixup_suspend$" 879 878 880 - #define ALL_XXXINIT_SECTIONS CPU_INIT_SECTIONS, MEM_INIT_SECTIONS 881 - #define ALL_XXXEXIT_SECTIONS CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS 879 + #define ALL_XXXINIT_SECTIONS MEM_INIT_SECTIONS 880 + #define ALL_XXXEXIT_SECTIONS MEM_EXIT_SECTIONS 882 881 883 882 #define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS 884 883 #define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS ··· 886 887 #define TEXT_SECTIONS ".text$", ".text.unlikely$" 887 888 888 889 #define INIT_SECTIONS ".init.*" 889 - #define CPU_INIT_SECTIONS ".cpuinit.*" 890 890 #define MEM_INIT_SECTIONS ".meminit.*" 891 891 892 892 #define EXIT_SECTIONS ".exit.*" 893 - #define CPU_EXIT_SECTIONS ".cpuexit.*" 894 893 #define MEM_EXIT_SECTIONS ".memexit.*" 895 894 896 895 /* init data sections */ ··· 976 979 .mismatch = DATA_TO_ANY_EXIT, 977 980 .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, 978 981 }, 979 - /* Do not reference init code/data from cpuinit/meminit code/data */ 982 + /* Do not reference init code/data from meminit code/data */ 980 983 { 981 984 .fromsec = { ALL_XXXINIT_SECTIONS, NULL }, 982 985 .tosec = { INIT_SECTIONS, NULL }, 983 986 .mismatch = XXXINIT_TO_SOME_INIT, 984 987 .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, 985 988 }, 986 - /* Do not reference cpuinit code/data from meminit code/data */ 987 - { 988 - .fromsec = { MEM_INIT_SECTIONS, NULL }, 989 - .tosec = { CPU_INIT_SECTIONS, NULL }, 990 - .mismatch = XXXINIT_TO_SOME_INIT, 991 - .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, 992 - }, 993 - /* Do not reference meminit code/data from cpuinit code/data */ 994 - { 995 - .fromsec = { CPU_INIT_SECTIONS, NULL }, 996 - .tosec = { MEM_INIT_SECTIONS, NULL }, 997 - .mismatch = XXXINIT_TO_SOME_INIT, 998 - .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, 999 - }, 1000 - /* Do not reference exit code/data from cpuexit/memexit code/data */ 989 + /* Do not reference exit code/data from memexit code/data */ 1001 990 { 1002 991 .fromsec = { ALL_XXXEXIT_SECTIONS, NULL }, 1003 992 .tosec = { EXIT_SECTIONS, NULL }, 1004 - .mismatch = XXXEXIT_TO_SOME_EXIT, 1005 - .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, 1006 - }, 1007 - /* Do not reference cpuexit code/data from memexit code/data */ 1008 - { 1009 - .fromsec = { MEM_EXIT_SECTIONS, NULL }, 1010 - .tosec = { CPU_EXIT_SECTIONS, NULL }, 1011 - .mismatch = XXXEXIT_TO_SOME_EXIT, 1012 - .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, 1013 - }, 1014 - /* Do not reference memexit code/data from cpuexit code/data */ 1015 - { 1016 - .fromsec = { CPU_EXIT_SECTIONS, NULL }, 1017 - .tosec = { MEM_EXIT_SECTIONS, NULL }, 1018 993 .mismatch = XXXEXIT_TO_SOME_EXIT, 1019 994 .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, 1020 995 }, ··· 1058 1089 * Pattern 2: 1059 1090 * Many drivers utilise a *driver container with references to 1060 1091 * add, remove, probe functions etc. 1061 - * These functions may often be marked __cpuinit and we do not want to 1062 - * warn here. 1063 1092 * the pattern is identified by: 1064 1093 * tosec = init or exit section 1065 1094 * fromsec = data section ··· 1216 1249 /* 1217 1250 * Convert a section name to the function/data attribute 1218 1251 * .init.text => __init 1219 - * .cpuinit.data => __cpudata 1220 1252 * .memexitconst => __memconst 1221 1253 * etc. 1222 1254 *