[PATCH 5/5] arm/perfevents: implement perf event support for ARMv6

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Jan 21 07:45:37 EST 2010


On Thu, Jan 21, 2010 at 12:34:22PM -0000, Will Deacon wrote:
> For the v7 PMU, we can do a bit better than that because the PMU
> is defined by the architecture. If you read the DIDR[19:16] and it
> returns either 3 or 4, you have a v7 PMU present so you can make use of
> the architecturally defined events regardless of the implementer.

However, you can't just check DIDR - DIDR doesn't exist unless you have
the new ID scheme - and you can tell that by:

if MIDR[31:28] != 0x41 || (MIDR[12:15] != 0 && MIDR[12:15] != 7)
	newid = MIDR[19:16] == 15
else
	newid = 0

or currently check for cpu_architecture() >= CPU_ARCH_ARMv6 &&
MIDR[19:16] == 15 (the additional qualification is needed because ARMv6
CPUs can have either the old or new schemes.)

However, what also needs checking is how DIDR is specified for ARMv6,
and whether that clashes with the ARMv7 version - as I mentioned before,
the new ID scheme is not without its own set of weird changes as well.



More information about the linux-arm-kernel mailing list