mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-01-08 23:47:44 -07:00
hw/intc/riscv_aplic: APLICs should add child earlier than realize
Since only root APLICs can have hw IRQ lines, aplic->parent should be initialized first. Fixes:e8f79343cf("hw/intc: Add RISC-V AIA APLIC device emulation") Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Signed-off-by: yang.zhang <yang.zhang@hexintek.com> Cc: qemu-stable <qemu-stable@nongnu.org> Message-ID: <20240409014445.278-1-gaoshanliukou@163.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com> (cherry picked from commitc76b121840) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
b9b2f3bbab
commit
cd1228a80e
1 changed files with 4 additions and 4 deletions
|
|
@ -975,16 +975,16 @@ DeviceState *riscv_aplic_create(hwaddr addr, hwaddr size,
|
|||
qdev_prop_set_bit(dev, "msimode", msimode);
|
||||
qdev_prop_set_bit(dev, "mmode", mmode);
|
||||
|
||||
if (parent) {
|
||||
riscv_aplic_add_child(parent, dev);
|
||||
}
|
||||
|
||||
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
|
||||
|
||||
if (!is_kvm_aia(msimode)) {
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, addr);
|
||||
}
|
||||
|
||||
if (parent) {
|
||||
riscv_aplic_add_child(parent, dev);
|
||||
}
|
||||
|
||||
if (!msimode) {
|
||||
for (i = 0; i < num_harts; i++) {
|
||||
CPUState *cpu = cpu_by_arch_id(hartid_base + i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue