From 5dcc777f0cb19d6ef588967a7b29e94831e3339e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 23 Feb 2023 13:37:16 +0100 Subject: [PATCH] 5.15-stable patches added patches: kbuild-add-config_pahole_version.patch lib-kconfig.debug-allow-btf-dwarf5-with-pahole-1.21.patch lib-kconfig.debug-use-config_pahole_version.patch scripts-pahole-flags.sh-use-pahole-version.sh.patch --- .../kbuild-add-config_pahole_version.patch | 70 +++++++++++++++++++ ...ug-allow-btf-dwarf5-with-pahole-1.21.patch | 40 +++++++++++ ...nfig.debug-use-config_pahole_version.patch | 35 ++++++++++ ...ahole-flags.sh-use-pahole-version.sh.patch | 33 +++++++++ queue-5.15/series | 4 ++ 5 files changed, 182 insertions(+) create mode 100644 queue-5.15/kbuild-add-config_pahole_version.patch create mode 100644 queue-5.15/lib-kconfig.debug-allow-btf-dwarf5-with-pahole-1.21.patch create mode 100644 queue-5.15/lib-kconfig.debug-use-config_pahole_version.patch create mode 100644 queue-5.15/scripts-pahole-flags.sh-use-pahole-version.sh.patch diff --git a/queue-5.15/kbuild-add-config_pahole_version.patch b/queue-5.15/kbuild-add-config_pahole_version.patch new file mode 100644 index 00000000000..efd4e934b0e --- /dev/null +++ b/queue-5.15/kbuild-add-config_pahole_version.patch @@ -0,0 +1,70 @@ +From 613fe169237785a4bb1d06397b52606b2967da53 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Tue, 1 Feb 2022 13:56:21 -0700 +Subject: kbuild: Add CONFIG_PAHOLE_VERSION + +From: Nathan Chancellor + +commit 613fe169237785a4bb1d06397b52606b2967da53 upstream. + +There are a few different places where pahole's version is turned into a +three digit form with the exact same command. Move this command into +scripts/pahole-version.sh to reduce the amount of duplication across the +tree. + +Create CONFIG_PAHOLE_VERSION so the version code can be used in Kconfig +to enable and disable configuration options based on the pahole version, +which is already done in a couple of places. + +Signed-off-by: Nathan Chancellor +Signed-off-by: Daniel Borkmann +Acked-by: Andrii Nakryiko +Link: https://lore.kernel.org/bpf/20220201205624.652313-3-nathan@kernel.org +Signed-off-by: Matthias Maennich +Signed-off-by: Greg Kroah-Hartman +--- + MAINTAINERS | 1 + + init/Kconfig | 4 ++++ + scripts/pahole-version.sh | 13 +++++++++++++ + 3 files changed, 18 insertions(+) + create mode 100755 scripts/pahole-version.sh + +--- a/MAINTAINERS ++++ b/MAINTAINERS +@@ -3407,6 +3407,7 @@ F: net/sched/act_bpf.c + F: net/sched/cls_bpf.c + F: samples/bpf/ + F: scripts/bpf_doc.py ++F: scripts/pahole-version.sh + F: tools/bpf/ + F: tools/lib/bpf/ + F: tools/testing/selftests/bpf/ +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -91,6 +91,10 @@ config CC_HAS_ASM_INLINE + config CC_HAS_NO_PROFILE_FN_ATTR + def_bool $(success,echo '__attribute__((no_profile_instrument_function)) int x();' | $(CC) -x c - -c -o /dev/null -Werror) + ++config PAHOLE_VERSION ++ int ++ default $(shell,$(srctree)/scripts/pahole-version.sh $(PAHOLE)) ++ + config CONSTRUCTORS + bool + +--- /dev/null ++++ b/scripts/pahole-version.sh +@@ -0,0 +1,13 @@ ++#!/bin/sh ++# SPDX-License-Identifier: GPL-2.0 ++# ++# Usage: $ ./pahole-version.sh pahole ++# ++# Prints pahole's version in a 3-digit form, such as 119 for v1.19. ++ ++if [ ! -x "$(command -v "$@")" ]; then ++ echo 0 ++ exit 1 ++fi ++ ++"$@" --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/' diff --git a/queue-5.15/lib-kconfig.debug-allow-btf-dwarf5-with-pahole-1.21.patch b/queue-5.15/lib-kconfig.debug-allow-btf-dwarf5-with-pahole-1.21.patch new file mode 100644 index 00000000000..fd42e1f101d --- /dev/null +++ b/queue-5.15/lib-kconfig.debug-allow-btf-dwarf5-with-pahole-1.21.patch @@ -0,0 +1,40 @@ +From 42d9b379e3e1790eafb87c799c9edfd0b37a37c7 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Tue, 1 Feb 2022 13:56:24 -0700 +Subject: lib/Kconfig.debug: Allow BTF + DWARF5 with pahole 1.21+ + +From: Nathan Chancellor + +commit 42d9b379e3e1790eafb87c799c9edfd0b37a37c7 upstream. + +Commit 98cd6f521f10 ("Kconfig: allow explicit opt in to DWARF v5") +prevented CONFIG_DEBUG_INFO_DWARF5 from being selected when +CONFIG_DEBUG_INFO_BTF is enabled because pahole had issues with clang's +DWARF5 info. This was resolved by [1], which is in pahole v1.21. + +Allow DEBUG_INFO_DWARF5 to be selected with DEBUG_INFO_BTF when using +pahole v1.21 or newer. + +[1]: https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?id=7d8e829f636f47aba2e1b6eda57e74d8e31f733c + +Signed-off-by: Nathan Chancellor +Signed-off-by: Daniel Borkmann +Acked-by: Andrii Nakryiko +Link: https://lore.kernel.org/bpf/20220201205624.652313-6-nathan@kernel.org +Signed-off-by: Matthias Maennich +Signed-off-by: Greg Kroah-Hartman +--- + lib/Kconfig.debug | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/Kconfig.debug ++++ b/lib/Kconfig.debug +@@ -302,7 +302,7 @@ config DEBUG_INFO_DWARF4 + config DEBUG_INFO_DWARF5 + bool "Generate DWARF Version 5 debuginfo" + depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_LEB128) +- depends on !DEBUG_INFO_BTF ++ depends on !DEBUG_INFO_BTF || PAHOLE_VERSION >= 121 + help + Generate DWARF v5 debug info. Requires binutils 2.35.2, gcc 5.0+ (gcc + 5.0+ accepts the -gdwarf-5 flag but only had partial support for some diff --git a/queue-5.15/lib-kconfig.debug-use-config_pahole_version.patch b/queue-5.15/lib-kconfig.debug-use-config_pahole_version.patch new file mode 100644 index 00000000000..ecf8629376d --- /dev/null +++ b/queue-5.15/lib-kconfig.debug-use-config_pahole_version.patch @@ -0,0 +1,35 @@ +From 6323c81350b73a4569cf52df85f80273faa64071 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Tue, 1 Feb 2022 13:56:23 -0700 +Subject: lib/Kconfig.debug: Use CONFIG_PAHOLE_VERSION + +From: Nathan Chancellor + +commit 6323c81350b73a4569cf52df85f80273faa64071 upstream. + +Now that CONFIG_PAHOLE_VERSION exists, use it in the definition of +CONFIG_PAHOLE_HAS_SPLIT_BTF and CONFIG_PAHOLE_HAS_BTF_TAG to reduce the +amount of duplication across the tree. + +Signed-off-by: Nathan Chancellor +Signed-off-by: Daniel Borkmann +Acked-by: Andrii Nakryiko +Link: https://lore.kernel.org/bpf/20220201205624.652313-5-nathan@kernel.org +[maennich: omitted patching non-existing config PAHOLE_HAS_BTF_TAG] +Signed-off-by: Matthias Maennich +Signed-off-by: Greg Kroah-Hartman +--- + lib/Kconfig.debug | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/Kconfig.debug ++++ b/lib/Kconfig.debug +@@ -328,7 +328,7 @@ config DEBUG_INFO_BTF + DWARF type info into equivalent deduplicated BTF type info. + + config PAHOLE_HAS_SPLIT_BTF +- def_bool $(success, test `$(PAHOLE) --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/'` -ge "119") ++ def_bool PAHOLE_VERSION >= 119 + + config DEBUG_INFO_BTF_MODULES + def_bool y diff --git a/queue-5.15/scripts-pahole-flags.sh-use-pahole-version.sh.patch b/queue-5.15/scripts-pahole-flags.sh-use-pahole-version.sh.patch new file mode 100644 index 00000000000..d264f292062 --- /dev/null +++ b/queue-5.15/scripts-pahole-flags.sh-use-pahole-version.sh.patch @@ -0,0 +1,33 @@ +From 2d6c9810eb8915c4ddede707b8e167a1d919e1ca Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Tue, 1 Feb 2022 13:56:22 -0700 +Subject: scripts/pahole-flags.sh: Use pahole-version.sh + +From: Nathan Chancellor + +commit 2d6c9810eb8915c4ddede707b8e167a1d919e1ca upstream. + +Use pahole-version.sh to get pahole's version code to reduce the amount +of duplication across the tree. + +Signed-off-by: Nathan Chancellor +Signed-off-by: Daniel Borkmann +Acked-by: Andrii Nakryiko +Link: https://lore.kernel.org/bpf/20220201205624.652313-4-nathan@kernel.org +Signed-off-by: Matthias Maennich +Signed-off-by: Greg Kroah-Hartman +--- + scripts/pahole-flags.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/scripts/pahole-flags.sh ++++ b/scripts/pahole-flags.sh +@@ -7,7 +7,7 @@ if ! [ -x "$(command -v ${PAHOLE})" ]; t + exit 0 + fi + +-pahole_ver=$(${PAHOLE} --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/') ++pahole_ver=$($(dirname $0)/pahole-version.sh ${PAHOLE}) + + if [ "${pahole_ver}" -ge "118" ] && [ "${pahole_ver}" -le "121" ]; then + # pahole 1.18 through 1.21 can't handle zero-sized per-CPU vars diff --git a/queue-5.15/series b/queue-5.15/series index 82e3cc46b1f..94e5b5fca5b 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -29,3 +29,7 @@ nbd-fix-possible-overflow-on-first_minor-in-nbd_dev_add.patch wifi-mwifiex-add-missing-compatible-string-for-sd8787.patch audit-update-the-mailing-list-in-maintainers.patch ext4-fix-function-prototype-mismatch-for-ext4_feat_ktype.patch +kbuild-add-config_pahole_version.patch +scripts-pahole-flags.sh-use-pahole-version.sh.patch +lib-kconfig.debug-use-config_pahole_version.patch +lib-kconfig.debug-allow-btf-dwarf5-with-pahole-1.21.patch -- 2.47.2