linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] arm64/perf: Assert all platform event flags are within PERF_EVENT_FLAG_ARCH
       [not found] <20220829065507.177781-1-anshuman.khandual@arm.com>
@ 2022-08-29  6:55 ` Anshuman Khandual
  0 siblings, 0 replies; only message in thread
From: Anshuman Khandual @ 2022-08-29  6:55 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, peterz
  Cc: Anshuman Khandual, Will Deacon, Catalin Marinas, Ingo Molnar,
	Arnaldo Carvalho de Melo, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, linux-arm-kernel

Ensure all platform specific event flags are within PERF_EVENT_FLAG_ARCH.

Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-perf-users@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
 arch/arm64/kernel/perf_event.c  | 1 +
 drivers/perf/apple_m1_cpu_pmu.c | 1 +
 drivers/perf/arm_spe_pmu.c      | 1 +
 3 files changed, 3 insertions(+)

diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
index cb69ff1e6138..cf9cedb07f92 100644
--- a/arch/arm64/kernel/perf_event.c
+++ b/arch/arm64/kernel/perf_event.c
@@ -1390,6 +1390,7 @@ static struct platform_driver armv8_pmu_driver = {
 
 static int __init armv8_pmu_driver_init(void)
 {
+	BUILD_BUG_ON(~PERF_EVENT_FLAG_ARCH & ARMPMU_EVT_64BIT);
 	if (acpi_disabled)
 		return platform_driver_register(&armv8_pmu_driver);
 	else
diff --git a/drivers/perf/apple_m1_cpu_pmu.c b/drivers/perf/apple_m1_cpu_pmu.c
index 979a7c2b4f56..9ec8c694d0f2 100644
--- a/drivers/perf/apple_m1_cpu_pmu.c
+++ b/drivers/perf/apple_m1_cpu_pmu.c
@@ -568,6 +568,7 @@ MODULE_DEVICE_TABLE(of, m1_pmu_of_device_ids);
 
 static int m1_pmu_device_probe(struct platform_device *pdev)
 {
+	BUILD_BUG_ON(~PERF_EVENT_FLAG_ARCH & ARMPMU_EVT_47BIT);
 	return arm_pmu_device_probe(pdev, m1_pmu_of_device_ids, NULL);
 }
 
diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c
index b65a7d9640e1..74344abf4b11 100644
--- a/drivers/perf/arm_spe_pmu.c
+++ b/drivers/perf/arm_spe_pmu.c
@@ -1276,6 +1276,7 @@ static int __init arm_spe_pmu_init(void)
 	if (ret)
 		cpuhp_remove_multi_state(arm_spe_pmu_online);
 
+	BUILD_BUG_ON(~PERF_EVENT_FLAG_ARCH & SPE_PMU_HW_FLAGS_CX);
 	return ret;
 }
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-29  6:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20220829065507.177781-1-anshuman.khandual@arm.com>
2022-08-29  6:55 ` [PATCH 2/3] arm64/perf: Assert all platform event flags are within PERF_EVENT_FLAG_ARCH Anshuman Khandual

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).