Skip to content

hw/arm: Move various objects to softmmu_ss to build them once (part 1)

Philippe Mathieu-Daudé qemu-arm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest18 patches 16 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18hw/arm: Move various units to softmmu_ss[]hw/arm/meson.build+7 -41 reply
2/18hw/arm/boot: Include missing 'exec/cpu-all.h' headerhw/arm/boot.c+1 -01 reply
3/18target/arm/cpregs: Include missing 'target/arm/cpu.h' headertarget/arm/cpregs.h+2 -01 reply
4/18hw/arm: Use full "target/arm/cpu.h" path to include target's "cpu.h"include/hw/arm/digic.h include/hw/arm/fsl-imx6.h include/hw/arm/fsl-imx6ul.h +1 more+4 -41 reply
5/18target/arm: Move CPU QOM type definitions to "hw/arm/cpu.h"include/hw/arm/cpu.h target/arm/cpu-qom.h target/arm/cpu.h+33 -165 replies
6/18target/arm: Move CPU definitions consumed by HW model to "hw/arm/cpu.h"include/hw/arm/cpu.h target/arm/cpu-qom.h target/arm/cpu.h+49 -491 reply
7/18hw/arm: Move more units to softmmu_ss[]hw/arm/collie.c hw/arm/gumstix.c hw/arm/meson.build +2 more+4 -80 replies
8/18hw/arm: Move units to softmmu[] by replacing "{target -> hw}/arm/cpu.h"hw/arm/highbank.c hw/arm/integratorcp.c hw/arm/mainstone.c +5 more+14 -140 replies
9/18hw/arm/armv7m: Remove 'target/arm/cpu.h' from NVIC headerhw/arm/armv7m.c include/hw/intc/armv7m_nvic.h+3 -10 replies
10/18hw/arm: Move various armv7m-related units to softmmu_ss[]hw/arm/meson.build+15 -120 replies
11/18hw/arm/digic: Remove unnecessary target_long usehw/arm/digic_boards.c+1 -11 reply
12/18hw/arm/digic: Replace object_initialize(ARMCPU) by object_new(ARMCPU)hw/arm/digic.c hw/arm/meson.build include/hw/arm/digic.h+8 -104 replies
13/18hw/arm/fsl-imx: Correct GPIO/GPT index in QOM treehw/arm/fsl-imx6ul.c hw/arm/fsl-imx7.c+4 -41 reply
14/18hw/arm/fsl-imx25: Replace object_initialize(ARMCPU) by object_new()hw/arm/fsl-imx25.c hw/arm/imx25_pdk.c hw/arm/meson.build +1 more+9 -80 replies
15/18hw/arm/fsl-imx31: Replace object_initialize(ARMCPU) by object_new()hw/arm/fsl-imx31.c hw/arm/kzm.c hw/arm/meson.build +1 more+9 -80 replies
16/18hw/arm/fsl-imx7: Replace object_initialize(ARMCPU) by object_new()hw/arm/fsl-imx7.c hw/arm/mcimx7d-sabre.c hw/arm/meson.build +1 more+7 -70 replies
17/18hw/arm/fsl-imx6: Replace object_initialize(ARMCPU) by object_new()hw/arm/fsl-imx6.c hw/arm/fsl-imx6ul.c hw/arm/mcimx6ul-evk.c +4 more+20 -200 replies
18/18hw/arm/allwinner: Replace object_initialize(ARMCPU) by object_new()hw/arm/allwinner-a10.c hw/arm/allwinner-h3.c hw/arm/cubieboard.c +3 more+19 -190 replies

Reviews trailers per patch

5 of 18 patches have a Reviewed-by or Acked-by.

PatchRichard Henderson
1/18R-b
2/18R-b
3/18R-b
4/18R-b
5/18
6/18
7/18
8/18
9/18
10/18
11/18R-b
12/18
13/18
14/18
15/18
16/18
17/18
18/18

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/18] hw/arm: Move various objects to softmmu_ss to build them once (part 1)

Hi,

This series unifies various objects from libqemu-arm-softmmu.fa.p and libqemu-aarch64-softmmu.fa.p into libcommon.fa.p.

So instead of building each object twice, one for 32-bit ARM ARM and another for 64-bit Aarch64, hardware-related objects are built once.

Part #1 is the low hanging fruits :) Also I cut the series under 20 patches to ease review digestion.

The overall logic is to only access ARMCPU as opaque pointer when possible. This way we don't depend on the (target/arm/) "cpu.h" header which contains target-specific definitions and forces units to be added in Meson's arm_ss[] specific source set.

