[PATCH 05/10] powerpc/pmu/fsl: add additional validation to event_init
From: Andrew Murray
Date: Fri Nov 16 2018 - 05:24:43 EST
The fsl PMU driver doesn't support host/guest mode exclusion so
let's report this when event_init is called with these exclusion
flags set.
Signed-off-by: Andrew Murray <andrew.murray@xxxxxxx>
---
arch/powerpc/perf/core-fsl-emb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/perf/core-fsl-emb.c b/arch/powerpc/perf/core-fsl-emb.c
index ba48584..b1cc9d1 100644
--- a/arch/powerpc/perf/core-fsl-emb.c
+++ b/arch/powerpc/perf/core-fsl-emb.c
@@ -559,6 +559,8 @@ static int fsl_emb_pmu_event_init(struct perf_event *event)
event->hw.config_base |= PMLCA_FCS;
if (event->attr.exclude_idle)
return -ENOTSUPP;
+ if (event->attr.exclude_host || event->attr.exclude_guest)
+ return -ENOTSUPP;
event->hw.last_period = event->hw.sample_period;
local64_set(&event->hw.period_left, event->hw.last_period);
--
2.7.4