On Fri, 1 Apr 2022 at 10:27, Chan Kim <c...@etri.re.kr> wrote: > static void create_ab21q_axpu_device(const Ab21qMachineState *vms, > MemoryRegion *mem) > { > char *nodename; > hwaddr base = vms->memmap[AB21Q_AXPU].base; > hwaddr size = vms->memmap[AB21Q_AXPU].size; > int irq = vms->irqmap[AB21Q_AXPU]; > const char compat[] = "ab21q-axpu"; > DeviceState *dev = qdev_new(TYPE_AB21Q_AXPU); > SysBusDevice *s = SYS_BUS_DEVICE(dev); > > //sysbus_create_simple("ab21q-axpu", base, > qdev_get_gpio_in(vms->gic, irq)); > sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
You realize the device here... > memory_region_add_subregion(mem, base, > sysbus_mmio_get_region(s, 0)); > sysbus_connect_irq(s, 0, qdev_get_gpio_in(vms->gic, irq)); ...and connect its IRQ here, so of course the check in the device realize method says "not connected". That isn't telling you anything useful. To debug this kind of problem, you need to narrow it down. Is the guest code doing any writes to the device registers? If not, maybe the ACPI table stuff is wrong and it doesn't realize there's a device there at all. If it does try to program the device, then the ACPI table/probing stuff is probably OK. Is the device code trying to raise its interrupt at all? If not, then either the guest driver isn't programming it right or else your device model has a bug that means it's not doing the right thing when the guest is programming it. If the device does try to raise its interrupt, then either you've wired the interrupt wrongly or else perhaps the guest never unmasked the interrupt in the GIC. You can singlestep into the qemu_raise_irq() function to see where it takes you. Look for tests you can do that cut the space where the problem might be into two pieces and tell you which side of the cut you should be looking. -- PMM