On 9/1/24 19:09, Philippe Mathieu-Daudé wrote:
The "has_el2" property is added to ARMCPU when the
ARM_FEATURE_EL2 feature is available. Rather than
checking whether the QOM property is present, directly
check the feature.
Suggested-by: Markus Armbruster <arm...@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
hw/arm/vexpress.c | 3 ++-
hw/arm/virt.c | 2 +-
hw/cpu/a15mpcore.c | 6 ++++--
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c
index cebfe142cf..1fa079b3b8 100644
--- a/hw/cpu/a15mpcore.c
+++ b/hw/cpu/a15mpcore.c
@@ -73,9 +73,11 @@ static void a15mp_priv_realize(DeviceState *dev, Error
**errp)
qdev_prop_set_bit(gicdev, "has-security-extensions", true);
}
/* Similarly for virtualization support */
- has_el2 = object_property_find(cpuobj, "has_el2") &&
+ has_el2 = arm_feature(cpu_env(cpu), ARM_FEATURE_EL2);
+ if (has_el2) {
object_property_get_bool(cpuobj, "has_el2", &error_abort);
Missing to be squashed on top:
-- >8 --
if (has_el2) {
- object_property_get_bool(cpuobj, "has_el2", &error_abort);
- qdev_prop_set_bit(gicdev, "has-virtualization-extensions",
true);
+ qdev_prop_set_bit(gicdev, "has-virtualization-extensions",
+ object_property_get_bool(cpuobj, "has_el2",
+ &error_abort));
}
---
- qdev_prop_set_bit(gicdev, "has-virtualization-extensions", has_el2);
+ qdev_prop_set_bit(gicdev, "has-virtualization-extensions", true);
+ }
}
if (!sysbus_realize(SYS_BUS_DEVICE(&s->gic), errp)) {