On Fri, Nov 20, 2020 at 01:08:40PM +0100, Paolo Bonzini wrote: > On 20/11/20 10:38, Gerd Hoffmann wrote: > > On Fri, Nov 20, 2020 at 09:55:24AM +0100, Paolo Bonzini wrote: > > > PCIe and USB support can be disabled on the command line, and therefore > > > should not be included if QEMU is configured --without-default-devices. > > > > I don't think this will work. I expect linking will fail due to > > xhci_sysbus_build_aml and acpi_dsdt_add_gpex being not available. > > Hmm, you're right. On the other hand that also means that you're missing a > depends on ACPI for USB_XHCI_SYSBUS.
No, we have hw/acpi/aml-build-stub.c ... > What about moving those two directly > to hw/acpi/aml-build.c? Well, I like the aml generator being grouped with the device code and not at a completely different place. We could try plumb this through a sysbus class function, so the direct symbol reference goes away. Simliar to ISADeviceClass->build_aml(). Maybe also add build_dt() while being at it. Problem is that with the way sysbus resource management is designed it isn't that easy to do. The device just provides the resources (memory regions, irqs), the machine maps them. So the device has no clue where memory is mapped and how the irq is wired. Also sysbus devices can be alot more complex than isa devices which basically have ioports and irq and nothing else. take care, Gerd