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

Philippe Mathieu-Daudé posted 18 patches 1 year, 3 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230110164406.94366-1-philmd@linaro.org
Maintainers: Beniamino Galvani <b.galvani@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Niek Linnenbank <nieklinnenbank@gmail.com>, Antony Pavlov <antonynpavlov@gmail.com>, Jean-Christophe Dubois <jcd@tribudubois.net>, Andrey Smirnov <andrew.smirnov@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Rob Herring <robh@kernel.org>, Jan Kiszka <jan.kiszka@web.de>
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
[PATCH 00/18] hw/arm: Move various objects to softmmu_ss to build them once (part 1)
Posted by Philippe Mathieu-Daudé 1 year, 3 months ago
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: <20230109115316.2235-1-philmd@linaro.org>
          "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

-- 
2.38.1