[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-7.2.12 24/29] hw/intc/riscv_aplic: APLICs should add child earli
From: |
Michael Tokarev |
Subject: |
[Stable-7.2.12 24/29] hw/intc/riscv_aplic: APLICs should add child earlier than realize |
Date: |
Fri, 7 Jun 2024 22:12:07 +0300 |
From: "yang.zhang" <yang.zhang@hexintek.com>
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 commit c76b121840c6ca79dc6305a5f4bcf17c72217d9c)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/intc/riscv_aplic.c b/hw/intc/riscv_aplic.c
index cfd007e629..961caff7b6 100644
--- a/hw/intc/riscv_aplic.c
+++ b/hw/intc/riscv_aplic.c
@@ -957,13 +957,13 @@ DeviceState *riscv_aplic_create(hwaddr addr, hwaddr size,
qdev_prop_set_bit(dev, "msimode", msimode);
qdev_prop_set_bit(dev, "mmode", mmode);
- sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
- sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, addr);
-
if (parent) {
riscv_aplic_add_child(parent, dev);
}
+ sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
+ sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, addr);
+
if (!msimode) {
for (i = 0; i < num_harts; i++) {
CPUState *cpu = qemu_get_cpu(hartid_base + i);
--
2.39.2
- [Stable-7.2.12 00/29] Patch Round-up for stable 7.2.12, frozen at 2024-06-07, Michael Tokarev, 2024/06/07
- [Stable-7.2.12 20/29] gitlab: Update msys2-64bit runner tags, Michael Tokarev, 2024/06/07
- [Stable-7.2.12 21/29] hvf: arm: Fix encodings for ID_AA64PFR1_EL1 and debug System registers, Michael Tokarev, 2024/06/07
- [Stable-7.2.12 22/29] hw/intc/arm_gic: Fix handling of NS view of GICC_APR<n>, Michael Tokarev, 2024/06/07
- [Stable-7.2.12 23/29] target/arm: Disable SVE extensions when SVE is disabled, Michael Tokarev, 2024/06/07
- [Stable-7.2.12 24/29] hw/intc/riscv_aplic: APLICs should add child earlier than realize,
Michael Tokarev <=
- [Stable-7.2.12 25/29] disas/riscv: Decode all of the pmpcfg and pmpaddr CSRs, Michael Tokarev, 2024/06/07
- [Stable-7.2.12 26/29] target/i386: fix xsave.flat from kvm-unit-tests, Michael Tokarev, 2024/06/07
- [Stable-7.2.12 27/29] target/i386: fix SSE and SSE2 feature check, Michael Tokarev, 2024/06/07
- [Stable-7.2.12 28/29] ui/sdl2: Allow host to power down screen, Michael Tokarev, 2024/06/07
- [Stable-7.2.12 29/29] target/loongarch: fix a wrong print in cpu dump, Michael Tokarev, 2024/06/07
- Re: [Stable-7.2.12 00/29] Patch Round-up for stable 7.2.12, frozen at 2024-06-07, Eric Blake, 2024/06/10