From: Greg Kroah-Hartman Date: Tue, 16 Jun 2026 10:13:43 +0000 (+0530) Subject: 6.1-stable patches X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=50b59b451fbfb3b1825b01cc026c63ed62a9fc60;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: perf-build-conditionally-define-ndebug.patch perf-build-disable-fewer-bison-warnings.patch perf-build-remove-wno-unused-but-set-variable-from-the-flex-flags-when-building-with-clang-13.0.0.patch perf-parse-events-make-yydebug-dependent-on-doing-a-debug-build.patch tools-build-add-3-component-logical-version-comparators.patch --- diff --git a/queue-6.1/perf-build-conditionally-define-ndebug.patch b/queue-6.1/perf-build-conditionally-define-ndebug.patch new file mode 100644 index 0000000000..b9d9573eda --- /dev/null +++ b/queue-6.1/perf-build-conditionally-define-ndebug.patch @@ -0,0 +1,43 @@ +From stable+bounces-250203-greg=kroah.com@vger.kernel.org Wed May 20 22:29:26 2026 +From: Florian Fainelli +Date: Wed, 20 May 2026 09:33:16 -0700 +Subject: perf build: Conditionally define NDEBUG +To: stable@vger.kernel.org +Cc: Ian Rogers , Adrian Hunter , Alexander Shishkin , Ingo Molnar , Jiri Olsa , Mark Rutland , Namhyung Kim , Paolo Bonzini , Peter Zijlstra , Sean Christopherson , Arnaldo Carvalho de Melo , Florian Fainelli , Arnaldo Carvalho de Melo , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-perf-users@vger.kernel.org (open list:PERFORMANCE EVENTS SUBSYSTEM), linux-kernel@vger.kernel.org (open list:PERFORMANCE EVENTS SUBSYSTEM), bpf@vger.kernel.org (open list:BPF [MISC]), llvm@lists.linux.dev (open list:CLANG/LLVM BUILD SUPPORT), bcm-kernel-feedback-list@broadcom.com +Message-ID: <20260520163320.3073037-2-florian.fainelli@broadcom.com> + +From: Ian Rogers + +commit 616b14b47a86d880ba21a363440f20f82152d8f2 upstream + +When a build is done without DEBUG=1 then define NDEBUG. This will +compile out asserts and other debug code. + +Signed-off-by: Ian Rogers +Cc: Adrian Hunter +Cc: Alexander Shishkin +Cc: Ingo Molnar +Cc: Jiri Olsa +Cc: Mark Rutland +Cc: Namhyung Kim +Cc: Paolo Bonzini +Cc: Peter Zijlstra +Cc: Sean Christopherson +Link: https://lore.kernel.org/r/20230330183827.1412303-1-irogers@google.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Florian Fainelli +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/Makefile.config | 1 + + 1 file changed, 1 insertion(+) + +--- a/tools/perf/Makefile.config ++++ b/tools/perf/Makefile.config +@@ -228,6 +228,7 @@ ifndef DEBUG + endif + + ifeq ($(DEBUG),0) ++CORE_CFLAGS += -DNDEBUG=1 + ifeq ($(CC_NO_CLANG), 0) + CORE_CFLAGS += -O3 + else diff --git a/queue-6.1/perf-build-disable-fewer-bison-warnings.patch b/queue-6.1/perf-build-disable-fewer-bison-warnings.patch new file mode 100644 index 0000000000..ccc5e49510 --- /dev/null +++ b/queue-6.1/perf-build-disable-fewer-bison-warnings.patch @@ -0,0 +1,117 @@ +From stable+bounces-250206-greg=kroah.com@vger.kernel.org Wed May 20 22:58:58 2026 +From: Florian Fainelli +Date: Wed, 20 May 2026 09:33:18 -0700 +Subject: perf build: Disable fewer bison warnings +To: stable@vger.kernel.org +Cc: Ian Rogers , Adrian Hunter , Alexander Shishkin , Andrii Nakryiko , Eduard Zingerman , Gaosheng Cui , Ingo Molnar , Jiri Olsa , Kan Liang , Mark Rutland , Namhyung Kim , Nathan Chancellor , Nick Desaulniers , Peter Zijlstra , Rob Herring , Tom Rix , bpf@vger.kernel.org, llvm@lists.linux.dev, Arnaldo Carvalho de Melo , Florian Fainelli , Arnaldo Carvalho de Melo , linux-perf-users@vger.kernel.org (open list:PERFORMANCE EVENTS SUBSYSTEM), linux-kernel@vger.kernel.org (open list:PERFORMANCE EVENTS SUBSYSTEM), bcm-kernel-feedback-list@broadcom.com +Message-ID: <20260520163320.3073037-4-florian.fainelli@broadcom.com> + +From: Ian Rogers + +commit ddc8e4c966923ad1137790817157c8a5f0301aec upstream + +If bison is version 3.8.2, reduce the number of bison C warnings +disabled. Earlier bison versions have all C warnings disabled. Avoid +implicit declarations of yylex by adding the declaration in the C +file. A header can't be included as a circular dependency would occur +due to the lexer using the bison defined tokens. + +Committer notes: + +Some recent versions of gcc and clang (noticed on Alpine Linux 3.17, +edge, clearlinux, fedora 37, etc. + +Signed-off-by: Ian Rogers +Cc: Adrian Hunter +Cc: Alexander Shishkin +Cc: Andrii Nakryiko +Cc: Eduard Zingerman +Cc: Gaosheng Cui +Cc: Ingo Molnar +Cc: Jiri Olsa +Cc: Kan Liang +Cc: Mark Rutland +Cc: Namhyung Kim +Cc: Nathan Chancellor +Cc: Nick Desaulniers +Cc: Peter Zijlstra +Cc: Rob Herring +Cc: Tom Rix +Cc: bpf@vger.kernel.org +Cc: llvm@lists.linux.dev +Link: https://lore.kernel.org/r/20230728064917.767761-6-irogers@google.com +Signed-off-by: Arnaldo Carvalho de Melo +[florian: Remove non-existent tools/perf/util/bpf-filter.y in 6.1.y] +Signed-off-by: Florian Fainelli +Change-Id: I62327ddbe816008197053a9234a92d9c253a2c5d +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/util/Build | 12 ++++++++---- + tools/perf/util/expr.y | 4 +++- + tools/perf/util/parse-events.y | 1 + + tools/perf/util/pmu.y | 3 +++ + 4 files changed, 15 insertions(+), 5 deletions(-) + +--- a/tools/perf/util/Build ++++ b/tools/perf/util/Build +@@ -269,10 +269,14 @@ CFLAGS_parse-events-flex.o += $(flex_fl + CFLAGS_pmu-flex.o += $(flex_flags) + CFLAGS_expr-flex.o += $(flex_flags) + +-bison_flags := -DYYENABLE_NLS=0 +-BISON_GE_35 := $(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\)/\1\2/g') \>\= 35) +-ifeq ($(BISON_GE_35),1) +- bison_flags += -Wno-unused-parameter -Wno-nested-externs -Wno-implicit-function-declaration -Wno-switch-enum -Wno-unused-but-set-variable -Wno-unknown-warning-option ++# Some newer clang and gcc version complain about this ++# util/parse-events-bison.c:1317:9: error: variable 'parse_events_nerrs' set but not used [-Werror,-Wunused-but-set-variable] ++# int yynerrs = 0; ++ ++bison_flags := -DYYENABLE_NLS=0 -Wno-unused-but-set-variable ++BISON_GE_382 := $(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \>\= 382) ++ifeq ($(BISON_GE_382),1) ++ bison_flags += -Wno-switch-enum + else + bison_flags += -w + endif +--- a/tools/perf/util/expr.y ++++ b/tools/perf/util/expr.y +@@ -7,6 +7,8 @@ + #include "util/debug.h" + #define IN_EXPR_Y 1 + #include "expr.h" ++#include "expr-bison.h" ++int expr_lex(YYSTYPE * yylval_param , void *yyscanner); + %} + + %define api.pure full +@@ -56,7 +58,7 @@ + static void expr_error(double *final_val __maybe_unused, + struct expr_parse_ctx *ctx __maybe_unused, + bool compute_ids __maybe_unused, +- void *scanner, ++ void *scanner __maybe_unused, + const char *s) + { + pr_debug("%s\n", s); +--- a/tools/perf/util/parse-events.y ++++ b/tools/perf/util/parse-events.y +@@ -20,6 +20,7 @@ + #include "parse-events.h" + #include "parse-events-bison.h" + ++int parse_events_lex(YYSTYPE * yylval_param, YYLTYPE * yylloc_param , void *yyscanner); + void parse_events_error(YYLTYPE *loc, void *parse_state, void *scanner, char const *msg); + + #define ABORT_ON(val) \ +--- a/tools/perf/util/pmu.y ++++ b/tools/perf/util/pmu.y +@@ -9,6 +9,9 @@ + #include + #include + #include "pmu.h" ++#include "pmu-bison.h" ++ ++int perf_pmu_lex(void); + + #define ABORT_ON(val) \ + do { \ diff --git a/queue-6.1/perf-build-remove-wno-unused-but-set-variable-from-the-flex-flags-when-building-with-clang-13.0.0.patch b/queue-6.1/perf-build-remove-wno-unused-but-set-variable-from-the-flex-flags-when-building-with-clang-13.0.0.patch new file mode 100644 index 0000000000..1264625205 --- /dev/null +++ b/queue-6.1/perf-build-remove-wno-unused-but-set-variable-from-the-flex-flags-when-building-with-clang-13.0.0.patch @@ -0,0 +1,76 @@ +From stable+bounces-250209-greg=kroah.com@vger.kernel.org Wed May 20 22:59:29 2026 +From: Florian Fainelli +Date: Wed, 20 May 2026 09:33:20 -0700 +Subject: perf build: Remove -Wno-unused-but-set-variable from the flex flags when building with clang < 13.0.0 +To: stable@vger.kernel.org +Cc: Arnaldo Carvalho de Melo , Adrian Hunter , Ian Rogers , Jiri Olsa , Namhyung Kim , Florian Fainelli , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-perf-users@vger.kernel.org (open list:PERFORMANCE EVENTS SUBSYSTEM), linux-kernel@vger.kernel.org (open list:PERFORMANCE EVENTS SUBSYSTEM), bpf@vger.kernel.org (open list:BPF [MISC]), llvm@lists.linux.dev (open list:CLANG/LLVM BUILD SUPPORT), bcm-kernel-feedback-list@broadcom.com +Message-ID: <20260520163320.3073037-6-florian.fainelli@broadcom.com> + +From: Arnaldo Carvalho de Melo + +clang < 13.0.0 doesn't grok -Wno-unused-but-set-variable, so just remove +it to avoid: + + error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option] + make[4]: *** [/git/perf-6.5.0-rc4/tools/build/Makefile.build:128: /tmp/build/perf/util/pmu-flex.o] Error 1 + make[4]: *** Waiting for unfinished jobs.... + +Fixes: ddc8e4c966923ad1 ("perf build: Disable fewer bison warnings") +Cc: Adrian Hunter +Cc: Ian Rogers +Cc: Jiri Olsa +Cc: Namhyung Kim +Link: https://lore.kernel.org/lkml/ZNUSWr52jUnVaaa%2F@kernel.org/ +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Florian Fainelli +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/util/Build | 20 +++++++++++++++++--- + 1 file changed, 17 insertions(+), 3 deletions(-) + +--- a/tools/perf/util/Build ++++ b/tools/perf/util/Build +@@ -1,3 +1,6 @@ ++include $(srctree)/tools/scripts/Makefile.include ++include $(srctree)/tools/scripts/utilities.mak ++ + perf-y += arm64-frame-pointer-unwind-support.o + perf-y += annotate.o + perf-y += block-info.o +@@ -265,15 +268,22 @@ ifeq ($(FLEX_GE_26),1) + else + flex_flags := -w + endif +-CFLAGS_parse-events-flex.o += $(flex_flags) +-CFLAGS_pmu-flex.o += $(flex_flags) +-CFLAGS_expr-flex.o += $(flex_flags) + + # Some newer clang and gcc version complain about this + # util/parse-events-bison.c:1317:9: error: variable 'parse_events_nerrs' set but not used [-Werror,-Wunused-but-set-variable] + # int yynerrs = 0; + + bison_flags := -DYYENABLE_NLS=0 -Wno-unused-but-set-variable ++ ++# Old clangs don't grok -Wno-unused-but-set-variable, remove it ++ifeq ($(CC_NO_CLANG), 0) ++ CLANG_VERSION := $(shell $(CLANG) --version | head -1 | sed 's/.*clang version \([[:digit:]]\+.[[:digit:]]\+.[[:digit:]]\+\).*/\1/g') ++ ifeq ($(call version-lt3,$(CLANG_VERSION),13.0.0),1) ++ bison_flags := $(subst -Wno-unused-but-set-variable,,$(bison_flags)) ++ flex_flags := $(subst -Wno-unused-but-set-variable,,$(flex_flags)) ++ endif ++endif ++ + BISON_GE_382 := $(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \>\= 382) + ifeq ($(BISON_GE_382),1) + bison_flags += -Wno-switch-enum +@@ -286,6 +296,10 @@ ifeq ($(BISON_LT_381),1) + bison_flags += -DYYNOMEM=YYABORT + endif + ++CFLAGS_parse-events-flex.o += $(flex_flags) ++CFLAGS_pmu-flex.o += $(flex_flags) ++CFLAGS_expr-flex.o += $(flex_flags) ++ + CFLAGS_parse-events-bison.o += $(bison_flags) + CFLAGS_pmu-bison.o += -DYYLTYPE_IS_TRIVIAL=0 $(bison_flags) + CFLAGS_expr-bison.o += -DYYLTYPE_IS_TRIVIAL=0 $(bison_flags) diff --git a/queue-6.1/perf-parse-events-make-yydebug-dependent-on-doing-a-debug-build.patch b/queue-6.1/perf-parse-events-make-yydebug-dependent-on-doing-a-debug-build.patch new file mode 100644 index 0000000000..621ea29478 --- /dev/null +++ b/queue-6.1/perf-parse-events-make-yydebug-dependent-on-doing-a-debug-build.patch @@ -0,0 +1,49 @@ +From stable+bounces-250204-greg=kroah.com@vger.kernel.org Wed May 20 22:58:26 2026 +From: Florian Fainelli +Date: Wed, 20 May 2026 09:33:17 -0700 +Subject: perf parse-events: Make YYDEBUG dependent on doing a debug build +To: stable@vger.kernel.org +Cc: Ian Rogers , Namhyung Kim , Adrian Hunter , Alexander Shishkin , Gaosheng Cui , Ingo Molnar , James Clark , Jiri Olsa , Kan Liang , Mark Rutland , Peter Zijlstra , Rob Herring , bpf@vger.kernel.org, Arnaldo Carvalho de Melo , Florian Fainelli , Arnaldo Carvalho de Melo , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-perf-users@vger.kernel.org (open list:PERFORMANCE EVENTS SUBSYSTEM), linux-kernel@vger.kernel.org (open list:PERFORMANCE EVENTS SUBSYSTEM), llvm@lists.linux.dev (open list:CLANG/LLVM BUILD SUPPORT), bcm-kernel-feedback-list@broadcom.com +Message-ID: <20260520163320.3073037-3-florian.fainelli@broadcom.com> + +From: Ian Rogers + +commit d4ce60190e08d84f88937019defa5e3d23409ac1 upstream + +YYDEBUG enables line numbers and other error helpers in the generated +parse-events-bison.c. These shouldn't be generated when debugging +isn't enabled. + +Signed-off-by: Ian Rogers +Acked-by: Namhyung Kim +Cc: Adrian Hunter +Cc: Alexander Shishkin +Cc: Gaosheng Cui +Cc: Ingo Molnar +Cc: James Clark +Cc: Jiri Olsa +Cc: Kan Liang +Cc: Mark Rutland +Cc: Peter Zijlstra +Cc: Rob Herring +Cc: bpf@vger.kernel.org +Link: https://lore.kernel.org/r/20230911170559.4037734-2-irogers@google.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Florian Fainelli +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/util/parse-events.y | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/tools/perf/util/parse-events.y ++++ b/tools/perf/util/parse-events.y +@@ -6,7 +6,9 @@ + + %{ + ++#ifndef NDEBUG + #define YYDEBUG 1 ++#endif + + #include + #include diff --git a/queue-6.1/series b/queue-6.1/series index 0b2ac10f34..f40269c527 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -492,3 +492,8 @@ blk-cgroup-fix-null-deref-caused-by-blkg_policy_data-being-installed-before-init batman-adv-stop-tp_meter-sessions-during-mesh-teardown.patch batman-adv-tp_meter-fix-tp_num-leak-on-kmalloc-failure.patch alsa-hda-hdmi-add-quirk-for-tuxedo-ibs14g6.patch +perf-build-conditionally-define-ndebug.patch +perf-parse-events-make-yydebug-dependent-on-doing-a-debug-build.patch +perf-build-disable-fewer-bison-warnings.patch +tools-build-add-3-component-logical-version-comparators.patch +perf-build-remove-wno-unused-but-set-variable-from-the-flex-flags-when-building-with-clang-13.0.0.patch diff --git a/queue-6.1/tools-build-add-3-component-logical-version-comparators.patch b/queue-6.1/tools-build-add-3-component-logical-version-comparators.patch new file mode 100644 index 0000000000..76ddf820d0 --- /dev/null +++ b/queue-6.1/tools-build-add-3-component-logical-version-comparators.patch @@ -0,0 +1,59 @@ +From stable+bounces-250208-greg=kroah.com@vger.kernel.org Thu May 21 01:09:09 2026 +From: Florian Fainelli +Date: Wed, 20 May 2026 09:33:19 -0700 +Subject: tools build: Add 3-component logical version comparators +To: stable@vger.kernel.org +Cc: Arnaldo Carvalho de Melo , Adrian Hunter , Ian Rogers , Jiri Olsa , Namhyung Kim , Florian Fainelli , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-perf-users@vger.kernel.org (open list:PERFORMANCE EVENTS SUBSYSTEM), linux-kernel@vger.kernel.org (open list:PERFORMANCE EVENTS SUBSYSTEM), bpf@vger.kernel.org (open list:BPF [MISC]), llvm@lists.linux.dev (open list:CLANG/LLVM BUILD SUPPORT), bcm-kernel-feedback-list@broadcom.com +Message-ID: <20260520163320.3073037-5-florian.fainelli@broadcom.com> + +From: Arnaldo Carvalho de Melo + +commit a9b451509565d40a5ca3b41c39a2b758cdbc5355 upstream + +The next cset needs to compare if a flex version is greater or +equal/less than another, but since there is no canonical, generally +available way to compare versions in the command line (sort -V, yeah, +but...), just use awk to canonicalize the versions like is also done in +scripts/rust_is_available.sh. + +There was a problem spotted in linux-next where a bashism, here +documents, aka the '<<<' stdin redirector, for strings to be used as the +stdin for awk. Use $(shell echo | awk ...) instead. + +Cc: Adrian Hunter +Cc: Ian Rogers +Cc: Jiri Olsa +Cc: Namhyung Kim +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Florian Fainelli +Signed-off-by: Greg Kroah-Hartman +--- + tools/scripts/utilities.mak | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +--- a/tools/scripts/utilities.mak ++++ b/tools/scripts/utilities.mak +@@ -177,3 +177,23 @@ $(if $($(1)),$(call _ge_attempt,$($(1)), + endef + _ge_attempt = $(or $(get-executable),$(call _gea_err,$(2))) + _gea_err = $(if $(1),$(error Please set '$(1)' appropriately)) ++ ++# version-ge3 ++# ++# Usage $(call version-ge3,2.6.4,$(FLEX_VERSION)) ++# ++# To compare if a 3 component version is greater or equal to another, first use ++# was to check the flex version to see if we can use compiler warnings as ++# errors for one of the cases flex generates code C compilers complains about. ++ ++version-ge3 = $(shell echo "$(1).$(2)" | awk -F'.' '{ printf("%d\n", (10000000 * $$1 + 10000 * $$2 + $$3) >= (10000000 * $$4 + 10000 * $$5 + $$6)) }') ++ ++# version-lt3 ++# ++# Usage $(call version-lt3,2.6.2,$(FLEX_VERSION)) ++# ++# To compare if a 3 component version is less thjan another, first use was to ++# check the flex version to see if we can use compiler warnings as errors for ++# one of the cases flex generates code C compilers complains about. ++ ++version-lt3 = $(shell echo "$(1).$(2)" | awk -F'.' '{ printf("%d\n", (10000000 * $$1 + 10000 * $$2 + $$3) < (10000000 * $$4 + 10000 * $$5 + $$6)) }')