Message ID | 20231019071611.98885-1-philmd@linaro.org |
---|---|
Headers | show |
Series | hw: Strengthen SysBus & QBus API | expand |
On 19/10/2023 09.15, Philippe Mathieu-Daudé wrote: > Hi, > > This series ensure: > > - qbus_new() and sysbus_init_mmio() are called *before* > a device is realized, > - sysbus_mmio_map() is called *after* it is realized. Just an additional idea that came up while reading your series: I think we should also add proper function descriptions for sysbus_init_mmio() and sysbus_mmio_map() in include/hw/sysbus.h, to make people aware that the first function should be used within the device to expose the mmio region, while the latter should be used in the machine code that wires the devices to the correct location in the sysbus memory. What do you think? Thomas
On 19/10/23 09:32, Thomas Huth wrote: > On 19/10/2023 09.15, Philippe Mathieu-Daudé wrote: >> Hi, >> >> This series ensure: >> >> - qbus_new() and sysbus_init_mmio() are called *before* >> a device is realized, >> - sysbus_mmio_map() is called *after* it is realized. > > Just an additional idea that came up while reading your series: > I think we should also add proper function descriptions for > sysbus_init_mmio() and sysbus_mmio_map() in include/hw/sysbus.h, to make > people aware that the first function should be used within the device to > expose the mmio region, while the latter should be used in the machine > code that wires the devices to the correct location in the sysbus > memory. What do you think? I've been thinking about this, but I plan to eventually merge these calls to the QDev API (after removing more unuseful / duplicated SysBus functions). So I was planning to document there. But yeah, better to start doing that now.
On 19/10/23 09:15, Philippe Mathieu-Daudé wrote: > Philippe Mathieu-Daudé (12): > hw/i386/amd_iommu: Do not use SysBus API to map local MMIO region > hw/i386/intel_iommu: Do not use SysBus API to map local MMIO region > hw/misc/allwinner-dramc: Move sysbus_mmio_map call from init -> > realize > hw/misc/allwinner-dramc: Do not use SysBus API to map local MMIO > region > hw/pci-host/bonito: Do not use SysBus API to map local MMIO region > hw/acpi: Realize ACPI_GED sysbus device before accessing it > hw/arm/virt: Realize ARM_GICV2M sysbus device before accessing it > hw/isa: Realize ISA BUS sysbus device before accessing it > hw/s390x/css-bridge: Realize sysbus device before accessing it Patches 1-9 queued to hw-misc.