diff mbox series

[PATCH-for-10.0?,v2,08/14] hw/arm/virt: Simplify create_its()

Message ID 20250403151829.44858-9-philmd@linaro.org (mailing list archive)
State New
Headers show
Series hw/arm: Tests & ACPI tables fixes for 10.0 | expand

Commit Message

Philippe Mathieu-Daudé April 3, 2025, 3:18 p.m. UTC
No need to strstr() check the class name when we can
use kvm_irqchip_in_kernel().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/arm/virt.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

Comments

Richard Henderson April 3, 2025, 5:38 p.m. UTC | #1
On 4/3/25 08:18, Philippe Mathieu-Daudé wrote:
> No need to strstr() check the class name when we can
> use kvm_irqchip_in_kernel().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/arm/virt.c | 12 +++---------
>   1 file changed, 3 insertions(+), 9 deletions(-)


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
diff mbox series

Patch

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index c0748cbb95a..d17755548e8 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -711,21 +711,15 @@  static inline DeviceState *create_acpi_ged(VirtMachineState *vms)
 static void create_its(VirtMachineState *vms)
 {
     VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
-    const char *itsclass = its_class_name();
     DeviceState *dev;
 
-    if (!strcmp(itsclass, "arm-gicv3-its")) {
-        if (!vmc->no_tcg_its) {
-            itsclass = NULL;
-        }
-    }
-
-    if (!itsclass) {
+    assert(!vmc->no_its);
+    if (!kvm_irqchip_in_kernel() && !vmc->no_tcg_its) {
         /* Do nothing if not supported */
         return;
     }
 
-    dev = qdev_new(itsclass);
+    dev = qdev_new(its_class_name());
 
     object_property_set_link(OBJECT(dev), "parent-gicv3", OBJECT(vms->gic),
                              &error_abort);