From f8ae0e3a3c42ced0520073210e7a1ad504ec5e56 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 20 Feb 2024 08:44:11 +0100 Subject: [PATCH] 6.6-stable patches added patches: linux-init-remove-__memexit-annotations.patch --- ...ux-init-remove-__memexit-annotations.patch | 135 ++++++++++++++++++ ...-.ltext-and-.ltext.-to-text_sections.patch | 2 +- queue-6.6/series | 1 + 3 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 queue-6.6/linux-init-remove-__memexit-annotations.patch diff --git a/queue-6.6/linux-init-remove-__memexit-annotations.patch b/queue-6.6/linux-init-remove-__memexit-annotations.patch new file mode 100644 index 00000000000..68d1f8f2857 --- /dev/null +++ b/queue-6.6/linux-init-remove-__memexit-annotations.patch @@ -0,0 +1,135 @@ +From 6a4e59eeedc3018cb57722eecfcbb49431aeb05f Mon Sep 17 00:00:00 2001 +From: Masahiro Yamada +Date: Mon, 23 Oct 2023 02:06:05 +0900 +Subject: linux/init: remove __memexit* annotations + +From: Masahiro Yamada + +commit 6a4e59eeedc3018cb57722eecfcbb49431aeb05f upstream. + +We have never used __memexit, __memexitdata, or __memexitconst. + +These were unneeded. + +Signed-off-by: Masahiro Yamada +Acked-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman +--- + include/asm-generic/vmlinux.lds.h | 6 ------ + include/linux/init.h | 3 --- + scripts/mod/modpost.c | 15 +++------------ + 3 files changed, 3 insertions(+), 21 deletions(-) + +--- a/include/asm-generic/vmlinux.lds.h ++++ b/include/asm-generic/vmlinux.lds.h +@@ -356,7 +356,6 @@ + *(.ref.data) \ + *(.data..shared_aligned) /* percpu related */ \ + MEM_KEEP(init.data*) \ +- MEM_KEEP(exit.data*) \ + *(.data.unlikely) \ + __start_once = .; \ + *(.data.once) \ +@@ -521,7 +520,6 @@ + __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \ + *(.ref.rodata) \ + MEM_KEEP(init.rodata) \ +- MEM_KEEP(exit.rodata) \ + } \ + \ + /* Built-in module parameters. */ \ +@@ -574,7 +572,6 @@ + *(.ref.text) \ + *(.text.asan.* .text.tsan.*) \ + MEM_KEEP(init.text*) \ +- MEM_KEEP(exit.text*) \ + + + /* sched.text is aling to function alignment to secure we have same +@@ -714,13 +711,10 @@ + *(.exit.data .exit.data.*) \ + *(.fini_array .fini_array.*) \ + *(.dtors .dtors.*) \ +- MEM_DISCARD(exit.data*) \ +- MEM_DISCARD(exit.rodata*) + + #define EXIT_TEXT \ + *(.exit.text) \ + *(.text.exit) \ +- MEM_DISCARD(exit.text) + + #define EXIT_CALL \ + *(.exitcall.exit) +--- a/include/linux/init.h ++++ b/include/linux/init.h +@@ -89,9 +89,6 @@ + __latent_entropy + #define __meminitdata __section(".meminit.data") + #define __meminitconst __section(".meminit.rodata") +-#define __memexit __section(".memexit.text") __exitused __cold notrace +-#define __memexitdata __section(".memexit.data") +-#define __memexitconst __section(".memexit.rodata") + + /* For assembly routines */ + #define __HEAD .section ".head.text","ax" +--- a/scripts/mod/modpost.c ++++ b/scripts/mod/modpost.c +@@ -798,7 +798,7 @@ static void check_section(const char *mo + #define ALL_INIT_TEXT_SECTIONS \ + ".init.text", ".meminit.text" + #define ALL_EXIT_TEXT_SECTIONS \ +- ".exit.text", ".memexit.text" ++ ".exit.text" + + #define ALL_PCI_INIT_SECTIONS \ + ".pci_fixup_early", ".pci_fixup_header", ".pci_fixup_final", \ +@@ -806,10 +806,9 @@ static void check_section(const char *mo + ".pci_fixup_resume_early", ".pci_fixup_suspend" + + #define ALL_XXXINIT_SECTIONS MEM_INIT_SECTIONS +-#define ALL_XXXEXIT_SECTIONS MEM_EXIT_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 + + #define DATA_SECTIONS ".data", ".data.rel" + #define TEXT_SECTIONS ".text", ".text.*", ".sched.text", \ +@@ -822,7 +821,6 @@ static void check_section(const char *mo + #define MEM_INIT_SECTIONS ".meminit.*" + + #define EXIT_SECTIONS ".exit.*" +-#define MEM_EXIT_SECTIONS ".memexit.*" + + #define ALL_TEXT_SECTIONS ALL_INIT_TEXT_SECTIONS, ALL_EXIT_TEXT_SECTIONS, \ + TEXT_SECTIONS, OTHER_TEXT_SECTIONS +@@ -832,7 +830,6 @@ enum mismatch { + DATA_TO_ANY_INIT, + TEXTDATA_TO_ANY_EXIT, + XXXINIT_TO_SOME_INIT, +- XXXEXIT_TO_SOME_EXIT, + ANY_INIT_TO_ANY_EXIT, + ANY_EXIT_TO_ANY_INIT, + EXTABLE_TO_NON_TEXT, +@@ -883,12 +880,6 @@ static const struct sectioncheck section + .bad_tosec = { INIT_SECTIONS, NULL }, + .mismatch = XXXINIT_TO_SOME_INIT, + }, +-/* Do not reference exit code/data from memexit code/data */ +-{ +- .fromsec = { ALL_XXXEXIT_SECTIONS, NULL }, +- .bad_tosec = { EXIT_SECTIONS, NULL }, +- .mismatch = XXXEXIT_TO_SOME_EXIT, +-}, + /* Do not use exit code/data from init code */ + { + .fromsec = { ALL_INIT_SECTIONS, NULL }, +@@ -1017,7 +1008,7 @@ static int secref_whitelist(const char * + + /* symbols in data sections that may refer to meminit sections */ + if (match(fromsec, PATTERNS(DATA_SECTIONS)) && +- match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS, ALL_XXXEXIT_SECTIONS)) && ++ match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS)) && + match(fromsym, PATTERNS("*driver"))) + return 0; + diff --git a/queue-6.6/modpost-add-.ltext-and-.ltext.-to-text_sections.patch b/queue-6.6/modpost-add-.ltext-and-.ltext.-to-text_sections.patch index 263dbf8cd2b..483a0e9b318 100644 --- a/queue-6.6/modpost-add-.ltext-and-.ltext.-to-text_sections.patch +++ b/queue-6.6/modpost-add-.ltext-and-.ltext.-to-text_sections.patch @@ -38,7 +38,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c -@@ -813,7 +813,8 @@ static void check_section(const char *mo +@@ -812,7 +812,8 @@ static void check_section(const char *mo #define DATA_SECTIONS ".data", ".data.rel" #define TEXT_SECTIONS ".text", ".text.*", ".sched.text", \ diff --git a/queue-6.6/series b/queue-6.6/series index 1b78b5585f3..2690f2bfe91 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -133,6 +133,7 @@ net-stmmac-do-not-clear-tbs-enable-bit-on-link-up-down.patch parisc-btlb-fix-crash-when-setting-up-btlb-at-cpu-bringup.patch xen-netback-properly-sync-tx-responses.patch um-fix-adding-no-pie-for-clang.patch +linux-init-remove-__memexit-annotations.patch modpost-add-.ltext-and-.ltext.-to-text_sections.patch alsa-hda-realtek-enable-headset-mic-on-vaio-vjfe-adl.patch alsa-hda-realtek-add-speaker-pin-verbtable-for-dell-dual-speaker-platform.patch -- 2.47.3