+++ /dev/null
-From 96b1738d47e2644e71a84ebf6a9a3ffc696da897 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 27 Jul 2023 19:24:46 -0700
-Subject: perf build: Update build rule for generated files
-
-From: Namhyung Kim <namhyung@kernel.org>
-
-[ Upstream commit 7822a8913f4c51c7d1aff793b525d60c3384fb5b ]
-
-The bison and flex generate C files from the source (.y and .l)
-files. When O= option is used, they are saved in a separate directory
-but the default build rule assumes the .C files are in the source
-directory. So it might read invalid file if there are generated files
-from an old version. The same is true for the pmu-events files.
-
-For example, the following command would cause a build failure:
-
- $ git checkout v6.3
- $ make -C tools/perf # build in the same directory
-
- $ git checkout v6.5-rc2
- $ mkdir build # create a build directory
- $ make -C tools/perf O=build # build in a different directory but it
- # refers files in the source directory
-
-Let's update the build rule to specify those cases explicitly to depend
-on the files in the output directory.
-
-Note that it's not a complete fix and it needs the next patch for the
-include path too.
-
-Fixes: 80eeb67fe577aa76 ("perf jevents: Program to convert JSON file")
-Signed-off-by: Namhyung Kim <namhyung@kernel.org>
-Cc: Adrian Hunter <adrian.hunter@intel.com>
-Cc: Andi Kleen <ak@linux.intel.com>
-Cc: Anup Sharma <anupnewsmail@gmail.com>
-Cc: Ian Rogers <irogers@google.com>
-Cc: Ingo Molnar <mingo@kernel.org>
-Cc: Jiri Olsa <jolsa@kernel.org>
-Cc: Peter Zijlstra <peterz@infradead.org>
-Cc: stable@vger.kernel.org
-Link: https://lore.kernel.org/r/20230728022447.1323563-1-namhyung@kernel.org
-Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- tools/build/Makefile.build | 10 ++++++++++
- tools/perf/pmu-events/Build | 6 ++++++
- 2 files changed, 16 insertions(+)
-
-diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
-index cd72016c3cfa7..5a727094ae832 100644
---- a/tools/build/Makefile.build
-+++ b/tools/build/Makefile.build
-@@ -116,6 +116,16 @@ $(OUTPUT)%.s: %.c FORCE
- $(call rule_mkdir)
- $(call if_changed_dep,cc_s_c)
-
-+# bison and flex files are generated in the OUTPUT directory
-+# so it needs a separate rule to depend on them properly
-+$(OUTPUT)%-bison.o: $(OUTPUT)%-bison.c FORCE
-+ $(call rule_mkdir)
-+ $(call if_changed_dep,$(host)cc_o_c)
-+
-+$(OUTPUT)%-flex.o: $(OUTPUT)%-flex.c FORCE
-+ $(call rule_mkdir)
-+ $(call if_changed_dep,$(host)cc_o_c)
-+
- # Gather build data:
- # obj-y - list of build objects
- # subdir-y - list of directories to nest
-diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
-index 5ec5ce8c31bab..ea8c41f9c7398 100644
---- a/tools/perf/pmu-events/Build
-+++ b/tools/perf/pmu-events/Build
-@@ -25,3 +25,9 @@ $(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JSON_TEST) $(JEVENTS_PY)
- $(call rule_mkdir)
- $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(SRCARCH) pmu-events/arch $@
- endif
-+
-+# pmu-events.c file is generated in the OUTPUT directory so it needs a
-+# separate rule to depend on it properly
-+$(OUTPUT)pmu-events/pmu-events.o: $(PMU_EVENTS_C)
-+ $(call rule_mkdir)
-+ $(call if_changed_dep,cc_o_c)
---
-2.40.1
-
+++ /dev/null
-From 7662c434527119517af9ed50d1147363871d008a Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 29 Jun 2022 11:25:04 -0700
-Subject: perf jevents: Switch build to use jevents.py
-
-From: Ian Rogers <rogers.email@gmail.com>
-
-[ Upstream commit 00facc760903be6675870c2749e2cd72140e396e ]
-
-Generate pmu-events.c using jevents.py rather than the binary built from
-jevents.c.
-
-Add a new config variable NO_JEVENTS that is set when there is no
-architecture json or an appropriate python interpreter isn't present.
-
-When NO_JEVENTS is defined the file pmu-events/empty-pmu-events.c is
-copied and used as the pmu-events.c file.
-
-Signed-off-by: Ian Rogers <irogers@google.com>
-Tested-by: John Garry <john.garry@huawei.com>
-Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
-Cc: Ananth Narayan <ananth.narayan@amd.com>
-Cc: Andi Kleen <ak@linux.intel.com>
-Cc: Andrew Kilroy <andrew.kilroy@arm.com>
-Cc: Caleb Biggers <caleb.biggers@intel.com>
-Cc: Felix Fietkau <nbd@nbd.name>
-Cc: Ian Rogers <rogers.email@gmail.com>
-Cc: Ingo Molnar <mingo@redhat.com>
-Cc: James Clark <james.clark@arm.com>
-Cc: Jiri Olsa <jolsa@kernel.org>
-Cc: Kajol Jain <kjain@linux.ibm.com>
-Cc: Kan Liang <kan.liang@linux.intel.com>
-Cc: Kshipra Bopardikar <kshipra.bopardikar@intel.com>
-Cc: Like Xu <likexu@tencent.com>
-Cc: Mark Rutland <mark.rutland@arm.com>
-Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
-Cc: Namhyung Kim <namhyung@kernel.org>
-Cc: Nick Forrington <nick.forrington@arm.com>
-Cc: Paul Clarke <pc@us.ibm.com>
-Cc: Perry Taylor <perry.taylor@intel.com>
-Cc: Peter Zijlstra <peterz@infradead.org>
-Cc: Qi Liu <liuqi115@huawei.com>
-Cc: Ravi Bangoria <ravi.bangoria@amd.com>
-Cc: Sandipan Das <sandipan.das@amd.com>
-Cc: Santosh Shukla <santosh.shukla@amd.com>
-Cc: Stephane Eranian <eranian@google.com>
-Cc: Will Deacon <will@kernel.org>
-Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
-Link: https://lore.kernel.org/r/20220629182505.406269-4-irogers@google.com
-Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-Stable-dep-of: 7822a8913f4c ("perf build: Update build rule for generated files")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- tools/perf/Makefile.config | 19 +++
- tools/perf/Makefile.perf | 1 +
- tools/perf/pmu-events/Build | 13 +-
- tools/perf/pmu-events/empty-pmu-events.c | 158 +++++++++++++++++++++++
- 4 files changed, 189 insertions(+), 2 deletions(-)
- create mode 100644 tools/perf/pmu-events/empty-pmu-events.c
-
-diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
-index 89905b4e93091..a92d5422041ee 100644
---- a/tools/perf/Makefile.config
-+++ b/tools/perf/Makefile.config
-@@ -824,6 +824,25 @@ else
- endif
- endif
-
-+ifneq ($(NO_JEVENTS),1)
-+ ifeq ($(wildcard pmu-events/arch/$(SRCARCH)/mapfile.csv),)
-+ NO_JEVENTS := 1
-+ endif
-+endif
-+ifneq ($(NO_JEVENTS),1)
-+ NO_JEVENTS := 0
-+ ifndef PYTHON
-+ $(warning No python interpreter disabling jevent generation)
-+ NO_JEVENTS := 1
-+ else
-+ # jevents.py uses f-strings present in Python 3.6 released in Dec. 2016.
-+ JEVENTS_PYTHON_GOOD := $(shell $(PYTHON) -c 'import sys;print("1" if(sys.version_info.major >= 3 and sys.version_info.minor >= 6) else "0")' 2> /dev/null)
-+ ifneq ($(JEVENTS_PYTHON_GOOD), 1)
-+ $(warning Python interpreter too old (older than 3.6) disabling jevent generation)
-+ NO_JEVENTS := 1
-+ endif
-+ endif
-+endif
-
- ifndef NO_LIBBFD
- ifeq ($(feature-libbfd), 1)
-diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
-index e41a8f9b99d2d..ef25028b2e2fa 100644
---- a/tools/perf/Makefile.perf
-+++ b/tools/perf/Makefile.perf
-@@ -634,6 +634,7 @@ JEVENTS := $(OUTPUT)pmu-events/jevents
- JEVENTS_IN := $(OUTPUT)pmu-events/jevents-in.o
-
- PMU_EVENTS_IN := $(OUTPUT)pmu-events/pmu-events-in.o
-+export NO_JEVENTS
-
- export JEVENTS
-
-diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
-index a055dee6a46af..5ec5ce8c31bab 100644
---- a/tools/perf/pmu-events/Build
-+++ b/tools/perf/pmu-events/Build
-@@ -9,10 +9,19 @@ JSON = $(shell [ -d $(JDIR) ] && \
- JDIR_TEST = pmu-events/arch/test
- JSON_TEST = $(shell [ -d $(JDIR_TEST) ] && \
- find $(JDIR_TEST) -name '*.json')
-+JEVENTS_PY = pmu-events/jevents.py
-
- #
- # Locate/process JSON files in pmu-events/arch/
- # directory and create tables in pmu-events.c.
- #
--$(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JSON_TEST) $(JEVENTS)
-- $(Q)$(call echo-cmd,gen)$(JEVENTS) $(SRCARCH) pmu-events/arch $(OUTPUT)pmu-events/pmu-events.c $(V)
-+
-+ifeq ($(NO_JEVENTS),1)
-+$(OUTPUT)pmu-events/pmu-events.c: pmu-events/empty-pmu-events.c
-+ $(call rule_mkdir)
-+ $(Q)$(call echo-cmd,gen)cp $< $@
-+else
-+$(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JSON_TEST) $(JEVENTS_PY)
-+ $(call rule_mkdir)
-+ $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(SRCARCH) pmu-events/arch $@
-+endif
-diff --git a/tools/perf/pmu-events/empty-pmu-events.c b/tools/perf/pmu-events/empty-pmu-events.c
-new file mode 100644
-index 0000000000000..77e655c6f1162
---- /dev/null
-+++ b/tools/perf/pmu-events/empty-pmu-events.c
-@@ -0,0 +1,158 @@
-+// SPDX-License-Identifier: GPL-2.0
-+/*
-+ * An empty pmu-events.c file used when there is no architecture json files in
-+ * arch or when the jevents.py script cannot be run.
-+ *
-+ * The test cpu/soc is provided for testing.
-+ */
-+#include "pmu-events/pmu-events.h"
-+
-+static const struct pmu_event pme_test_soc_cpu[] = {
-+ {
-+ .name = "l3_cache_rd",
-+ .event = "event=0x40",
-+ .desc = "L3 cache access, read",
-+ .topic = "cache",
-+ .long_desc = "Attributable Level 3 cache access, read",
-+ },
-+ {
-+ .name = "segment_reg_loads.any",
-+ .event = "event=0x6,period=200000,umask=0x80",
-+ .desc = "Number of segment register loads",
-+ .topic = "other",
-+ },
-+ {
-+ .name = "dispatch_blocked.any",
-+ .event = "event=0x9,period=200000,umask=0x20",
-+ .desc = "Memory cluster signals to block micro-op dispatch for any reason",
-+ .topic = "other",
-+ },
-+ {
-+ .name = "eist_trans",
-+ .event = "event=0x3a,period=200000,umask=0x0",
-+ .desc = "Number of Enhanced Intel SpeedStep(R) Technology (EIST) transitions",
-+ .topic = "other",
-+ },
-+ {
-+ .name = "uncore_hisi_ddrc.flux_wcmd",
-+ .event = "event=0x2",
-+ .desc = "DDRC write commands. Unit: hisi_sccl,ddrc ",
-+ .topic = "uncore",
-+ .long_desc = "DDRC write commands",
-+ .pmu = "hisi_sccl,ddrc",
-+ },
-+ {
-+ .name = "unc_cbo_xsnp_response.miss_eviction",
-+ .event = "event=0x22,umask=0x81",
-+ .desc = "A cross-core snoop resulted from L3 Eviction which misses in some processor core. Unit: uncore_cbox ",
-+ .topic = "uncore",
-+ .long_desc = "A cross-core snoop resulted from L3 Eviction which misses in some processor core",
-+ .pmu = "uncore_cbox",
-+ },
-+ {
-+ .name = "event-hyphen",
-+ .event = "event=0xe0,umask=0x00",
-+ .desc = "UNC_CBO_HYPHEN. Unit: uncore_cbox ",
-+ .topic = "uncore",
-+ .long_desc = "UNC_CBO_HYPHEN",
-+ .pmu = "uncore_cbox",
-+ },
-+ {
-+ .name = "event-two-hyph",
-+ .event = "event=0xc0,umask=0x00",
-+ .desc = "UNC_CBO_TWO_HYPH. Unit: uncore_cbox ",
-+ .topic = "uncore",
-+ .long_desc = "UNC_CBO_TWO_HYPH",
-+ .pmu = "uncore_cbox",
-+ },
-+ {
-+ .name = "uncore_hisi_l3c.rd_hit_cpipe",
-+ .event = "event=0x7",
-+ .desc = "Total read hits. Unit: hisi_sccl,l3c ",
-+ .topic = "uncore",
-+ .long_desc = "Total read hits",
-+ .pmu = "hisi_sccl,l3c",
-+ },
-+ {
-+ .name = "uncore_imc_free_running.cache_miss",
-+ .event = "event=0x12",
-+ .desc = "Total cache misses. Unit: uncore_imc_free_running ",
-+ .topic = "uncore",
-+ .long_desc = "Total cache misses",
-+ .pmu = "uncore_imc_free_running",
-+ },
-+ {
-+ .name = "uncore_imc.cache_hits",
-+ .event = "event=0x34",
-+ .desc = "Total cache hits. Unit: uncore_imc ",
-+ .topic = "uncore",
-+ .long_desc = "Total cache hits",
-+ .pmu = "uncore_imc",
-+ },
-+ {
-+ .name = "bp_l1_btb_correct",
-+ .event = "event=0x8a",
-+ .desc = "L1 BTB Correction",
-+ .topic = "branch",
-+ },
-+ {
-+ .name = "bp_l2_btb_correct",
-+ .event = "event=0x8b",
-+ .desc = "L2 BTB Correction",
-+ .topic = "branch",
-+ },
-+ {
-+ .name = 0,
-+ .event = 0,
-+ .desc = 0,
-+ },
-+};
-+
-+const struct pmu_events_map pmu_events_map[] = {
-+ {
-+ .cpuid = "testcpu",
-+ .version = "v1",
-+ .type = "core",
-+ .table = pme_test_soc_cpu,
-+ },
-+ {
-+ .cpuid = 0,
-+ .version = 0,
-+ .type = 0,
-+ .table = 0,
-+ },
-+};
-+
-+static const struct pmu_event pme_test_soc_sys[] = {
-+ {
-+ .name = "sys_ddr_pmu.write_cycles",
-+ .event = "event=0x2b",
-+ .desc = "ddr write-cycles event. Unit: uncore_sys_ddr_pmu ",
-+ .compat = "v8",
-+ .topic = "uncore",
-+ .pmu = "uncore_sys_ddr_pmu",
-+ },
-+ {
-+ .name = "sys_ccn_pmu.read_cycles",
-+ .event = "config=0x2c",
-+ .desc = "ccn read-cycles event. Unit: uncore_sys_ccn_pmu ",
-+ .compat = "0x01",
-+ .topic = "uncore",
-+ .pmu = "uncore_sys_ccn_pmu",
-+ },
-+ {
-+ .name = 0,
-+ .event = 0,
-+ .desc = 0,
-+ },
-+};
-+
-+const struct pmu_sys_events pmu_sys_event_tables[] = {
-+ {
-+ .table = pme_test_soc_sys,
-+ .name = "pme_test_soc_sys",
-+ },
-+ {
-+ .table = 0
-+ },
-+};
---
-2.40.1
-
+++ /dev/null
-From d2725fc61d0846c110e6a0b5279193b84f509646 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 30 Aug 2022 09:48:40 -0700
-Subject: perf metric: Return early if no CPU PMU table exists
-
-From: Ian Rogers <irogers@google.com>
-
-[ Upstream commit 3f5df3ac646e21a79a421ae4037c4ef0632bcaa9 ]
-
-Previous behavior is to segfault if there is no CPU PMU table and a
-metric is sought. To reproduce compile with NO_JEVENTS=1 then request a
-metric, for example, "perf stat -M IPC true".
-
-Committer testing:
-
-Before:
-
- $ make -k NO_JEVENTS=1 BUILD_BPF_SKEL=1 O=/tmp/build/perf-urgent -C tools/perf install-bin
- $ perf stat -M IPC true
- Segmentation fault (core dumped)
- $
-
-After:
-
- $ perf stat -M IPC true
-
- Usage: perf stat [<options>] [<command>]
-
- -M, --metrics <metric/metric group list>
- monitor specified metrics or metric groups (separated by ,)
- $
-
-Fixes: 00facc760903be66 ("perf jevents: Switch build to use jevents.py")
-Signed-off-by: Ian Rogers <irogers@google.com>
-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
-Cc: Andi Kleen <ak@linux.intel.com>
-Cc: Caleb Biggers <caleb.biggers@intel.com>
-Cc: Florian Fischer <florian.fischer@muhq.space>
-Cc: Ian Rogers <rogers.email@gmail.com>
-Cc: Ingo Molnar <mingo@redhat.com>
-Cc: James Clark <james.clark@arm.com>
-Cc: Jiri Olsa <jolsa@kernel.org>
-Cc: John Garry <john.garry@huawei.com>
-Cc: Kan Liang <kan.liang@linux.intel.com>
-Cc: Kshipra Bopardikar <kshipra.bopardikar@intel.com>
-Cc: Mark Rutland <mark.rutland@arm.com>
-Cc: Miaoqian Lin <linmq006@gmail.com>
-Cc: Namhyung Kim <namhyung@kernel.org>
-Cc: Perry Taylor <perry.taylor@intel.com>
-Cc: Peter Zijlstra <peterz@infradead.org>
-Cc: Stephane Eranian <eranian@google.com>
-Cc: Thomas Richter <tmricht@linux.ibm.com>
-Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
-Link: https://lore.kernel.org/r/20220830164846.401143-3-irogers@google.com
-Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- tools/perf/util/metricgroup.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
-index 060454a172935..81b274aa81c18 100644
---- a/tools/perf/util/metricgroup.c
-+++ b/tools/perf/util/metricgroup.c
-@@ -1122,6 +1122,9 @@ int metricgroup__parse_groups(const struct option *opt,
- if (!map)
- return 0;
-
-+ if (!table)
-+ return -EINVAL;
-+
- return parse_groups(perf_evlist, str, metric_no_group,
- metric_no_merge, NULL, metric_events, map);
- }
---
-2.40.1
-
netfilter-nf_tables-double-hook-unregistration-in-ne.patch
input-i8042-rename-i8042-x86ia64io.h-to-i8042-acpipn.patch
input-i8042-add-quirk-for-tuxedo-gemini-17-gen1-clev.patch
-perf-jevents-switch-build-to-use-jevents.py.patch
-perf-build-update-build-rule-for-generated-files.patch
mmc-renesas_sdhi-probe-into-tmio-after-scc-parameter.patch
mmc-renesas_sdhi-populate-scc-pointer-at-the-proper-.patch
mmc-tmio-support-custom-irq-masks.patch
nvme-pci-do-not-set-the-numa-node-of-device-if-it-ha.patch
watchdog-itco_wdt-no-need-to-stop-the-timer-in-probe.patch
watchdog-itco_wdt-set-no_reboot-if-the-watchdog-is-n.patch
-perf-metric-return-early-if-no-cpu-pmu-table-exists.patch
netfilter-nft_exthdr-search-chunks-in-sctp-packets-o.patch
netfilter-nft_exthdr-fix-for-unsafe-packet-data-read.patch
nvme-pci-always-return-an-err_ptr-from-nvme_pci_allo.patch
+++ /dev/null
-From 908dd1d20f942e3904a9ff00259d8b2c0084e642 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 27 Jul 2023 19:24:46 -0700
-Subject: perf build: Update build rule for generated files
-
-From: Namhyung Kim <namhyung@kernel.org>
-
-[ Upstream commit 7822a8913f4c51c7d1aff793b525d60c3384fb5b ]
-
-The bison and flex generate C files from the source (.y and .l)
-files. When O= option is used, they are saved in a separate directory
-but the default build rule assumes the .C files are in the source
-directory. So it might read invalid file if there are generated files
-from an old version. The same is true for the pmu-events files.
-
-For example, the following command would cause a build failure:
-
- $ git checkout v6.3
- $ make -C tools/perf # build in the same directory
-
- $ git checkout v6.5-rc2
- $ mkdir build # create a build directory
- $ make -C tools/perf O=build # build in a different directory but it
- # refers files in the source directory
-
-Let's update the build rule to specify those cases explicitly to depend
-on the files in the output directory.
-
-Note that it's not a complete fix and it needs the next patch for the
-include path too.
-
-Fixes: 80eeb67fe577aa76 ("perf jevents: Program to convert JSON file")
-Signed-off-by: Namhyung Kim <namhyung@kernel.org>
-Cc: Adrian Hunter <adrian.hunter@intel.com>
-Cc: Andi Kleen <ak@linux.intel.com>
-Cc: Anup Sharma <anupnewsmail@gmail.com>
-Cc: Ian Rogers <irogers@google.com>
-Cc: Ingo Molnar <mingo@kernel.org>
-Cc: Jiri Olsa <jolsa@kernel.org>
-Cc: Peter Zijlstra <peterz@infradead.org>
-Cc: stable@vger.kernel.org
-Link: https://lore.kernel.org/r/20230728022447.1323563-1-namhyung@kernel.org
-Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- tools/build/Makefile.build | 10 ++++++++++
- tools/perf/pmu-events/Build | 6 ++++++
- 2 files changed, 16 insertions(+)
-
-diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
-index 715092fc6a239..0f0aba16bdee7 100644
---- a/tools/build/Makefile.build
-+++ b/tools/build/Makefile.build
-@@ -116,6 +116,16 @@ $(OUTPUT)%.s: %.c FORCE
- $(call rule_mkdir)
- $(call if_changed_dep,cc_s_c)
-
-+# bison and flex files are generated in the OUTPUT directory
-+# so it needs a separate rule to depend on them properly
-+$(OUTPUT)%-bison.o: $(OUTPUT)%-bison.c FORCE
-+ $(call rule_mkdir)
-+ $(call if_changed_dep,$(host)cc_o_c)
-+
-+$(OUTPUT)%-flex.o: $(OUTPUT)%-flex.c FORCE
-+ $(call rule_mkdir)
-+ $(call if_changed_dep,$(host)cc_o_c)
-+
- # Gather build data:
- # obj-y - list of build objects
- # subdir-y - list of directories to nest
-diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
-index 5ec5ce8c31bab..ea8c41f9c7398 100644
---- a/tools/perf/pmu-events/Build
-+++ b/tools/perf/pmu-events/Build
-@@ -25,3 +25,9 @@ $(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JSON_TEST) $(JEVENTS_PY)
- $(call rule_mkdir)
- $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(SRCARCH) pmu-events/arch $@
- endif
-+
-+# pmu-events.c file is generated in the OUTPUT directory so it needs a
-+# separate rule to depend on it properly
-+$(OUTPUT)pmu-events/pmu-events.o: $(PMU_EVENTS_C)
-+ $(call rule_mkdir)
-+ $(call if_changed_dep,cc_o_c)
---
-2.40.1
-
+++ /dev/null
-From aa5dcc880d8ea6677467f22dceabff5e45e1d2a2 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 29 Jun 2022 11:25:04 -0700
-Subject: perf jevents: Switch build to use jevents.py
-
-From: Ian Rogers <rogers.email@gmail.com>
-
-[ Upstream commit 00facc760903be6675870c2749e2cd72140e396e ]
-
-Generate pmu-events.c using jevents.py rather than the binary built from
-jevents.c.
-
-Add a new config variable NO_JEVENTS that is set when there is no
-architecture json or an appropriate python interpreter isn't present.
-
-When NO_JEVENTS is defined the file pmu-events/empty-pmu-events.c is
-copied and used as the pmu-events.c file.
-
-Signed-off-by: Ian Rogers <irogers@google.com>
-Tested-by: John Garry <john.garry@huawei.com>
-Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
-Cc: Ananth Narayan <ananth.narayan@amd.com>
-Cc: Andi Kleen <ak@linux.intel.com>
-Cc: Andrew Kilroy <andrew.kilroy@arm.com>
-Cc: Caleb Biggers <caleb.biggers@intel.com>
-Cc: Felix Fietkau <nbd@nbd.name>
-Cc: Ian Rogers <rogers.email@gmail.com>
-Cc: Ingo Molnar <mingo@redhat.com>
-Cc: James Clark <james.clark@arm.com>
-Cc: Jiri Olsa <jolsa@kernel.org>
-Cc: Kajol Jain <kjain@linux.ibm.com>
-Cc: Kan Liang <kan.liang@linux.intel.com>
-Cc: Kshipra Bopardikar <kshipra.bopardikar@intel.com>
-Cc: Like Xu <likexu@tencent.com>
-Cc: Mark Rutland <mark.rutland@arm.com>
-Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
-Cc: Namhyung Kim <namhyung@kernel.org>
-Cc: Nick Forrington <nick.forrington@arm.com>
-Cc: Paul Clarke <pc@us.ibm.com>
-Cc: Perry Taylor <perry.taylor@intel.com>
-Cc: Peter Zijlstra <peterz@infradead.org>
-Cc: Qi Liu <liuqi115@huawei.com>
-Cc: Ravi Bangoria <ravi.bangoria@amd.com>
-Cc: Sandipan Das <sandipan.das@amd.com>
-Cc: Santosh Shukla <santosh.shukla@amd.com>
-Cc: Stephane Eranian <eranian@google.com>
-Cc: Will Deacon <will@kernel.org>
-Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
-Link: https://lore.kernel.org/r/20220629182505.406269-4-irogers@google.com
-Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-Stable-dep-of: 7822a8913f4c ("perf build: Update build rule for generated files")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- tools/perf/Makefile.config | 19 +++
- tools/perf/Makefile.perf | 1 +
- tools/perf/pmu-events/Build | 13 +-
- tools/perf/pmu-events/empty-pmu-events.c | 158 +++++++++++++++++++++++
- 4 files changed, 189 insertions(+), 2 deletions(-)
- create mode 100644 tools/perf/pmu-events/empty-pmu-events.c
-
-diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
-index 973c0d5ed8d8b..e1077c4d30fff 100644
---- a/tools/perf/Makefile.config
-+++ b/tools/perf/Makefile.config
-@@ -857,6 +857,25 @@ else
- endif
- endif
-
-+ifneq ($(NO_JEVENTS),1)
-+ ifeq ($(wildcard pmu-events/arch/$(SRCARCH)/mapfile.csv),)
-+ NO_JEVENTS := 1
-+ endif
-+endif
-+ifneq ($(NO_JEVENTS),1)
-+ NO_JEVENTS := 0
-+ ifndef PYTHON
-+ $(warning No python interpreter disabling jevent generation)
-+ NO_JEVENTS := 1
-+ else
-+ # jevents.py uses f-strings present in Python 3.6 released in Dec. 2016.
-+ JEVENTS_PYTHON_GOOD := $(shell $(PYTHON) -c 'import sys;print("1" if(sys.version_info.major >= 3 and sys.version_info.minor >= 6) else "0")' 2> /dev/null)
-+ ifneq ($(JEVENTS_PYTHON_GOOD), 1)
-+ $(warning Python interpreter too old (older than 3.6) disabling jevent generation)
-+ NO_JEVENTS := 1
-+ endif
-+ endif
-+endif
-
- ifndef NO_LIBBFD
- ifeq ($(feature-libbfd), 1)
-diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
-index b856afa6eb52e..b82f2d89d74c4 100644
---- a/tools/perf/Makefile.perf
-+++ b/tools/perf/Makefile.perf
-@@ -649,6 +649,7 @@ JEVENTS := $(OUTPUT)pmu-events/jevents
- JEVENTS_IN := $(OUTPUT)pmu-events/jevents-in.o
-
- PMU_EVENTS_IN := $(OUTPUT)pmu-events/pmu-events-in.o
-+export NO_JEVENTS
-
- export JEVENTS
-
-diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
-index a055dee6a46af..5ec5ce8c31bab 100644
---- a/tools/perf/pmu-events/Build
-+++ b/tools/perf/pmu-events/Build
-@@ -9,10 +9,19 @@ JSON = $(shell [ -d $(JDIR) ] && \
- JDIR_TEST = pmu-events/arch/test
- JSON_TEST = $(shell [ -d $(JDIR_TEST) ] && \
- find $(JDIR_TEST) -name '*.json')
-+JEVENTS_PY = pmu-events/jevents.py
-
- #
- # Locate/process JSON files in pmu-events/arch/
- # directory and create tables in pmu-events.c.
- #
--$(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JSON_TEST) $(JEVENTS)
-- $(Q)$(call echo-cmd,gen)$(JEVENTS) $(SRCARCH) pmu-events/arch $(OUTPUT)pmu-events/pmu-events.c $(V)
-+
-+ifeq ($(NO_JEVENTS),1)
-+$(OUTPUT)pmu-events/pmu-events.c: pmu-events/empty-pmu-events.c
-+ $(call rule_mkdir)
-+ $(Q)$(call echo-cmd,gen)cp $< $@
-+else
-+$(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JSON_TEST) $(JEVENTS_PY)
-+ $(call rule_mkdir)
-+ $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(SRCARCH) pmu-events/arch $@
-+endif
-diff --git a/tools/perf/pmu-events/empty-pmu-events.c b/tools/perf/pmu-events/empty-pmu-events.c
-new file mode 100644
-index 0000000000000..77e655c6f1162
---- /dev/null
-+++ b/tools/perf/pmu-events/empty-pmu-events.c
-@@ -0,0 +1,158 @@
-+// SPDX-License-Identifier: GPL-2.0
-+/*
-+ * An empty pmu-events.c file used when there is no architecture json files in
-+ * arch or when the jevents.py script cannot be run.
-+ *
-+ * The test cpu/soc is provided for testing.
-+ */
-+#include "pmu-events/pmu-events.h"
-+
-+static const struct pmu_event pme_test_soc_cpu[] = {
-+ {
-+ .name = "l3_cache_rd",
-+ .event = "event=0x40",
-+ .desc = "L3 cache access, read",
-+ .topic = "cache",
-+ .long_desc = "Attributable Level 3 cache access, read",
-+ },
-+ {
-+ .name = "segment_reg_loads.any",
-+ .event = "event=0x6,period=200000,umask=0x80",
-+ .desc = "Number of segment register loads",
-+ .topic = "other",
-+ },
-+ {
-+ .name = "dispatch_blocked.any",
-+ .event = "event=0x9,period=200000,umask=0x20",
-+ .desc = "Memory cluster signals to block micro-op dispatch for any reason",
-+ .topic = "other",
-+ },
-+ {
-+ .name = "eist_trans",
-+ .event = "event=0x3a,period=200000,umask=0x0",
-+ .desc = "Number of Enhanced Intel SpeedStep(R) Technology (EIST) transitions",
-+ .topic = "other",
-+ },
-+ {
-+ .name = "uncore_hisi_ddrc.flux_wcmd",
-+ .event = "event=0x2",
-+ .desc = "DDRC write commands. Unit: hisi_sccl,ddrc ",
-+ .topic = "uncore",
-+ .long_desc = "DDRC write commands",
-+ .pmu = "hisi_sccl,ddrc",
-+ },
-+ {
-+ .name = "unc_cbo_xsnp_response.miss_eviction",
-+ .event = "event=0x22,umask=0x81",
-+ .desc = "A cross-core snoop resulted from L3 Eviction which misses in some processor core. Unit: uncore_cbox ",
-+ .topic = "uncore",
-+ .long_desc = "A cross-core snoop resulted from L3 Eviction which misses in some processor core",
-+ .pmu = "uncore_cbox",
-+ },
-+ {
-+ .name = "event-hyphen",
-+ .event = "event=0xe0,umask=0x00",
-+ .desc = "UNC_CBO_HYPHEN. Unit: uncore_cbox ",
-+ .topic = "uncore",
-+ .long_desc = "UNC_CBO_HYPHEN",
-+ .pmu = "uncore_cbox",
-+ },
-+ {
-+ .name = "event-two-hyph",
-+ .event = "event=0xc0,umask=0x00",
-+ .desc = "UNC_CBO_TWO_HYPH. Unit: uncore_cbox ",
-+ .topic = "uncore",
-+ .long_desc = "UNC_CBO_TWO_HYPH",
-+ .pmu = "uncore_cbox",
-+ },
-+ {
-+ .name = "uncore_hisi_l3c.rd_hit_cpipe",
-+ .event = "event=0x7",
-+ .desc = "Total read hits. Unit: hisi_sccl,l3c ",
-+ .topic = "uncore",
-+ .long_desc = "Total read hits",
-+ .pmu = "hisi_sccl,l3c",
-+ },
-+ {
-+ .name = "uncore_imc_free_running.cache_miss",
-+ .event = "event=0x12",
-+ .desc = "Total cache misses. Unit: uncore_imc_free_running ",
-+ .topic = "uncore",
-+ .long_desc = "Total cache misses",
-+ .pmu = "uncore_imc_free_running",
-+ },
-+ {
-+ .name = "uncore_imc.cache_hits",
-+ .event = "event=0x34",
-+ .desc = "Total cache hits. Unit: uncore_imc ",
-+ .topic = "uncore",
-+ .long_desc = "Total cache hits",
-+ .pmu = "uncore_imc",
-+ },
-+ {
-+ .name = "bp_l1_btb_correct",
-+ .event = "event=0x8a",
-+ .desc = "L1 BTB Correction",
-+ .topic = "branch",
-+ },
-+ {
-+ .name = "bp_l2_btb_correct",
-+ .event = "event=0x8b",
-+ .desc = "L2 BTB Correction",
-+ .topic = "branch",
-+ },
-+ {
-+ .name = 0,
-+ .event = 0,
-+ .desc = 0,
-+ },
-+};
-+
-+const struct pmu_events_map pmu_events_map[] = {
-+ {
-+ .cpuid = "testcpu",
-+ .version = "v1",
-+ .type = "core",
-+ .table = pme_test_soc_cpu,
-+ },
-+ {
-+ .cpuid = 0,
-+ .version = 0,
-+ .type = 0,
-+ .table = 0,
-+ },
-+};
-+
-+static const struct pmu_event pme_test_soc_sys[] = {
-+ {
-+ .name = "sys_ddr_pmu.write_cycles",
-+ .event = "event=0x2b",
-+ .desc = "ddr write-cycles event. Unit: uncore_sys_ddr_pmu ",
-+ .compat = "v8",
-+ .topic = "uncore",
-+ .pmu = "uncore_sys_ddr_pmu",
-+ },
-+ {
-+ .name = "sys_ccn_pmu.read_cycles",
-+ .event = "config=0x2c",
-+ .desc = "ccn read-cycles event. Unit: uncore_sys_ccn_pmu ",
-+ .compat = "0x01",
-+ .topic = "uncore",
-+ .pmu = "uncore_sys_ccn_pmu",
-+ },
-+ {
-+ .name = 0,
-+ .event = 0,
-+ .desc = 0,
-+ },
-+};
-+
-+const struct pmu_sys_events pmu_sys_event_tables[] = {
-+ {
-+ .table = pme_test_soc_sys,
-+ .name = "pme_test_soc_sys",
-+ },
-+ {
-+ .table = 0
-+ },
-+};
---
-2.40.1
-
+++ /dev/null
-From af3d21ffdb5a9a838f97589d2724f307b44fc492 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 30 Aug 2022 09:48:40 -0700
-Subject: perf metric: Return early if no CPU PMU table exists
-
-From: Ian Rogers <irogers@google.com>
-
-[ Upstream commit 3f5df3ac646e21a79a421ae4037c4ef0632bcaa9 ]
-
-Previous behavior is to segfault if there is no CPU PMU table and a
-metric is sought. To reproduce compile with NO_JEVENTS=1 then request a
-metric, for example, "perf stat -M IPC true".
-
-Committer testing:
-
-Before:
-
- $ make -k NO_JEVENTS=1 BUILD_BPF_SKEL=1 O=/tmp/build/perf-urgent -C tools/perf install-bin
- $ perf stat -M IPC true
- Segmentation fault (core dumped)
- $
-
-After:
-
- $ perf stat -M IPC true
-
- Usage: perf stat [<options>] [<command>]
-
- -M, --metrics <metric/metric group list>
- monitor specified metrics or metric groups (separated by ,)
- $
-
-Fixes: 00facc760903be66 ("perf jevents: Switch build to use jevents.py")
-Signed-off-by: Ian Rogers <irogers@google.com>
-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
-Cc: Andi Kleen <ak@linux.intel.com>
-Cc: Caleb Biggers <caleb.biggers@intel.com>
-Cc: Florian Fischer <florian.fischer@muhq.space>
-Cc: Ian Rogers <rogers.email@gmail.com>
-Cc: Ingo Molnar <mingo@redhat.com>
-Cc: James Clark <james.clark@arm.com>
-Cc: Jiri Olsa <jolsa@kernel.org>
-Cc: John Garry <john.garry@huawei.com>
-Cc: Kan Liang <kan.liang@linux.intel.com>
-Cc: Kshipra Bopardikar <kshipra.bopardikar@intel.com>
-Cc: Mark Rutland <mark.rutland@arm.com>
-Cc: Miaoqian Lin <linmq006@gmail.com>
-Cc: Namhyung Kim <namhyung@kernel.org>
-Cc: Perry Taylor <perry.taylor@intel.com>
-Cc: Peter Zijlstra <peterz@infradead.org>
-Cc: Stephane Eranian <eranian@google.com>
-Cc: Thomas Richter <tmricht@linux.ibm.com>
-Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
-Link: https://lore.kernel.org/r/20220830164846.401143-3-irogers@google.com
-Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- tools/perf/util/metricgroup.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
-index 29b747ac31c12..ee6c5582681bd 100644
---- a/tools/perf/util/metricgroup.c
-+++ b/tools/perf/util/metricgroup.c
-@@ -1258,6 +1258,9 @@ int metricgroup__parse_groups(const struct option *opt,
- struct evlist *perf_evlist = *(struct evlist **)opt->value;
- struct pmu_events_map *map = pmu_events_map__find();
-
-+ if (!table)
-+ return -EINVAL;
-+
- return parse_groups(perf_evlist, str, metric_no_group,
- metric_no_merge, NULL, metric_events, map);
- }
---
-2.40.1
-
xfs-fix-xfs_inodegc_stop-racing-with-mod_delayed_wor.patch
input-i8042-rename-i8042-x86ia64io.h-to-i8042-acpipn.patch
input-i8042-add-quirk-for-tuxedo-gemini-17-gen1-clev.patch
-perf-jevents-switch-build-to-use-jevents.py.patch
-perf-build-update-build-rule-for-generated-files.patch
netfilter-exthdr-add-support-for-tcp-option-removal.patch
netfilter-nft_exthdr-fix-non-linear-header-modificat.patch
ata-libata-rename-link-flag-ata_lflag_no_db_delay.patch
watchdog-itco_wdt-no-need-to-stop-the-timer-in-probe.patch
watchdog-itco_wdt-set-no_reboot-if-the-watchdog-is-n.patch
i40e-fix-potential-null-pointer-dereferencing-of-pf-.patch
-perf-metric-return-early-if-no-cpu-pmu-table-exists.patch
scsi-qla2xxx-fix-null-pointer-dereference-in-target-.patch
nvme-pci-always-return-an-err_ptr-from-nvme_pci_allo.patch
smack-record-transmuting-in-smk_transmuted.patch
+++ /dev/null
-From 26feebd1d2da2e353a5a3760be1bbc7823ad820b Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 27 Jul 2023 19:24:46 -0700
-Subject: perf build: Update build rule for generated files
-
-From: Namhyung Kim <namhyung@kernel.org>
-
-[ Upstream commit 7822a8913f4c51c7d1aff793b525d60c3384fb5b ]
-
-The bison and flex generate C files from the source (.y and .l)
-files. When O= option is used, they are saved in a separate directory
-but the default build rule assumes the .C files are in the source
-directory. So it might read invalid file if there are generated files
-from an old version. The same is true for the pmu-events files.
-
-For example, the following command would cause a build failure:
-
- $ git checkout v6.3
- $ make -C tools/perf # build in the same directory
-
- $ git checkout v6.5-rc2
- $ mkdir build # create a build directory
- $ make -C tools/perf O=build # build in a different directory but it
- # refers files in the source directory
-
-Let's update the build rule to specify those cases explicitly to depend
-on the files in the output directory.
-
-Note that it's not a complete fix and it needs the next patch for the
-include path too.
-
-Fixes: 80eeb67fe577aa76 ("perf jevents: Program to convert JSON file")
-Signed-off-by: Namhyung Kim <namhyung@kernel.org>
-Cc: Adrian Hunter <adrian.hunter@intel.com>
-Cc: Andi Kleen <ak@linux.intel.com>
-Cc: Anup Sharma <anupnewsmail@gmail.com>
-Cc: Ian Rogers <irogers@google.com>
-Cc: Ingo Molnar <mingo@kernel.org>
-Cc: Jiri Olsa <jolsa@kernel.org>
-Cc: Peter Zijlstra <peterz@infradead.org>
-Cc: stable@vger.kernel.org
-Link: https://lore.kernel.org/r/20230728022447.1323563-1-namhyung@kernel.org
-Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- tools/build/Makefile.build | 10 ++++++++++
- tools/perf/pmu-events/Build | 6 ++++++
- 2 files changed, 16 insertions(+)
-
-diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
-index cd72016c3cfa7..5a727094ae832 100644
---- a/tools/build/Makefile.build
-+++ b/tools/build/Makefile.build
-@@ -116,6 +116,16 @@ $(OUTPUT)%.s: %.c FORCE
- $(call rule_mkdir)
- $(call if_changed_dep,cc_s_c)
-
-+# bison and flex files are generated in the OUTPUT directory
-+# so it needs a separate rule to depend on them properly
-+$(OUTPUT)%-bison.o: $(OUTPUT)%-bison.c FORCE
-+ $(call rule_mkdir)
-+ $(call if_changed_dep,$(host)cc_o_c)
-+
-+$(OUTPUT)%-flex.o: $(OUTPUT)%-flex.c FORCE
-+ $(call rule_mkdir)
-+ $(call if_changed_dep,$(host)cc_o_c)
-+
- # Gather build data:
- # obj-y - list of build objects
- # subdir-y - list of directories to nest
-diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
-index 5ec5ce8c31bab..ea8c41f9c7398 100644
---- a/tools/perf/pmu-events/Build
-+++ b/tools/perf/pmu-events/Build
-@@ -25,3 +25,9 @@ $(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JSON_TEST) $(JEVENTS_PY)
- $(call rule_mkdir)
- $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(SRCARCH) pmu-events/arch $@
- endif
-+
-+# pmu-events.c file is generated in the OUTPUT directory so it needs a
-+# separate rule to depend on it properly
-+$(OUTPUT)pmu-events/pmu-events.o: $(PMU_EVENTS_C)
-+ $(call rule_mkdir)
-+ $(call if_changed_dep,cc_o_c)
---
-2.40.1
-
+++ /dev/null
-From 1e36316a137ae3efc9a190db022f9dc8719f2060 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 29 Jun 2022 11:25:04 -0700
-Subject: perf jevents: Switch build to use jevents.py
-
-From: Ian Rogers <rogers.email@gmail.com>
-
-[ Upstream commit 00facc760903be6675870c2749e2cd72140e396e ]
-
-Generate pmu-events.c using jevents.py rather than the binary built from
-jevents.c.
-
-Add a new config variable NO_JEVENTS that is set when there is no
-architecture json or an appropriate python interpreter isn't present.
-
-When NO_JEVENTS is defined the file pmu-events/empty-pmu-events.c is
-copied and used as the pmu-events.c file.
-
-Signed-off-by: Ian Rogers <irogers@google.com>
-Tested-by: John Garry <john.garry@huawei.com>
-Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
-Cc: Ananth Narayan <ananth.narayan@amd.com>
-Cc: Andi Kleen <ak@linux.intel.com>
-Cc: Andrew Kilroy <andrew.kilroy@arm.com>
-Cc: Caleb Biggers <caleb.biggers@intel.com>
-Cc: Felix Fietkau <nbd@nbd.name>
-Cc: Ian Rogers <rogers.email@gmail.com>
-Cc: Ingo Molnar <mingo@redhat.com>
-Cc: James Clark <james.clark@arm.com>
-Cc: Jiri Olsa <jolsa@kernel.org>
-Cc: Kajol Jain <kjain@linux.ibm.com>
-Cc: Kan Liang <kan.liang@linux.intel.com>
-Cc: Kshipra Bopardikar <kshipra.bopardikar@intel.com>
-Cc: Like Xu <likexu@tencent.com>
-Cc: Mark Rutland <mark.rutland@arm.com>
-Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
-Cc: Namhyung Kim <namhyung@kernel.org>
-Cc: Nick Forrington <nick.forrington@arm.com>
-Cc: Paul Clarke <pc@us.ibm.com>
-Cc: Perry Taylor <perry.taylor@intel.com>
-Cc: Peter Zijlstra <peterz@infradead.org>
-Cc: Qi Liu <liuqi115@huawei.com>
-Cc: Ravi Bangoria <ravi.bangoria@amd.com>
-Cc: Sandipan Das <sandipan.das@amd.com>
-Cc: Santosh Shukla <santosh.shukla@amd.com>
-Cc: Stephane Eranian <eranian@google.com>
-Cc: Will Deacon <will@kernel.org>
-Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
-Link: https://lore.kernel.org/r/20220629182505.406269-4-irogers@google.com
-Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-Stable-dep-of: 7822a8913f4c ("perf build: Update build rule for generated files")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- tools/perf/Makefile.config | 19 +++
- tools/perf/Makefile.perf | 1 +
- tools/perf/pmu-events/Build | 13 +-
- tools/perf/pmu-events/empty-pmu-events.c | 158 +++++++++++++++++++++++
- 4 files changed, 189 insertions(+), 2 deletions(-)
- create mode 100644 tools/perf/pmu-events/empty-pmu-events.c
-
-diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
-index e95281586f65e..b76800bbc632a 100644
---- a/tools/perf/Makefile.config
-+++ b/tools/perf/Makefile.config
-@@ -752,6 +752,25 @@ else
- endif
- endif
-
-+ifneq ($(NO_JEVENTS),1)
-+ ifeq ($(wildcard pmu-events/arch/$(SRCARCH)/mapfile.csv),)
-+ NO_JEVENTS := 1
-+ endif
-+endif
-+ifneq ($(NO_JEVENTS),1)
-+ NO_JEVENTS := 0
-+ ifndef PYTHON
-+ $(warning No python interpreter disabling jevent generation)
-+ NO_JEVENTS := 1
-+ else
-+ # jevents.py uses f-strings present in Python 3.6 released in Dec. 2016.
-+ JEVENTS_PYTHON_GOOD := $(shell $(PYTHON) -c 'import sys;print("1" if(sys.version_info.major >= 3 and sys.version_info.minor >= 6) else "0")' 2> /dev/null)
-+ ifneq ($(JEVENTS_PYTHON_GOOD), 1)
-+ $(warning Python interpreter too old (older than 3.6) disabling jevent generation)
-+ NO_JEVENTS := 1
-+ endif
-+ endif
-+endif
-
- ifndef NO_LIBBFD
- ifeq ($(feature-libbfd), 1)
-diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
-index 961f5e4fd6566..b0314f31e5a37 100644
---- a/tools/perf/Makefile.perf
-+++ b/tools/perf/Makefile.perf
-@@ -584,6 +584,7 @@ JEVENTS := $(OUTPUT)pmu-events/jevents
- JEVENTS_IN := $(OUTPUT)pmu-events/jevents-in.o
-
- PMU_EVENTS_IN := $(OUTPUT)pmu-events/pmu-events-in.o
-+export NO_JEVENTS
-
- export JEVENTS
-
-diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
-index a055dee6a46af..5ec5ce8c31bab 100644
---- a/tools/perf/pmu-events/Build
-+++ b/tools/perf/pmu-events/Build
-@@ -9,10 +9,19 @@ JSON = $(shell [ -d $(JDIR) ] && \
- JDIR_TEST = pmu-events/arch/test
- JSON_TEST = $(shell [ -d $(JDIR_TEST) ] && \
- find $(JDIR_TEST) -name '*.json')
-+JEVENTS_PY = pmu-events/jevents.py
-
- #
- # Locate/process JSON files in pmu-events/arch/
- # directory and create tables in pmu-events.c.
- #
--$(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JSON_TEST) $(JEVENTS)
-- $(Q)$(call echo-cmd,gen)$(JEVENTS) $(SRCARCH) pmu-events/arch $(OUTPUT)pmu-events/pmu-events.c $(V)
-+
-+ifeq ($(NO_JEVENTS),1)
-+$(OUTPUT)pmu-events/pmu-events.c: pmu-events/empty-pmu-events.c
-+ $(call rule_mkdir)
-+ $(Q)$(call echo-cmd,gen)cp $< $@
-+else
-+$(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JSON_TEST) $(JEVENTS_PY)
-+ $(call rule_mkdir)
-+ $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(SRCARCH) pmu-events/arch $@
-+endif
-diff --git a/tools/perf/pmu-events/empty-pmu-events.c b/tools/perf/pmu-events/empty-pmu-events.c
-new file mode 100644
-index 0000000000000..77e655c6f1162
---- /dev/null
-+++ b/tools/perf/pmu-events/empty-pmu-events.c
-@@ -0,0 +1,158 @@
-+// SPDX-License-Identifier: GPL-2.0
-+/*
-+ * An empty pmu-events.c file used when there is no architecture json files in
-+ * arch or when the jevents.py script cannot be run.
-+ *
-+ * The test cpu/soc is provided for testing.
-+ */
-+#include "pmu-events/pmu-events.h"
-+
-+static const struct pmu_event pme_test_soc_cpu[] = {
-+ {
-+ .name = "l3_cache_rd",
-+ .event = "event=0x40",
-+ .desc = "L3 cache access, read",
-+ .topic = "cache",
-+ .long_desc = "Attributable Level 3 cache access, read",
-+ },
-+ {
-+ .name = "segment_reg_loads.any",
-+ .event = "event=0x6,period=200000,umask=0x80",
-+ .desc = "Number of segment register loads",
-+ .topic = "other",
-+ },
-+ {
-+ .name = "dispatch_blocked.any",
-+ .event = "event=0x9,period=200000,umask=0x20",
-+ .desc = "Memory cluster signals to block micro-op dispatch for any reason",
-+ .topic = "other",
-+ },
-+ {
-+ .name = "eist_trans",
-+ .event = "event=0x3a,period=200000,umask=0x0",
-+ .desc = "Number of Enhanced Intel SpeedStep(R) Technology (EIST) transitions",
-+ .topic = "other",
-+ },
-+ {
-+ .name = "uncore_hisi_ddrc.flux_wcmd",
-+ .event = "event=0x2",
-+ .desc = "DDRC write commands. Unit: hisi_sccl,ddrc ",
-+ .topic = "uncore",
-+ .long_desc = "DDRC write commands",
-+ .pmu = "hisi_sccl,ddrc",
-+ },
-+ {
-+ .name = "unc_cbo_xsnp_response.miss_eviction",
-+ .event = "event=0x22,umask=0x81",
-+ .desc = "A cross-core snoop resulted from L3 Eviction which misses in some processor core. Unit: uncore_cbox ",
-+ .topic = "uncore",
-+ .long_desc = "A cross-core snoop resulted from L3 Eviction which misses in some processor core",
-+ .pmu = "uncore_cbox",
-+ },
-+ {
-+ .name = "event-hyphen",
-+ .event = "event=0xe0,umask=0x00",
-+ .desc = "UNC_CBO_HYPHEN. Unit: uncore_cbox ",
-+ .topic = "uncore",
-+ .long_desc = "UNC_CBO_HYPHEN",
-+ .pmu = "uncore_cbox",
-+ },
-+ {
-+ .name = "event-two-hyph",
-+ .event = "event=0xc0,umask=0x00",
-+ .desc = "UNC_CBO_TWO_HYPH. Unit: uncore_cbox ",
-+ .topic = "uncore",
-+ .long_desc = "UNC_CBO_TWO_HYPH",
-+ .pmu = "uncore_cbox",
-+ },
-+ {
-+ .name = "uncore_hisi_l3c.rd_hit_cpipe",
-+ .event = "event=0x7",
-+ .desc = "Total read hits. Unit: hisi_sccl,l3c ",
-+ .topic = "uncore",
-+ .long_desc = "Total read hits",
-+ .pmu = "hisi_sccl,l3c",
-+ },
-+ {
-+ .name = "uncore_imc_free_running.cache_miss",
-+ .event = "event=0x12",
-+ .desc = "Total cache misses. Unit: uncore_imc_free_running ",
-+ .topic = "uncore",
-+ .long_desc = "Total cache misses",
-+ .pmu = "uncore_imc_free_running",
-+ },
-+ {
-+ .name = "uncore_imc.cache_hits",
-+ .event = "event=0x34",
-+ .desc = "Total cache hits. Unit: uncore_imc ",
-+ .topic = "uncore",
-+ .long_desc = "Total cache hits",
-+ .pmu = "uncore_imc",
-+ },
-+ {
-+ .name = "bp_l1_btb_correct",
-+ .event = "event=0x8a",
-+ .desc = "L1 BTB Correction",
-+ .topic = "branch",
-+ },
-+ {
-+ .name = "bp_l2_btb_correct",
-+ .event = "event=0x8b",
-+ .desc = "L2 BTB Correction",
-+ .topic = "branch",
-+ },
-+ {
-+ .name = 0,
-+ .event = 0,
-+ .desc = 0,
-+ },
-+};
-+
-+const struct pmu_events_map pmu_events_map[] = {
-+ {
-+ .cpuid = "testcpu",
-+ .version = "v1",
-+ .type = "core",
-+ .table = pme_test_soc_cpu,
-+ },
-+ {
-+ .cpuid = 0,
-+ .version = 0,
-+ .type = 0,
-+ .table = 0,
-+ },
-+};
-+
-+static const struct pmu_event pme_test_soc_sys[] = {
-+ {
-+ .name = "sys_ddr_pmu.write_cycles",
-+ .event = "event=0x2b",
-+ .desc = "ddr write-cycles event. Unit: uncore_sys_ddr_pmu ",
-+ .compat = "v8",
-+ .topic = "uncore",
-+ .pmu = "uncore_sys_ddr_pmu",
-+ },
-+ {
-+ .name = "sys_ccn_pmu.read_cycles",
-+ .event = "config=0x2c",
-+ .desc = "ccn read-cycles event. Unit: uncore_sys_ccn_pmu ",
-+ .compat = "0x01",
-+ .topic = "uncore",
-+ .pmu = "uncore_sys_ccn_pmu",
-+ },
-+ {
-+ .name = 0,
-+ .event = 0,
-+ .desc = 0,
-+ },
-+};
-+
-+const struct pmu_sys_events pmu_sys_event_tables[] = {
-+ {
-+ .table = pme_test_soc_sys,
-+ .name = "pme_test_soc_sys",
-+ },
-+ {
-+ .table = 0
-+ },
-+};
---
-2.40.1
-
input-i8042-add-quirk-for-tuxedo-gemini-17-gen1-clev.patch
scsi-qla2xxx-fix-update_fcport-for-current_topology.patch
scsi-qla2xxx-fix-deletion-race-condition.patch
-perf-jevents-switch-build-to-use-jevents.py.patch
-perf-build-update-build-rule-for-generated-files.patch
clk-imx-clk-pll14xx-make-two-variables-static.patch
clk-imx-pll14xx-add-new-frequency-entries-for-pll144.patch
clk-imx-pll14xx-dynamically-configure-pll-for-393216.patch
+++ /dev/null
-From d52a59815cd0e28dfa2d0b817a3900d76d56333c Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 8 Sep 2023 21:39:22 +0800
-Subject: bpf: Ensure unit_size is matched with slab cache object size
-
-From: Hou Tao <houtao1@huawei.com>
-
-[ Upstream commit c930472552022bd09aab3cd946ba3f243070d5c7 ]
-
-Add extra check in bpf_mem_alloc_init() to ensure the unit_size of
-bpf_mem_cache is matched with the object_size of underlying slab cache.
-If these two sizes are unmatched, print a warning once and return
--EINVAL in bpf_mem_alloc_init(), so the mismatch can be found early and
-the potential issue can be prevented.
-
-Suggested-by: Alexei Starovoitov <ast@kernel.org>
-Signed-off-by: Hou Tao <houtao1@huawei.com>
-Link: https://lore.kernel.org/r/20230908133923.2675053-4-houtao@huaweicloud.com
-Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- kernel/bpf/memalloc.c | 33 +++++++++++++++++++++++++++++++--
- 1 file changed, 31 insertions(+), 2 deletions(-)
-
-diff --git a/kernel/bpf/memalloc.c b/kernel/bpf/memalloc.c
-index ace303a220ae8..f66a081195ac1 100644
---- a/kernel/bpf/memalloc.c
-+++ b/kernel/bpf/memalloc.c
-@@ -347,6 +347,24 @@ static void prefill_mem_cache(struct bpf_mem_cache *c, int cpu)
- alloc_bulk(c, c->unit_size <= 256 ? 4 : 1, cpu_to_node(cpu));
- }
-
-+static int check_obj_size(struct bpf_mem_cache *c, unsigned int idx)
-+{
-+ struct llist_node *first;
-+ unsigned int obj_size;
-+
-+ first = c->free_llist.first;
-+ if (!first)
-+ return 0;
-+
-+ obj_size = ksize(first);
-+ if (obj_size != c->unit_size) {
-+ WARN_ONCE(1, "bpf_mem_cache[%u]: unexpected object size %u, expect %u\n",
-+ idx, obj_size, c->unit_size);
-+ return -EINVAL;
-+ }
-+ return 0;
-+}
-+
- /* When size != 0 bpf_mem_cache for each cpu.
- * This is typical bpf hash map use case when all elements have equal size.
- *
-@@ -357,10 +375,10 @@ static void prefill_mem_cache(struct bpf_mem_cache *c, int cpu)
- int bpf_mem_alloc_init(struct bpf_mem_alloc *ma, int size, bool percpu)
- {
- static u16 sizes[NUM_CACHES] = {96, 192, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096};
-+ int cpu, i, err, unit_size, percpu_size = 0;
- struct bpf_mem_caches *cc, __percpu *pcc;
- struct bpf_mem_cache *c, __percpu *pc;
- struct obj_cgroup *objcg = NULL;
-- int cpu, i, unit_size, percpu_size = 0;
-
- if (size) {
- pc = __alloc_percpu_gfp(sizeof(*pc), 8, GFP_KERNEL);
-@@ -395,6 +413,7 @@ int bpf_mem_alloc_init(struct bpf_mem_alloc *ma, int size, bool percpu)
- pcc = __alloc_percpu_gfp(sizeof(*cc), 8, GFP_KERNEL);
- if (!pcc)
- return -ENOMEM;
-+ err = 0;
- #ifdef CONFIG_MEMCG_KMEM
- objcg = get_obj_cgroup_from_current();
- #endif
-@@ -405,10 +424,20 @@ int bpf_mem_alloc_init(struct bpf_mem_alloc *ma, int size, bool percpu)
- c->unit_size = sizes[i];
- c->objcg = objcg;
- prefill_mem_cache(c, cpu);
-+ err = check_obj_size(c, i);
-+ if (err)
-+ goto out;
- }
- }
-+
-+out:
- ma->caches = pcc;
-- return 0;
-+ /* refill_work is either zeroed or initialized, so it is safe to
-+ * call irq_work_sync().
-+ */
-+ if (err)
-+ bpf_mem_alloc_destroy(ma);
-+ return err;
- }
-
- static void drain_mem_cache(struct bpf_mem_cache *c)
---
-2.40.1
-
+++ /dev/null
-From 085ba292175109908bc60f7980bbdbbf58c7128a Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 27 Jul 2023 19:24:46 -0700
-Subject: perf build: Update build rule for generated files
-
-From: Namhyung Kim <namhyung@kernel.org>
-
-[ Upstream commit 7822a8913f4c51c7d1aff793b525d60c3384fb5b ]
-
-The bison and flex generate C files from the source (.y and .l)
-files. When O= option is used, they are saved in a separate directory
-but the default build rule assumes the .C files are in the source
-directory. So it might read invalid file if there are generated files
-from an old version. The same is true for the pmu-events files.
-
-For example, the following command would cause a build failure:
-
- $ git checkout v6.3
- $ make -C tools/perf # build in the same directory
-
- $ git checkout v6.5-rc2
- $ mkdir build # create a build directory
- $ make -C tools/perf O=build # build in a different directory but it
- # refers files in the source directory
-
-Let's update the build rule to specify those cases explicitly to depend
-on the files in the output directory.
-
-Note that it's not a complete fix and it needs the next patch for the
-include path too.
-
-Fixes: 80eeb67fe577aa76 ("perf jevents: Program to convert JSON file")
-Signed-off-by: Namhyung Kim <namhyung@kernel.org>
-Cc: Adrian Hunter <adrian.hunter@intel.com>
-Cc: Andi Kleen <ak@linux.intel.com>
-Cc: Anup Sharma <anupnewsmail@gmail.com>
-Cc: Ian Rogers <irogers@google.com>
-Cc: Ingo Molnar <mingo@kernel.org>
-Cc: Jiri Olsa <jolsa@kernel.org>
-Cc: Peter Zijlstra <peterz@infradead.org>
-Cc: stable@vger.kernel.org
-Link: https://lore.kernel.org/r/20230728022447.1323563-1-namhyung@kernel.org
-Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- tools/build/Makefile.build | 10 ++++++++++
- tools/perf/pmu-events/Build | 6 ++++++
- 2 files changed, 16 insertions(+)
-
-diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
-index 715092fc6a239..0f0aba16bdee7 100644
---- a/tools/build/Makefile.build
-+++ b/tools/build/Makefile.build
-@@ -116,6 +116,16 @@ $(OUTPUT)%.s: %.c FORCE
- $(call rule_mkdir)
- $(call if_changed_dep,cc_s_c)
-
-+# bison and flex files are generated in the OUTPUT directory
-+# so it needs a separate rule to depend on them properly
-+$(OUTPUT)%-bison.o: $(OUTPUT)%-bison.c FORCE
-+ $(call rule_mkdir)
-+ $(call if_changed_dep,$(host)cc_o_c)
-+
-+$(OUTPUT)%-flex.o: $(OUTPUT)%-flex.c FORCE
-+ $(call rule_mkdir)
-+ $(call if_changed_dep,$(host)cc_o_c)
-+
- # Gather build data:
- # obj-y - list of build objects
- # subdir-y - list of directories to nest
-diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
-index 04ef95174660b..fcb61b94f1306 100644
---- a/tools/perf/pmu-events/Build
-+++ b/tools/perf/pmu-events/Build
-@@ -25,3 +25,9 @@ $(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JSON_TEST) $(JEVENTS_PY)
- $(call rule_mkdir)
- $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(JEVENTS_ARCH) pmu-events/arch $@
- endif
-+
-+# pmu-events.c file is generated in the OUTPUT directory so it needs a
-+# separate rule to depend on it properly
-+$(OUTPUT)pmu-events/pmu-events.o: $(PMU_EVENTS_C)
-+ $(call rule_mkdir)
-+ $(call if_changed_dep,cc_o_c)
---
-2.40.1
-
media-v4l-use-correct-dependency-for-camera-sensor-d.patch
media-via-use-correct-dependency-for-camera-sensor-d.patch
netfs-only-call-folio_start_fscache-one-time-for-eac.patch
-perf-build-update-build-rule-for-generated-files.patch
dm-fix-a-race-condition-in-retrieve_deps.patch
btrfs-improve-error-message-after-failure-to-add-del.patch
btrfs-remove-bug-after-failure-to-insert-delayed-dir.patch
spi-stm32-add-a-delay-before-spi-disable.patch
asoc-fsl-imx-pcm-rpmsg-add-sndrv_pcm_info_batch-flag.patch
spi-intel-pci-add-support-for-granite-rapids-spi-ser.patch
-bpf-ensure-unit_size-is-matched-with-slab-cache-obje.patch
bpf-clarify-error-expectations-from-bpf_clone_redire.patch
alsa-hda-intel-sdw-acpi-use-u8-type-for-link-index.patch
asoc-cs42l42-ensure-a-reset-pulse-meets-minimum-puls.patch
+++ /dev/null
-From f0255aec1eb41ec35646e43ee18dde9a9edf0191 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 8 Sep 2023 21:39:22 +0800
-Subject: bpf: Ensure unit_size is matched with slab cache object size
-
-From: Hou Tao <houtao1@huawei.com>
-
-[ Upstream commit c930472552022bd09aab3cd946ba3f243070d5c7 ]
-
-Add extra check in bpf_mem_alloc_init() to ensure the unit_size of
-bpf_mem_cache is matched with the object_size of underlying slab cache.
-If these two sizes are unmatched, print a warning once and return
--EINVAL in bpf_mem_alloc_init(), so the mismatch can be found early and
-the potential issue can be prevented.
-
-Suggested-by: Alexei Starovoitov <ast@kernel.org>
-Signed-off-by: Hou Tao <houtao1@huawei.com>
-Link: https://lore.kernel.org/r/20230908133923.2675053-4-houtao@huaweicloud.com
-Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- kernel/bpf/memalloc.c | 33 +++++++++++++++++++++++++++++++--
- 1 file changed, 31 insertions(+), 2 deletions(-)
-
-diff --git a/kernel/bpf/memalloc.c b/kernel/bpf/memalloc.c
-index 0668bcd7c926f..bcf84e71f549c 100644
---- a/kernel/bpf/memalloc.c
-+++ b/kernel/bpf/memalloc.c
-@@ -370,6 +370,24 @@ static void prefill_mem_cache(struct bpf_mem_cache *c, int cpu)
- alloc_bulk(c, c->unit_size <= 256 ? 4 : 1, cpu_to_node(cpu));
- }
-
-+static int check_obj_size(struct bpf_mem_cache *c, unsigned int idx)
-+{
-+ struct llist_node *first;
-+ unsigned int obj_size;
-+
-+ first = c->free_llist.first;
-+ if (!first)
-+ return 0;
-+
-+ obj_size = ksize(first);
-+ if (obj_size != c->unit_size) {
-+ WARN_ONCE(1, "bpf_mem_cache[%u]: unexpected object size %u, expect %u\n",
-+ idx, obj_size, c->unit_size);
-+ return -EINVAL;
-+ }
-+ return 0;
-+}
-+
- /* When size != 0 bpf_mem_cache for each cpu.
- * This is typical bpf hash map use case when all elements have equal size.
- *
-@@ -380,10 +398,10 @@ static void prefill_mem_cache(struct bpf_mem_cache *c, int cpu)
- int bpf_mem_alloc_init(struct bpf_mem_alloc *ma, int size, bool percpu)
- {
- static u16 sizes[NUM_CACHES] = {96, 192, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096};
-+ int cpu, i, err, unit_size, percpu_size = 0;
- struct bpf_mem_caches *cc, __percpu *pcc;
- struct bpf_mem_cache *c, __percpu *pc;
- struct obj_cgroup *objcg = NULL;
-- int cpu, i, unit_size, percpu_size = 0;
-
- if (size) {
- pc = __alloc_percpu_gfp(sizeof(*pc), 8, GFP_KERNEL);
-@@ -419,6 +437,7 @@ int bpf_mem_alloc_init(struct bpf_mem_alloc *ma, int size, bool percpu)
- pcc = __alloc_percpu_gfp(sizeof(*cc), 8, GFP_KERNEL);
- if (!pcc)
- return -ENOMEM;
-+ err = 0;
- #ifdef CONFIG_MEMCG_KMEM
- objcg = get_obj_cgroup_from_current();
- #endif
-@@ -429,10 +448,20 @@ int bpf_mem_alloc_init(struct bpf_mem_alloc *ma, int size, bool percpu)
- c->unit_size = sizes[i];
- c->objcg = objcg;
- prefill_mem_cache(c, cpu);
-+ err = check_obj_size(c, i);
-+ if (err)
-+ goto out;
- }
- }
-+
-+out:
- ma->caches = pcc;
-- return 0;
-+ /* refill_work is either zeroed or initialized, so it is safe to
-+ * call irq_work_sync().
-+ */
-+ if (err)
-+ bpf_mem_alloc_destroy(ma);
-+ return err;
- }
-
- static void drain_mem_cache(struct bpf_mem_cache *c)
---
-2.40.1
-
spi-stm32-add-a-delay-before-spi-disable.patch
asoc-fsl-imx-pcm-rpmsg-add-sndrv_pcm_info_batch-flag.patch
spi-intel-pci-add-support-for-granite-rapids-spi-ser.patch
-bpf-ensure-unit_size-is-matched-with-slab-cache-obje.patch
bpf-clarify-error-expectations-from-bpf_clone_redire.patch
asoc-rt5640-only-cancel-jack-detect-work-on-suspend-.patch
alsa-hda-intel-sdw-acpi-use-u8-type-for-link-index.patch