On 9/1/24 19:09, Philippe Mathieu-Daudé wrote:
The "has_el3" property is added to ARMCPU when the
ARM_FEATURE_EL3 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/exynos4210.c | 4 ++--
hw/arm/integratorcp.c | 5 ++---
hw/arm/realview.c | 2 +-
hw/arm/versatilepb.c | 5 ++---
hw/arm/xilinx_zynq.c | 2 +-
hw/cpu/a15mpcore.c | 11 +++++++----
hw/cpu/a9mpcore.c | 6 +++---
7 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c
index bfd8aa5644..cebfe142cf 100644
--- a/hw/cpu/a15mpcore.c
+++ b/hw/cpu/a15mpcore.c
@@ -53,7 +53,6 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp)
DeviceState *gicdev;
SysBusDevice *busdev;
int i;
- bool has_el3;
bool has_el2 = false;
Object *cpuobj;
@@ -62,13 +61,17 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp)
qdev_prop_set_uint32(gicdev, "num-irq", s->num_irq);
if (!kvm_irqchip_in_kernel()) {
+ CPUState *cpu;
+
/* Make the GIC's TZ support match the CPUs. We assume that
* either all the CPUs have TZ, or none do.
*/
- cpuobj = OBJECT(qemu_get_cpu(0));
- has_el3 = object_property_find(cpuobj, "has_el3") &&
+ cpu = qemu_get_cpu(0);
+ cpuobj = OBJECT(cpu);
+ if (arm_feature(cpu_env(cpu), ARM_FEATURE_EL3)) {
object_property_get_bool(cpuobj, "has_el3", &error_abort);
This requires the same change than a9mp_priv_realize(), so squashing:
-- >8 --
if (arm_feature(cpu_env(cpu), ARM_FEATURE_EL3)) {
- object_property_get_bool(cpuobj, "has_el3", &error_abort);
- qdev_prop_set_bit(gicdev, "has-security-extensions", true);
+ qdev_prop_set_bit(gicdev, "has-security-extensions",
+ object_property_get_bool(cpuobj, "has_el3",
+ &error_abort));
}
---
- qdev_prop_set_bit(gicdev, "has-security-extensions", has_el3);
+ qdev_prop_set_bit(gicdev, "has-security-extensions", true);
+ }
/* Similarly for virtualization support */
has_el2 = object_property_find(cpuobj, "has_el2") &&
object_property_get_bool(cpuobj, "has_el2", &error_abort);