summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAnshuman Khandual <anshuman.khandual@arm.com>2022-09-07 11:19:23 +0200
committerPeter Zijlstra <peterz@infradead.org>2022-09-07 21:54:01 +0200
commit91207f62616f9f51b52436364e6d064f002e9112 (patch)
treee0645862b754f38f1fd61b84d8b9b446c56f5a9a /drivers
parentperf/core: Assert PERF_EVENT_FLAG_ARCH does not overlap with generic flags (diff)
downloadlinux-91207f62616f9f51b52436364e6d064f002e9112.tar.xz
linux-91207f62616f9f51b52436364e6d064f002e9112.zip
arm64/perf: Assert all platform event flags are within PERF_EVENT_FLAG_ARCH
Ensure all platform specific event flags are within PERF_EVENT_FLAG_ARCH. Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: James Clark <james.clark@arm.com> Link: https://lkml.kernel.org/r/20220907091924.439193-4-anshuman.khandual@arm.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/perf/arm_spe_pmu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c
index b65a7d9640e1..db8a0a841062 100644
--- a/drivers/perf/arm_spe_pmu.c
+++ b/drivers/perf/arm_spe_pmu.c
@@ -44,7 +44,9 @@
* This allows us to perform the check, i.e, perfmon_capable(),
* in the context of the event owner, once, during the event_init().
*/
-#define SPE_PMU_HW_FLAGS_CX BIT(0)
+#define SPE_PMU_HW_FLAGS_CX 0x00001
+
+static_assert((PERF_EVENT_FLAG_ARCH & SPE_PMU_HW_FLAGS_CX) == SPE_PMU_HW_FLAGS_CX);
static void set_spe_event_has_cx(struct perf_event *event)
{