diff mbox series

[3/3] hw/intc/loongarch_ipi: Notify ipi object when cpu is plugged

Message ID 20250121023723.153876-4-maobibo@loongson.cn (mailing list archive)
State New
Headers show
Series hw/intc/loongarch_ipi: CPU irq routing enhancement | expand

Commit Message

Bibo Mao Jan. 21, 2025, 2:37 a.m. UTC
Use hotplug_handler_plug() to nofity ipi object when cold-plug
cpu is created, so that ipi can set and configure irq routing
to new cpu.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
 hw/loongarch/virt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index 63fa0f4e32..5deef69219 100644
--- a/hw/loongarch/virt.c
+++ b/hw/loongarch/virt.c
@@ -852,6 +852,7 @@  static void virt_irq_init(LoongArchVirtMachineState *lvms)
     CPULoongArchState *env;
     CPUState *cpu_state;
     int cpu, pin, i, start, num;
+    Error *local_err = NULL;
 
     /*
      * Extended IRQ model.
@@ -914,8 +915,7 @@  static void virt_irq_init(LoongArchVirtMachineState *lvms)
         env = &(lacpu->env);
         env->address_space_iocsr = &lvms->as_iocsr;
 
-        /* connect ipi irq to cpu irq */
-        qdev_connect_gpio_out(ipi, cpu, qdev_get_gpio_in(cpudev, IRQ_IPI));
+        hotplug_handler_plug(HOTPLUG_HANDLER(ipi), cpudev, &local_err);
         env->ipistate = ipi;
     }