Re: [PATCH] arm_pmu: Validate single/group leader events

From: Rob Herring
Date: Mon Apr 11 2022 - 10:14:11 EST


On Mon, Apr 11, 2022 at 11:04:26AM +0100, Mark Rutland wrote:
> Hi Rob,
>
> On Fri, Apr 08, 2022 at 03:33:30PM -0500, Rob Herring wrote:
> > In the case where there is only a cycle counter available (i.e.
> > PMCR_EL0.N is 0) and an event other than CPU cycles is opened, the open
> > should fail as the event can never possibly be scheduled. However, the
> > event validation when an event is opened is skipped when the group
> > leader is opened. Fix this by always validating the group leader events.
> >
> > Reported-by: Al Grant <al.grant@xxxxxxx>
> > Cc: Will Deacon <will@xxxxxxxxxx>
> > Cc: Mark Rutland <mark.rutland@xxxxxxx>
> > Signed-off-by: Rob Herring <robh@xxxxxxxxxx>
>
> This looks obviously correct to me, so FWIW:
>
> Acked-by: Mark Rutland <mark.rutland@xxxxxxx>

Thanks.

> Just to check, have you tested this (e.g. by running on a platform with
> PMCR_EL0.N == 0, or hacking the PMU probing to report just the cycle counter)

Yes, tested on FVP with 0 counters running the libperf evsel userspace
access tests as that tries both the cycle counter and instruction
counts.

Rob