aboutsummaryrefslogtreecommitdiff
path: root/target/arm/cpu.c
diff options
context:
space:
mode:
authorAaron Lindsay <aaron@os.amperecomputing.com>2019-01-21 10:23:14 +0000
committerPeter Maydell <peter.maydell@linaro.org>2019-01-21 10:38:55 +0000
commit033614c47de78409ad3fb39bb7bd1483b71c6789 (patch)
tree12e5ac5417491920c162c921df145c041b7a0b07 /target/arm/cpu.c
parent980ebe87053792a5bdefaa87777c40914fd4f673 (diff)
downloadqemu-033614c47de78409ad3fb39bb7bd1483b71c6789.zip
qemu-033614c47de78409ad3fb39bb7bd1483b71c6789.tar.gz
qemu-033614c47de78409ad3fb39bb7bd1483b71c6789.tar.bz2
target/arm: Filter cycle counter based on PMCCFILTR_EL0
Rename arm_ccnt_enabled to pmu_counter_enabled, and add logic to only return 'true' if the specified counter is enabled and neither prohibited or filtered. Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org> Signed-off-by: Aaron Lindsay <aclindsa@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20181211151945.29137-5-aaron@os.amperecomputing.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/arm/cpu.c')
-rw-r--r--target/arm/cpu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 14bc24a..317e10c 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1038,6 +1038,9 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
if (!cpu->has_pmu) {
unset_feature(env, ARM_FEATURE_PMU);
cpu->id_aa64dfr0 &= ~0xf00;
+ } else if (!kvm_enabled()) {
+ arm_register_pre_el_change_hook(cpu, &pmu_pre_el_change, 0);
+ arm_register_el_change_hook(cpu, &pmu_post_el_change, 0);
}
if (!arm_feature(env, ARM_FEATURE_EL2)) {