On Mon, 8 Sept 2025 at 16:21, Akihiko Odaki <od...@rsg.ci.i.u-tokyo.ac.jp> wrote: > > On 2025/09/06 18:03, BALATON Zoltan wrote: > > I had a series here: https://patchew.org/QEMU/ > > cover.1751493467.git.bala...@eik.bme.hu/ > > that changes this for raven (among other clean ups) but I could not get > > that merged in the last devel cycle because of PPC being a bit > > unmaintained. I'd prefer that series to be taken first instead of this > > patch so I don't have to rebase that. > > Looking at the series, "[PATCH v2 13/14] hw/pci-host/raven: Do not map > regions in init method" moves memory_region_init() and > memory_region_init_io() from raven_pcihost_initfn() to > raven_pcihost_realize(). This should be avoided because these function > calls add memory regions as child properties, which may be introspected > without realization. Perhaps you may drop the patch and rebase your > series on top of this patch, or let me rebase this patch on that series > without it.
I think that patch is fine. It's OK to init MRs either in instance_init or in realize, whichever is convenient for the device. Initing an MR adds a child QOM property but they are not intended for generic introspection. A MemoryRegion is not part of the public interface to a device unless you call sysbus_init_mmio() to declare it so. This is part of a general issue we have with QOM, where we use QOM properties both for "this is part of the public-facing interface to this device" and also for "this is internal and really we're only using a QOM child property for convenience of having things automatically cleaned up". thanks -- PMM