diff mbox series

[v2,13/14] hw/arm: Prefer cpu_isar_feature(aa64_mte) over property_find(tag-memory)

Message ID 20240109180930.90793-14-philmd@linaro.org
State Superseded
Headers show
Series hw/arm: Prefer arm_feature() over object_property_find() | expand

Commit Message

Philippe Mathieu-Daudé Jan. 9, 2024, 6:09 p.m. UTC
The "tag-memory" property is added to ARMCPU when the
A64_MTE bit is set in the feature ID register. Rather
than checking whether the QOM property is present, directly
check the feature bit.

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/arm/virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 6d1cb24a6e..2ce4a18d73 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2189,7 +2189,7 @@  static void machvirt_init(MachineState *machine)
                  * The property exists only if MemTag is supported.
                  * If it is, we must allocate the ram to back that up.
                  */
-                if (!object_property_find(cpuobj, "tag-memory")) {
+                if (!cpu_isar_feature(aa64_mte, ARM_CPU(cs))) {
                     error_report("MTE requested, but not supported "
                                  "by the guest CPU");
                     exit(1);