arm64: Add PMU event filtering option

In order to be able to let kvmtool specify which PMU events to
allow or deny, allow a --pmu-filter option to be passed on the
command line. The expected syntax is:

  --pmu-filter "{A,D}:start-end[,...]"

where A means "allow" and D means "deny", start is the first event
of the range and end the last one. For example:

  --pmu-filter "A:0x11-0x11,A:0x23-0x3a,D:0x30-0x30"

allows event 0x11 (the cycle counter), events 0x23 to 0x3a except
for event 0x30, and all the other events are disallowed.

Signed-off-by: Marc Zyngier <maz@kernel.org>
3 files changed