aboutsummaryrefslogtreecommitdiff
path: root/target/arm/kvm64.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-03-30 14:05:33 +0100
committerPeter Maydell <peter.maydell@linaro.org>2021-03-30 14:05:33 +0100
commitf7fb73b8cdd3f77e26f9fcff8cf24ff1b58d200f (patch)
tree4871056b9e8f1f77600012dc197a3fad6cd5d91a /target/arm/kvm64.c
parent6c1bd93954cbdd70d8bdcd67b1f01d759747d895 (diff)
downloadqemu-f7fb73b8cdd3f77e26f9fcff8cf24ff1b58d200f.zip
qemu-f7fb73b8cdd3f77e26f9fcff8cf24ff1b58d200f.tar.gz
qemu-f7fb73b8cdd3f77e26f9fcff8cf24ff1b58d200f.tar.bz2
target/arm: Make number of counters in PMCR follow the CPU
Currently we give all the v7-and-up CPUs a PMU with 4 counters. This means that we don't provide the 6 counters that are required by the Arm BSA (Base System Architecture) specification if the CPU supports the Virtualization extensions. Instead of having a single PMCR_NUM_COUNTERS, make each CPU type specify the PMCR reset value (obtained from the appropriate TRM), and use the 'N' field of that value to define the number of counters provided. This means that we now supply 6 counters for Cortex-A53, A57, A72, A15 and A9 as well as '-cpu max'; Cortex-A7 and A8 stay at 4; and Cortex-R5 goes down to 3. Note that because we now use the PMCR reset value of the specific implementation, we no longer set the LC bit out of reset. This has an UNKNOWN value out of reset for all cores with any AArch32 support, so guest software should be setting it anyway if it wants it. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> Message-id: 20210311165947.27470-1-peter.maydell@linaro.org Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/arm/kvm64.c')
-rw-r--r--target/arm/kvm64.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c
index dff85f6..581335e 100644
--- a/target/arm/kvm64.c
+++ b/target/arm/kvm64.c
@@ -566,6 +566,8 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
ARM64_SYS_REG(3, 0, 0, 7, 1));
err |= read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64mmfr2,
ARM64_SYS_REG(3, 0, 0, 7, 2));
+ err |= read_sys_reg64(fdarray[2], &ahcf->isar.reset_pmcr_el0,
+ ARM64_SYS_REG(3, 3, 9, 12, 0));
/*
* Note that if AArch32 support is not present in the host,