Re: [Qemu-devel] [PATCHv2 1/4] fw_cfg: don't map the fw_cfg IO ports in fw_cfg_io_realize()

2017-06-14 Thread Paolo Bonzini
On 12/06/2017 23:21, Mark Cave-Ayland wrote: > As indicated by Laszlo it is a QOM bug for the realize() method to actually > map the device. Set up the IO regions with sysbus_init_mmio() and defer > the mapping to the caller, as already done in fw_cfg_init_mem_wide(). ... sort of. The idea is

Re: [Qemu-devel] [PATCHv2 1/4] fw_cfg: don't map the fw_cfg IO ports in fw_cfg_io_realize()

2017-06-13 Thread Mark Cave-Ayland
On 12/06/17 23:27, Laszlo Ersek wrote: > It turns out that we introduced the "iobase" and "dma_iobase" properties > *solely* so that we could pass arguments to fw_cfg_io_realize(). But > fw_cfg_io_realize() only needed those parameters for the *wrong* purpose > (namely calling sysbus_add_io()).

Re: [Qemu-devel] [PATCHv2 1/4] fw_cfg: don't map the fw_cfg IO ports in fw_cfg_io_realize()

2017-06-12 Thread Laszlo Ersek
On 06/13/17 00:27, Laszlo Ersek wrote: > In fw_cfg_init_io_dma(), you know the object type exactly -- you just > created it with TYPE_FW_CFG_IO --, so after device realization, you can > cast the type as narrowly as necessary, and refer to the fields by name. I understand that in sun4u code like

Re: [Qemu-devel] [PATCHv2 1/4] fw_cfg: don't map the fw_cfg IO ports in fw_cfg_io_realize()

2017-06-12 Thread Laszlo Ersek
On 06/12/17 23:21, Mark Cave-Ayland wrote: > As indicated by Laszlo it is a QOM bug for the realize() method to actually > map the device. Set up the IO regions with sysbus_init_mmio() and defer > the mapping to the caller, as already done in fw_cfg_init_mem_wide(). > > Signed-off-by: Mark

[Qemu-devel] [PATCHv2 1/4] fw_cfg: don't map the fw_cfg IO ports in fw_cfg_io_realize()

2017-06-12 Thread Mark Cave-Ayland
As indicated by Laszlo it is a QOM bug for the realize() method to actually map the device. Set up the IO regions with sysbus_init_mmio() and defer the mapping to the caller, as already done in fw_cfg_init_mem_wide(). Signed-off-by: Mark Cave-Ayland ---