Skip to content

Commit

Permalink
hw/loongarch/virt: Set iocsr address space when CPU is created
Browse files Browse the repository at this point in the history
There is only one iocsr address space for the whole virt-machine
board. When CPU is created, the one of percpu points to that of
the board.

Here set iocsr address space when CPU is created rather than IPI
creation stage.

Signed-off-by: Bibo Mao <[email protected]>
Reviewed-by: Bibo Mao <[email protected]>
  • Loading branch information
bibo-mao committed Feb 12, 2025
1 parent 3754f98 commit 28bec94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/loongarch/virt.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ static void virt_irq_init(LoongArchVirtMachineState *lvms)
cpudev = DEVICE(cpu_state);
lacpu = LOONGARCH_CPU(cpu_state);
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));
Expand Down Expand Up @@ -689,6 +688,7 @@ static void virt_init(MachineState *machine)
machine->possible_cpus->cpus[i].cpu = cpu;
lacpu = LOONGARCH_CPU(cpu);
lacpu->phy_id = machine->possible_cpus->cpus[i].arch_id;
lacpu->env.address_space_iocsr = &lvms->as_iocsr;
}
fw_cfg_add_memory(machine);

Expand Down

0 comments on commit 28bec94

Please sign in to comment.