[Qemu-devel] [PATCHv2 0/4] fw_cfg: qdev-related tidy-ups

Mark Cave-Ayland posted 4 patches 8 years, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1497302470-10776-1-git-send-email-mark.cave-ayland@ilande.co.uk
Test FreeBSD passed
Test checkpatch passed
Test docker passed
Test s390x passed
hw/nvram/fw_cfg.c         |   44 +++++++++++++++++++++-----------------------
include/hw/nvram/fw_cfg.h |    8 ++++++++
2 files changed, 29 insertions(+), 23 deletions(-)
[Qemu-devel] [PATCHv2 0/4] fw_cfg: qdev-related tidy-ups
Posted by Mark Cave-Ayland 8 years, 4 months ago
As part of some ongoing sun4u work, I need to be able to wire the fw_cfg
IO interface to a separate IO space by instantiating the qdev device instead
of calling fw_cfg_init_io(). This patchset brings FW_CFG_IO in line with
FW_CFG_MEM and tidies up the realize methods accordingly.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

v2:
- Fix the QOM bug in patch 1 as indicated by Laszlo
- Minimise code churn compared to v1


Mark Cave-Ayland (4):
  fw_cfg: don't map the fw_cfg IO ports in fw_cfg_io_realize()
  fw_cfg: move setting of FW_CFG_VERSION_DMA bit to fw_cfg_init1()
  fw_cfg: move qdev_init_nofail() from fw_cfg_init1() to callers
  fw_cfg: move QOM type defines into fw_cfg.h

 hw/nvram/fw_cfg.c         |   44 +++++++++++++++++++++-----------------------
 include/hw/nvram/fw_cfg.h |    8 ++++++++
 2 files changed, 29 insertions(+), 23 deletions(-)

-- 
1.7.10.4


Re: [Qemu-devel] [PATCHv2 0/4] fw_cfg: qdev-related tidy-ups
Posted by Paolo Bonzini 8 years, 4 months ago

On 12/06/2017 23:21, Mark Cave-Ayland wrote:
> As part of some ongoing sun4u work, I need to be able to wire the fw_cfg
> IO interface to a separate IO space by instantiating the qdev device instead
> of calling fw_cfg_init_io(). This patchset brings FW_CFG_IO in line with
> FW_CFG_MEM and tidies up the realize methods accordingly.

Could you use FW_CFG_MEM instead, and add a new function

void sysbus_mmio_map_subregion(SysBusDevice *dev, int n,
                               MemoryRegion *mr, hwaddr addr)

?

Thanks,

Paolo

Re: [Qemu-devel] [PATCHv2 0/4] fw_cfg: qdev-related tidy-ups
Posted by Mark Cave-Ayland 8 years, 4 months ago
On 14/06/17 13:38, Paolo Bonzini wrote:

> On 12/06/2017 23:21, Mark Cave-Ayland wrote:
>> As part of some ongoing sun4u work, I need to be able to wire the fw_cfg
>> IO interface to a separate IO space by instantiating the qdev device instead
>> of calling fw_cfg_init_io(). This patchset brings FW_CFG_IO in line with
>> FW_CFG_MEM and tidies up the realize methods accordingly.
> 
> Could you use FW_CFG_MEM instead, and add a new function
> 
> void sysbus_mmio_map_subregion(SysBusDevice *dev, int n,
>                                MemoryRegion *mr, hwaddr addr)
> 
> ?

Hmmm possibly that could work with some wrappers to emulate the ioport
accesses, however Laszlo wasn't too keen on the ioport regions appearing
as MMIO in the device tree and I believe that the final patchset will
offer some useful cleanups. There's also the argument that outside of
OpenBIOS I don't have a large set of clients for testing so I'd much
prefer to leave access-related changes if at all possible.


ATB,

Mark.