summaryrefslogtreecommitdiff
path: root/drivers/perf
diff options
context:
space:
mode:
authorAnshuman Khandual <anshuman.khandual@arm.com>2022-09-07 14:49:23 +0530
committerPeter Zijlstra <peterz@infradead.org>2022-09-07 21:54:01 +0200
commit91207f62616f9f51b52436364e6d064f002e9112 (patch)
treee0645862b754f38f1fd61b84d8b9b446c56f5a9a /drivers/perf
parentf67dd218fafd9de9a13d095e775b621db76a058f (diff)
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/perf')
-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)
{