Skip to content

hw: Remove implicit sysbus_mmio_map() from pflash APIs

Philippe Mathieu-Daudé qemu-arm qemu-devel qemu-riscv 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest21 patches 22 repliesIn review
  2. v120 patches 23 repliesSuperseded

Changes in v2 from the cover letter

- Do not introduce pflash_cfi_create(), directly open-code pflash_cfi_register() before removing it (Peter)
- Added R-b tags

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21hw/block: Rename TYPE_PFLASH_CFI02 'width' property as 'device-width'hw/block/pflash_cfi02.c+2 -210 replies
2/21hw/block: Pass DeviceState to pflash_cfi01_get_blk()hw/arm/sbsa-ref.c hw/arm/virt.c hw/block/pflash_cfi01.c +2 more+8 -60 replies
3/21hw/block: Use pflash_cfi01_get_blk() in pflash_cfi01_legacy_drive()hw/arm/sbsa-ref.c hw/arm/virt.c hw/block/pflash_cfi01.c +3 more+8 -80 replies
4/21hw/block: Pass DeviceState to pflash_cfi01_get_memory()hw/block/pflash_cfi01.c hw/i386/pc_sysfw.c hw/mips/malta.c +3 more+9 -62 replies
5/21hw/arm: Use generic DeviceState instead of PFlashCFI01hw/arm/sbsa-ref.c hw/arm/vexpress.c hw/arm/virt.c +1 more+16 -190 replies
6/21hw/loongarch: Use generic DeviceState instead of PFlashCFI01hw/loongarch/virt.c include/hw/loongarch/virt.h+5 -70 replies
7/21hw/riscv: Use generic DeviceState instead of PFlashCFI01hw/riscv/virt.c include/hw/riscv/virt.h+6 -61 reply
8/21hw/i386: Use generic DeviceState instead of PFlashCFI01hw/i386/pc_sysfw.c include/hw/i386/pc.h+8 -90 replies
9/21hw/xtensa: Use generic DeviceState instead of PFlashCFI01hw/xtensa/xtfpga.c+4 -40 replies
10/21hw/sh4: Open-code pflash_cfi02_register()hw/sh4/r2d.c+17 -43 replies
11/21hw/arm/digic: Open-code pflash_cfi02_register()hw/arm/digic_boards.c+20 -61 reply
12/21hw/arm/musicpal: Open-code pflash_cfi02_register()hw/arm/musicpal.c+15 -61 reply
13/21hw/arm/xilinx_zynq: Open-code pflash_cfi02_register()hw/arm/xilinx_zynq.c+15 -51 reply
14/21hw/block: Remove unused pflash_cfi02_register()hw/block/pflash_cfi02.c include/hw/block/flash.h+0 -490 replies
15/21hw/block: Make PFlashCFI02 QOM declaration internalhw/block/pflash_cfi02.c include/hw/block/flash.h+3 -70 replies
16/21hw/arm: Open-code pflash_cfi01_register()hw/arm/collie.c hw/arm/gumstix.c hw/arm/mainstone.c +3 more+102 -311 reply
17/21hw/microblaze: Open-code pflash_cfi01_register()hw/microblaze/petalogix_ml605_mmu.c hw/microblaze/petalogix_s3adsp1800_mmu.c+24 -100 replies
18/21hw/mips: Open-code pflash_cfi01_register()hw/mips/malta.c+10 -70 replies
19/21hw/ppc: Open-code pflash_cfi01_register()hw/ppc/sam460ex.c hw/ppc/virtex_ml507.c+26 -81 reply
20/21hw/block: Remove unused pflash_cfi01_register()hw/block/pflash_cfi01.c include/hw/block/flash.h+0 -410 replies
21/21hw/block: Make PFlashCFI01 QOM declaration internalhw/block/pflash_cfi01.c include/hw/block/flash.h+2 -20 replies

Reviews trailers per patch

17 of 21 patches have a Reviewed-by or Acked-by.

PatchDaniel Henrique BarbozaBin MengBALATON ZoltanAlistair FrancisPeter Maydell
1/21
2/21R-b
3/21R-b
4/21R-b
5/21R-b
6/21R-b
7/21R-b R-b R-b
8/21R-b
9/21R-b
10/21R-b
11/21R-b
12/21R-b
13/21R-b
14/21R-b
15/21R-b
16/21
17/21
18/21
19/21R-b
20/21R-b
21/21R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/21] hw: Remove implicit sysbus_mmio_map() from pflash APIs

