arm64: perf: correct PMUVer probing
authorMark Rutland <mark.rutland@arm.com>
Wed, 14 Feb 2018 17:21:57 +0000 (17:21 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:51:59 +0000 (07:51 +0200)
commitc5c0632b9c7b80914f8704b10e2ebd4adf41ed2a
tree2619377b145efd6e9fe668f85aa3860161468650
parent33b3f7b5af5dbd7364c98845350e68b325c8f265
arm64: perf: correct PMUVer probing

[ Upstream commit 0331365edb1d6ccd6ae68b1038111da85d4c68d1 ]

The ID_AA64DFR0_EL1.PMUVer field doesn't follow the usual ID registers
scheme. While value 0xf indicates a non-architected PMU is implemented,
values 0x1 to 0xe indicate an increasingly featureful architected PMU,
as if the field were unsigned.

For more details, see ARM DDI 0487C.a, D10.1.4, "Alternative ID scheme
used for the Performance Monitors Extension version".

Currently, we treat the field as signed, and erroneously bail out for
values 0x8 to 0xe. Let's correct that.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/perf_event.c