xen/arm: Implement a dummy Performance Monitor for ARM32
authorJulien Grall <julien.grall@linaro.org>
Thu, 24 Apr 2014 22:45:54 +0000 (23:45 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 13 Jun 2014 11:40:58 +0000 (12:40 +0100)
commitaa0d443718372b46c432af7cb6274050cda32fc6
tree47789c72e49a3d853e6e34b646945ca4e3fddf16
parent12a5f2b892ef56bdce7e93f29e2312714c577f2d
xen/arm: Implement a dummy Performance Monitor for ARM32

XSA-93 (commit 0b18220 "xen/arm: Don't let guess access to Debug and Performance
Monitor registers") disable Performance Monitor.

When CONFIG_PERF_EVENTS is enabled in the Linux Kernel, regardless the
ID_DFR0 (which tell if Perfomance Monitors Extension is implemented) the
kernel will try to access to PMCR.

Therefore we tell the guest we have 0 counters. Unfortunately we must always
support PMCCNTR (the cycle counter): we just RAZ/WI for all PM register,
which doesn't crash the kernel at least.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/traps.c
xen/include/asm-arm/cpregs.h