@@ -325,6 +325,7 @@ static void virt_cpu_irq_init(LoongArchVirtMachineState *lvms)
MachineClass *mc = MACHINE_GET_CLASS(ms);
const CPUArchIdList *possible_cpus;
CPUState *cs;
+ Error *err = NULL;
/* cpu nodes */
possible_cpus = mc->possible_cpu_arch_ids(ms);
@@ -334,9 +335,7 @@ static void virt_cpu_irq_init(LoongArchVirtMachineState *lvms)
continue;
}
- /* connect ipi irq to cpu irq */
- qdev_connect_gpio_out(lvms->ipi, num,
- qdev_get_gpio_in(DEVICE(cs), IRQ_IPI));
+ hotplug_handler_plug(HOTPLUG_HANDLER(lvms->ipi), DEVICE(cs), &err);
/*
* connect ext irq to the cpu irq
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 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)