[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 3/6] target/arm: Always add pmu property for Armv7-A/R+
From: |
Akihiko Odaki |
Subject: |
[PATCH v4 3/6] target/arm: Always add pmu property for Armv7-A/R+ |
Date: |
Sat, 20 Jul 2024 18:30:51 +0900 |
kvm-steal-time and sve properties are added for KVM even if the
corresponding features are not available. Always add pmu property for
Armv8. Note that the property is added only for Armv7-A/R+ as QEMU
currently emulates PMU only for such versions, and a different
version may have a different definition of PMU or may not have one at
all.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
target/arm/cpu.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 19191c239181..c1955a82fb3c 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1741,6 +1741,10 @@ void arm_cpu_post_init(Object *obj)
if (!arm_feature(&cpu->env, ARM_FEATURE_M)) {
qdev_property_add_static(DEVICE(obj), &arm_cpu_reset_hivecs_property);
+
+ if (arm_feature(&cpu->env, ARM_FEATURE_V7)) {
+ object_property_add_bool(obj, "pmu", arm_get_pmu, arm_set_pmu);
+ }
}
if (arm_feature(&cpu->env, ARM_FEATURE_V8)) {
@@ -1770,7 +1774,6 @@ void arm_cpu_post_init(Object *obj)
if (arm_feature(&cpu->env, ARM_FEATURE_PMU)) {
cpu->has_pmu = true;
- object_property_add_bool(obj, "pmu", arm_get_pmu, arm_set_pmu);
}
/*
--
2.45.2
- [PATCH v4 0/6] target/arm/kvm: Report PMU unavailability, Akihiko Odaki, 2024/07/20
- [PATCH v4 1/6] target/arm/kvm: Set PMU for host only when available, Akihiko Odaki, 2024/07/20
- [PATCH v4 2/6] target/arm/kvm: Do not silently remove PMU, Akihiko Odaki, 2024/07/20
- [PATCH v4 3/6] target/arm: Always add pmu property for Armv7-A/R+,
Akihiko Odaki <=
- [PATCH v4 4/6] hvf: arm: Raise an exception for sysreg by default, Akihiko Odaki, 2024/07/20
- [PATCH v4 5/6] hvf: arm: Properly disable PMU, Akihiko Odaki, 2024/07/20
- [PATCH v4 6/6] hvf: arm: Do not advance PC when raising an exception, Akihiko Odaki, 2024/07/20
- Re: [PATCH v4 0/6] target/arm/kvm: Report PMU unavailability, Peter Maydell, 2024/07/29