[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 11/14] hw/arm: Prefer arm_feature(CBAR*) over object_property_
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 11/14] hw/arm: Prefer arm_feature(CBAR*) over object_property_find(reset-cbar) |
Date: |
Tue, 9 Jan 2024 19:09:26 +0100 |
The "reset-cbar" property is added to ARMCPU when the
ARM_FEATURE_CBAR[_RO] features are available. Rather than
checking whether the QOM property is present, directly
check the features.
Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/arm/highbank.c | 3 ++-
hw/arm/sbsa-ref.c | 3 ++-
hw/arm/vexpress.c | 3 ++-
hw/arm/virt.c | 3 ++-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index c21e18d08f..b06a727c06 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -211,7 +211,8 @@ static void calxeda_init(MachineState *machine, enum
cxmachines machine_id)
object_property_set_int(cpuobj, "psci-conduit", QEMU_PSCI_CONDUIT_SMC,
&error_abort);
- if (object_property_find(cpuobj, "reset-cbar")) {
+ if (arm_feature(&cpu->env, ARM_FEATURE_CBAR) ||
+ arm_feature(&cpu->env, ARM_FEATURE_CBAR_RO)) {
object_property_set_int(cpuobj, "reset-cbar", MPCORE_PERIPHBASE,
&error_abort);
}
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index 477dca0637..c073c462c7 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -770,7 +770,8 @@ static void sbsa_ref_init(MachineState *machine)
numa_cpu_pre_plug(&possible_cpus->cpus[cs->cpu_index], DEVICE(cpuobj),
&error_fatal);
- if (object_property_find(cpuobj, "reset-cbar")) {
+ if (arm_feature(cpu_env(cs), ARM_FEATURE_CBAR) ||
+ arm_feature(cpu_env(cs), ARM_FEATURE_CBAR_RO)) {
object_property_set_int(cpuobj, "reset-cbar",
sbsa_ref_memmap[SBSA_CPUPERIPHS].base,
&error_abort);
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 753a645c05..ea3c76f3e1 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -229,7 +229,8 @@ static void init_cpus(MachineState *ms, const char
*cpu_type,
}
}
- if (object_property_find(cpuobj, "reset-cbar")) {
+ if (arm_feature(&cpu->env, ARM_FEATURE_CBAR) ||
+ arm_feature(&cpu->env, ARM_FEATURE_CBAR_RO)) {
object_property_set_int(cpuobj, "reset-cbar", periphbase,
&error_abort);
}
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 35eb01a3dc..7e7350fec2 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2168,7 +2168,8 @@ static void machvirt_init(MachineState *machine)
object_property_set_bool(cpuobj, "lpa2", false, NULL);
}
- if (object_property_find(cpuobj, "reset-cbar")) {
+ if (arm_feature(cpu_env(cs), ARM_FEATURE_CBAR) ||
+ arm_feature(cpu_env(cs), ARM_FEATURE_CBAR_RO)) {
object_property_set_int(cpuobj, "reset-cbar",
vms->memmap[VIRT_CPUPERIPHS].base,
&error_abort);
--
2.41.0
- [PATCH v2 02/14] hw/arm/armv7m: Introduce cpudev variable in armv7m_realize(), (continued)
- [PATCH v2 02/14] hw/arm/armv7m: Introduce cpudev variable in armv7m_realize(), Philippe Mathieu-Daudé, 2024/01/09
- [PATCH v2 04/14] hw/arm/armv7m: Move code setting 'start-powered-off' property around, Philippe Mathieu-Daudé, 2024/01/09
- [PATCH v2 05/14] hw/arm/armv7m: Always set 'init-nsvtor' property for Cortex-M CPUs, Philippe Mathieu-Daudé, 2024/01/09
- [PATCH v2 09/14] hw/arm: Prefer arm_feature(EL3) over object_property_find(has_el3), Philippe Mathieu-Daudé, 2024/01/09
- [PATCH v2 08/14] hw/arm: Prefer arm_feature(V7) over object_property_find(pmsav7-dregion), Philippe Mathieu-Daudé, 2024/01/09
- [PATCH v2 06/14] hw/arm: Prefer arm_feature(M_SECURITY) over object_property_find(), Philippe Mathieu-Daudé, 2024/01/09
- [PATCH v2 07/14] hw/arm: Prefer arm_feature(THUMB_DSP) over object_property_find(dsp), Philippe Mathieu-Daudé, 2024/01/09
- [PATCH v2 11/14] hw/arm: Prefer arm_feature(CBAR*) over object_property_find(reset-cbar),
Philippe Mathieu-Daudé <=
- [PATCH v2 10/14] hw/arm: Prefer arm_feature(EL2) over object_property_find(has_el2), Philippe Mathieu-Daudé, 2024/01/09
- [PATCH v2 13/14] hw/arm: Prefer cpu_isar_feature(aa64_mte) over property_find(tag-memory), Philippe Mathieu-Daudé, 2024/01/09
- [PATCH v2 12/14] hw/arm: Prefer arm_feature(PMU) over object_property_find(pmu), Philippe Mathieu-Daudé, 2024/01/09
- [PATCH v2 14/14] hw/arm: Prefer arm_feature(GENERIC_TMR) over 'kvm-no-adjvtime' property, Philippe Mathieu-Daudé, 2024/01/09