linux/arch/arm64
Lorenzo Pieralisi f436b2ac90 arm64: kernel: fix architected PMU registers unconditional access
The Performance Monitors extension is an optional feature of the
AArch64 architecture, therefore, in order to access Performance
Monitors registers safely, the kernel should detect the architected
PMU unit presence through the ID_AA64DFR0_EL1 register PMUVer field
before accessing them.

This patch implements a guard by reading the ID_AA64DFR0_EL1 register
PMUVer field to detect the architected PMU presence and prevent accessing
PMU system registers if the Performance Monitors extension is not
implemented in the core.

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: <stable@vger.kernel.org>
Fixes: 60792ad349 ("arm64: kernel: enforce pmuserenr_el0 initialization and restore")
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2016-01-25 11:09:06 +00:00
..
boot ARM: SoC support for Tegra platforms for v4.5 2016-01-22 17:30:52 -08:00
configs Third Round of Renesas ARM64 Based SoC Defconfig Updates for v4.5 2015-12-22 12:50:29 -08:00
crypto arm64: crypto: reduce priority of core AES cipher 2015-11-18 12:09:08 +00:00
include dma-mapping: always provide the dma_map_ops based implementation 2016-01-20 17:09:18 -08:00
kernel arm64: kernel: fix architected PMU registers unconditional access 2016-01-25 11:09:06 +00:00
kvm arm64: KVM: Add support for 16-bit VMID 2015-12-18 10:15:12 +00:00
lib arm64: add KASAN support 2015-10-12 17:46:36 +01:00
mm arm64: kernel: fix architected PMU registers unconditional access 2016-01-25 11:09:06 +00:00
net arm64: bpf: add extra pass to handle faulty codegen 2016-01-17 19:15:26 -05:00
xen xen/arm: introduce HYPERVISOR_platform_op on arm and arm64 2015-12-21 14:40:56 +00:00
Kconfig dma-mapping: always provide the dma_map_ops based implementation 2016-01-20 17:09:18 -08:00
Kconfig.debug arch: consolidate CONFIG_STRICT_DEVM in lib/Kconfig.debug 2016-01-09 06:30:49 -08:00
Kconfig.platforms ARM: SoC support for Tegra platforms for v4.5 2016-01-22 17:30:52 -08:00
Makefile arm64 updates for 4.4: 2015-11-04 14:47:13 -08:00