In order to reduce use of "target/arm/cpu.h" by hardware units, we split the hardware-facing definitions in the new "hw/arm/cpu.h" header.

Finally, instead of using object_initialize() on the full ARMCPU variable, we use object_new(TYPE ARM_CPU). Since QOM types are registered with their class/instance size, we don't need to provide sizeof(ARMCPU) to allocate the object.

Please review,

Phil.

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

Philippe Mathieu-Daudé (18):
hw/arm: Move various units to softmmu_ss[]
hw/arm/boot: Include missing 'exec/cpu-all.h' header target/arm/cpregs: Include missing 'target/arm/cpu.h' header hw/arm: Use full "target/arm/cpu.h" path to include target's "cpu.h" target/arm: Move CPU QOM type definitions to "hw/arm/cpu.h" target/arm: Move CPU definitions consumed by HW model to

    "hw/arm/cpu.h"
  hw/arm: Move more units to softmmu_ss[]
  hw/arm: Move units to softmmu[] by replacing "{target ->
    hw}/arm/cpu.h"

hw/arm/armv7m: Remove 'target/arm/cpu.h' from NVIC header hw/arm: Move various armv7m-related units to softmmu_ss[] hw/arm/digic: Remove unnecessary target_long use hw/arm/digic: Replace object_initialize(ARMCPU) by object_new(ARMCPU) hw/arm/fsl-imx: Correct GPIO/GPT index in QOM tree hw/arm/fsl-imx25: Replace object_initialize(ARMCPU) by object_new() hw/arm/fsl-imx31: Replace object_initialize(ARMCPU) by object_new() hw/arm/fsl-imx7: Replace object_initialize(ARMCPU) by object_new() hw/arm/fsl-imx6: Replace object_initialize(ARMCPU) by object_new() hw/arm/allwinner: Replace object_initialize(ARMCPU) by object_new()

 hw/arm/allwinner-a10.c         | 10 ++--
 hw/arm/allwinner-h3.c          | 14 +++---
 hw/arm/armv7m.c                |  2 +
 hw/arm/boot.c                  |  1 +
 hw/arm/collie.c                |  1 -
 hw/arm/cubieboard.c            |  2 +-
 hw/arm/digic.c                 |  7 +--
 hw/arm/digic_boards.c          |  2 +-
 hw/arm/fsl-imx25.c             |  9 ++--
 hw/arm/fsl-imx31.c             |  9 ++--
 hw/arm/fsl-imx6.c              | 14 +++---
 hw/arm/fsl-imx6ul.c            | 12 ++---
 hw/arm/fsl-imx7.c              | 10 ++--
 hw/arm/gumstix.c               |  1 -
 hw/arm/highbank.c              |  2 +-
 hw/arm/imx25_pdk.c             |  2 +-
 hw/arm/integratorcp.c          |  2 +-
 hw/arm/kzm.c                   |  2 +-
 hw/arm/mainstone.c             |  2 +-
 hw/arm/mcimx6ul-evk.c          |  2 +-
 hw/arm/mcimx7d-sabre.c         |  2 +-
 hw/arm/meson.build             | 83 ++++++++++++++++++----------------
 hw/arm/musicpal.c              |  2 +-
 hw/arm/omap_sx1.c              |  1 -
 hw/arm/palm.c                  |  2 +-
 hw/arm/sabrelite.c             |  2 +-
 hw/arm/spitz.c                 |  2 +-
 hw/arm/strongarm.c             |  2 +-
 hw/arm/z2.c                    |  1 -
 include/hw/arm/allwinner-a10.h |  4 +-
 include/hw/arm/allwinner-h3.h  |  4 +-
 include/hw/arm/cpu.h           | 77 +++++++++++++++++++++++++++++++
 include/hw/arm/digic.h         |  4 +-
 include/hw/arm/fsl-imx25.h     |  4 +-
 include/hw/arm/fsl-imx31.h     |  4 +-
 include/hw/arm/fsl-imx6.h      |  4 +-
 include/hw/arm/fsl-imx6ul.h    |  4 +-
 include/hw/arm/fsl-imx7.h      |  4 +-
 include/hw/intc/armv7m_nvic.h  |  2 +-
 target/arm/cpregs.h            |  2 +
 target/arm/cpu-qom.h           | 28 +-----------
 target/arm/cpu.h               | 42 ++---------------
 42 files changed, 205 insertions(+), 181 deletions(-)
 create mode 100644 include/hw/arm/cpu.h
Signature · 1 line
2.38.1