|
From: | Daniel Henrique Barboza |
Subject: | Re: [PATCH] hw/intc/riscv_aplic: APLICs should add child earlier than realize |
Date: | Mon, 8 Apr 2024 19:33:55 -0300 |
User-agent: | Mozilla Thunderbird |
On 4/7/24 00:46, yang.zhang wrote:
From: "yang.zhang" <yang.zhang@hexintek.com> Since only root APLICs can have hw IRQ lines, aplic->parent should be initialized first.
I think it's worth mentioning that, if we don't do that, there won't be an aplic->parent assigned during riscv_aplic_realize() and we won't create the adequate IRQ lines.
Signed-off-by: yang.zhang <yang.zhang@hexintek.com> ---
Please add: Fixes: e8f79343cf ("hw/intc: Add RISC-V AIA APLIC device emulation") And: Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
hw/intc/riscv_aplic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/intc/riscv_aplic.c b/hw/intc/riscv_aplic.c index fc5df0d598..32edd6d07b 100644 --- a/hw/intc/riscv_aplic.c +++ b/hw/intc/riscv_aplic.c @@ -1000,16 +1000,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);
[Prev in Thread] | Current Thread | [Next in Thread] |