summaryrefslogtreecommitdiffstats
path: root/debian/patches
diff options
context:
space:
mode:
authorBen Hutchings <benh@debian.org>2022-03-06 01:28:39 +0100
committerBen Hutchings <benh@debian.org>2022-03-06 01:28:39 +0100
commit6147a29a5864eee9dfba7cb7d813a11bebf6989b (patch)
tree47dc5d8c60aafcb0b051d2f6277815036eddfa97 /debian/patches
parent0d3c81328fbb3b21aa1d4b10c2aada6c7e0688d9 (diff)
parent21fdfc606454d791d6c5cd9314c65beb22f7dd81 (diff)
downloadlinux-debian-6147a29a5864eee9dfba7cb7d813a11bebf6989b.tar.gz
Merge branch 'ci-abi-stability' into sid
module: Avoid ABI changes when debug info is disabled See merge request kernel-team/linux!452
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/debian/module-avoid-abi-changes-when-debug-info-is-disabled.patch92
-rw-r--r--debian/patches/series1
2 files changed, 93 insertions, 0 deletions
diff --git a/debian/patches/debian/module-avoid-abi-changes-when-debug-info-is-disabled.patch b/debian/patches/debian/module-avoid-abi-changes-when-debug-info-is-disabled.patch
new file mode 100644
index 000000000..4cd5eb648
--- /dev/null
+++ b/debian/patches/debian/module-avoid-abi-changes-when-debug-info-is-disabled.patch
@@ -0,0 +1,92 @@
+From: Ben Hutchings <benh@debian.org>
+Date: Wed, 02 Mar 2022 21:22:28 +0100
+Subject: module: Avoid ABI changes when debug info is disabled
+Forwarded: not-needed
+
+CI builds are done with debug info disabled, but this removes some
+members from struct module and replaces some BTF-related exports with
+static definitions. This causes builds to fail if there is an ABI
+reference for the current ABI.
+
+- Add a new config symbol DEBUG_INFO_BTF_MODULES_NOOP which can be
+ enabled when DEBUG_INFO is not enabled
+- When the symbol is enabled:
+ - Define the BTF-related members of struct module
+ - Export the no-op definitions of BTF-related functions
+ - Define and export the same BTF-related static lists
+
+---
+--- a/include/linux/module.h
++++ b/include/linux/module.h
+@@ -470,7 +470,7 @@ struct module {
+ unsigned int num_bpf_raw_events;
+ struct bpf_raw_event_map *bpf_raw_events;
+ #endif
+-#ifdef CONFIG_DEBUG_INFO_BTF_MODULES
++#if defined(CONFIG_DEBUG_INFO_BTF_MODULES) || defined(CONFIG_DEBUG_INFO_BTF_MODULES_NOOP)
+ unsigned int btf_data_size;
+ void *btf_data;
+ #endif
+--- a/include/linux/btf.h
++++ b/include/linux/btf.h
+@@ -250,7 +250,7 @@ struct kfunc_btf_id_list {
+ struct mutex mutex;
+ };
+
+-#ifdef CONFIG_DEBUG_INFO_BTF_MODULES
++#if defined(CONFIG_DEBUG_INFO_BTF_MODULES) || defined(CONFIG_DEBUG_INFO_BTF_MODULES_NOOP)
+ void register_kfunc_btf_id_set(struct kfunc_btf_id_list *l,
+ struct kfunc_btf_id_set *s);
+ void unregister_kfunc_btf_id_set(struct kfunc_btf_id_list *l,
+--- a/kernel/bpf/btf.c
++++ b/kernel/bpf/btf.c
+@@ -6383,6 +6383,30 @@ bool bpf_check_mod_kfunc_call(struct kfu
+ return false;
+ }
+
++#elif defined(CONFIG_DEBUG_INFO_BTF_MODULES_NOOP)
++
++void register_kfunc_btf_id_set(struct kfunc_btf_id_list *l,
++ struct kfunc_btf_id_set *s)
++{
++}
++EXPORT_SYMBOL_GPL(register_kfunc_btf_id_set);
++
++void unregister_kfunc_btf_id_set(struct kfunc_btf_id_list *l,
++ struct kfunc_btf_id_set *s)
++{
++}
++EXPORT_SYMBOL_GPL(unregister_kfunc_btf_id_set);
++
++bool bpf_check_mod_kfunc_call(struct kfunc_btf_id_list *klist, u32 kfunc_id,
++ struct module *owner)
++{
++ return false;
++}
++
++#endif /* CONFIG_DEBUG_INFO_BTF_MODULES */
++
++#if defined(CONFIG_DEBUG_INFO_BTF_MODULES) || defined(CONFIG_DEBUG_INFO_BTF_MODULES_NOOP)
++
+ #define DEFINE_KFUNC_BTF_ID_LIST(name) \
+ struct kfunc_btf_id_list name = { LIST_HEAD_INIT(name.list), \
+ __MUTEX_INITIALIZER(name.mutex) }; \
+--- a/lib/Kconfig.debug
++++ b/lib/Kconfig.debug
+@@ -343,6 +343,16 @@ config GDB_SCRIPTS
+
+ endif # DEBUG_INFO
+
++if !DEBUG_INFO
++
++config DEBUG_INFO_BTF_MODULES_NOOP
++ bool "Provide no-op BTF ABI to modules"
++ help
++ Enable this option instead of DEBUG_INFO_BTF to avoid an ABI
++ change when debug info is disabled.
++
++endif
++
+ config FRAME_WARN
+ int "Warn for stack frames larger than"
+ range 0 8192
diff --git a/debian/patches/series b/debian/patches/series
index a00146250..0bc1f9c99 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -26,6 +26,7 @@ debian/documentation-drop-sphinx-version-check.patch
debian/perf-traceevent-support-asciidoctor-for-documentatio.patch
debian/kbuild-look-for-module.lds-under-arch-directory-too.patch
debian/kbuild-abort-build-if-subdirs-used.patch
+debian/module-avoid-abi-changes-when-debug-info-is-disabled.patch
# Fixes/improvements to firmware loading
features/all/drivers-media-dvb-usb-af9005-request_firmware.patch