Since v1:
- Do not introduce pflash_cfi_create(), directly open-code pflash_cfi_register() before removing it (Peter)
- Added R-b tags

Paving the road toward heterogeneous QEMU, the limitations of having a single machine sysbus become more apparent.

The sysbus_mmio_map() API forces the caller to map a sysbus device to an address on the system bus (system bus here is the root MemoryRegion returned by get_system_memory() ).

This is not practical when each core has its own address space and group of cores have access to a part of the peripherals.

Experimenting with the PFLASH devices. Here the fix is quite easy: open-code the pflash_cfi_register() functions.

Since we were touching the PFLASH API, we restricted the PFlashCFI0X structures to their models. The API now deals with a generic qdev pointer (DeviceState*).

Please review,

Phil.

Based-on: <[email protected]>
"hw/arm: Cleanups before pflash refactor"
Based-on: <[email protected]>
"hw/misc: Cleanups around PFLASH use"

Philippe Mathieu-Daudé (21):
hw/block: Rename TYPE_PFLASH_CFI02 'width' property as 'device-width' hw/block: Pass DeviceState to pflash_cfi01_get_blk() hw/block: Use pflash_cfi01_get_blk() in pflash_cfi01_legacy_drive() hw/block: Pass DeviceState to pflash_cfi01_get_memory() hw/arm: Use generic DeviceState instead of PFlashCFI01 hw/loongarch: Use generic DeviceState instead of PFlashCFI01 hw/riscv: Use generic DeviceState instead of PFlashCFI01 hw/i386: Use generic DeviceState instead of PFlashCFI01 hw/xtensa: Use generic DeviceState instead of PFlashCFI01 hw/sh4: Open-code pflash_cfi02_register()
hw/arm/digic: Open-code pflash_cfi02_register() hw/arm/musicpal: Open-code pflash_cfi02_register() hw/arm/xilinx_zynq: Open-code pflash_cfi02_register() hw/block: Remove unused pflash_cfi02_register()
hw/block: Make PFlashCFI02 QOM declaration internal hw/arm: Open-code pflash_cfi01_register()
hw/microblaze: Open-code pflash_cfi01_register()
hw/mips: Open-code pflash_cfi01_register()
hw/ppc: Open-code pflash_cfi01_register()
hw/block: Remove unused pflash_cfi01_register()
hw/block: Make PFlashCFI01 QOM declaration internal

 hw/arm/collie.c                          | 16 ++++++---
 hw/arm/digic_boards.c                    | 26 ++++++++++----
 hw/arm/gumstix.c                         | 32 +++++++++++++----
 hw/arm/mainstone.c                       | 19 +++++++---
 hw/arm/musicpal.c                        | 21 +++++++----
 hw/arm/omap_sx1.c                        | 31 +++++++++++-----
 hw/arm/sbsa-ref.c                        |  8 ++---
 hw/arm/versatilepb.c                     | 18 +++++++---
 hw/arm/vexpress.c                        | 10 +++---
 hw/arm/virt.c                            |  6 ++--
 hw/arm/xilinx_zynq.c                     | 20 ++++++++---
 hw/arm/z2.c                              | 17 +++++++--
 hw/block/pflash_cfi01.c                  | 45 ++++++------------------
 hw/block/pflash_cfi02.c                  | 40 ++-------------------
 hw/i386/pc_sysfw.c                       |  6 ++--
 hw/loongarch/virt.c                      |  9 +++--
 hw/microblaze/petalogix_ml605_mmu.c      | 18 ++++++----
 hw/microblaze/petalogix_s3adsp1800_mmu.c | 16 ++++++---
 hw/mips/malta.c                          | 18 ++++++----
 hw/ppc/e500.c                            |  2 +-
 hw/ppc/sam460ex.c                        | 19 +++++++---
 hw/ppc/virtex_ml507.c                    | 15 ++++++--
 hw/riscv/virt.c                          |  7 ++--
 hw/sh4/r2d.c                             | 21 ++++++++---
 hw/xtensa/xtfpga.c                       |  6 ++--
 include/hw/arm/virt.h                    |  3 +-
 include/hw/block/flash.h                 | 37 ++-----------------
 include/hw/i386/pc.h                     |  3 +-
 include/hw/loongarch/virt.h              |  3 +-
 include/hw/riscv/virt.h                  |  3 +-
 30 files changed, 276 insertions(+), 219 deletions(-)
Signature · 1 line
2.38.1