[Qemu-devel] [PATCHv7 0/6] fw_cfg: qdev-related tidy-ups

Mark Cave-Ayland posted 6 patches 6 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1498745240-30658-1-git-send-email-mark.cave-ayland@ilande.co.uk
Test FreeBSD passed
Test checkpatch failed
Test docker passed
Test s390x passed
hw/nvram/fw_cfg.c         |  133 +++++++++++++++++++--------------------------
include/hw/nvram/fw_cfg.h |   50 +++++++++++++++++
include/qemu/typedefs.h   |    1 +
3 files changed, 108 insertions(+), 76 deletions(-)
[Qemu-devel] [PATCHv7 0/6] fw_cfg: qdev-related tidy-ups
Posted by Mark Cave-Ayland 6 years, 9 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>

v7:
- Remove instance_init() function with assert()
- Switch fw_cfg_find() over to use object_resolve_path_type() which removes the
  need for the fw_cfg device to exist at a fixed QOM path
- Switch check for existence of another fw_cfg device over to use the new
  fw_cfg_find()
- Add check for fw_cfg parent at realize time

v6:
- Revert move of FWCfgEntry from fw_cfg.c to fw_cfg.h from v5
- Add Reviewed-by tag from Laszlo for patch 5
- Add Tested-by tags from Laszlo for the series

v5:
- Remove unused FWCfgIoState iobase and dma_iobase fields
- Add Reviewed-By tags from Laszlo
- Update commit message in patch 5 as suggested by Laszlo
- Move FWCfgEntry typedef from fw_cfg.h to typedefs.h with the others

v4:
- Undo accidental typedef change in patch 5 caught in v3 rework

v3:
- Rework patch 1 to use sysbus_add_io() as suggested by Laszlo
- Add Reviewed-By from Laszlo for patch 2
- Fix assert() when instantiating > 1 fw_cfg device (new patch 3)
- Rename fw_cfg_init1() to fw_cfg_common_realize() as part of patch 4

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


Mark Cave-Ayland (6):
  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: switch fw_cfg_find() to locate the fw_cfg device by type
    rather than path
  fw_cfg: add assert() to ensure the fw_cfg device has been added as a
    child property
  fw_cfg: move qdev_init_nofail() from fw_cfg_init1() to callers
  fw_cfg: move QOM type defines and fw_cfg types into fw_cfg.h

 hw/nvram/fw_cfg.c         |  133 +++++++++++++++++++--------------------------
 include/hw/nvram/fw_cfg.h |   50 +++++++++++++++++
 include/qemu/typedefs.h   |    1 +
 3 files changed, 108 insertions(+), 76 deletions(-)

-- 
1.7.10.4


Re: [Qemu-devel] [PATCHv7 0/6] fw_cfg: qdev-related tidy-ups
Posted by Gabriel L. Somlo 6 years, 9 months ago
On Thu, Jun 29, 2017 at 03:07:14PM +0100, 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.

Tested-by: Gabriel Somlo <somlo@cmu.edu>

Specifically, verified that passing blobs into the guest via
"-fw-cfg name=opt/foo,file=./bar" still shows up properly in
'/sys/firmware/qemu_fw_cfg/by_name/opt/foo/raw' on the guest.

Thanks much,
--Gabriel
 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> 
> v7:
> - Remove instance_init() function with assert()
> - Switch fw_cfg_find() over to use object_resolve_path_type() which removes the
>   need for the fw_cfg device to exist at a fixed QOM path
> - Switch check for existence of another fw_cfg device over to use the new
>   fw_cfg_find()
> - Add check for fw_cfg parent at realize time
> 
> v6:
> - Revert move of FWCfgEntry from fw_cfg.c to fw_cfg.h from v5
> - Add Reviewed-by tag from Laszlo for patch 5
> - Add Tested-by tags from Laszlo for the series
> 
> v5:
> - Remove unused FWCfgIoState iobase and dma_iobase fields
> - Add Reviewed-By tags from Laszlo
> - Update commit message in patch 5 as suggested by Laszlo
> - Move FWCfgEntry typedef from fw_cfg.h to typedefs.h with the others
> 
> v4:
> - Undo accidental typedef change in patch 5 caught in v3 rework
> 
> v3:
> - Rework patch 1 to use sysbus_add_io() as suggested by Laszlo
> - Add Reviewed-By from Laszlo for patch 2
> - Fix assert() when instantiating > 1 fw_cfg device (new patch 3)
> - Rename fw_cfg_init1() to fw_cfg_common_realize() as part of patch 4
> 
> v2:
> - Fix the QOM bug in patch 1 as indicated by Laszlo
> - Minimise code churn compared to v1
> 
> 
> Mark Cave-Ayland (6):
>   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: switch fw_cfg_find() to locate the fw_cfg device by type
>     rather than path
>   fw_cfg: add assert() to ensure the fw_cfg device has been added as a
>     child property
>   fw_cfg: move qdev_init_nofail() from fw_cfg_init1() to callers
>   fw_cfg: move QOM type defines and fw_cfg types into fw_cfg.h
> 
>  hw/nvram/fw_cfg.c         |  133 +++++++++++++++++++--------------------------
>  include/hw/nvram/fw_cfg.h |   50 +++++++++++++++++
>  include/qemu/typedefs.h   |    1 +
>  3 files changed, 108 insertions(+), 76 deletions(-)
> 
> -- 
> 1.7.10.4
>