diff options
author | Akihiko Odaki <akihiko.odaki@daynix.com> | 2024-07-20 18:30:49 +0900 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2024-07-29 14:50:25 +0100 |
commit | 613d0b8ebbf1fa32f8037cb02b7c82f96011ef2d (patch) | |
tree | 38a7ad7f094405135a6fd36b514a7bdae3348756 /target | |
parent | 8deba2f36e9f7e34bf1805b08e69699486481c8a (diff) |
target/arm/kvm: Set PMU for host only when available
target/arm/kvm.c checked PMU availability but unconditionally set the
PMU feature flag for the host CPU model, which is confusing. Set the
feature flag only when available.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target')
-rw-r--r-- | target/arm/kvm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 70f79eda33..b20a35052f 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -280,6 +280,7 @@ static bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) if (kvm_arm_pmu_supported()) { init.features[0] |= 1 << KVM_ARM_VCPU_PMU_V3; pmu_supported = true; + features |= 1ULL << ARM_FEATURE_PMU; } if (!kvm_arm_create_scratch_host_vcpu(cpus_to_try, fdarray, &init)) { @@ -448,7 +449,6 @@ static bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) features |= 1ULL << ARM_FEATURE_V8; features |= 1ULL << ARM_FEATURE_NEON; features |= 1ULL << ARM_FEATURE_AARCH64; - features |= 1ULL << ARM_FEATURE_PMU; features |= 1ULL << ARM_FEATURE_GENERIC_TIMER; ahcf->features = features; |