[RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros

Philippe Mathieu-Daudé posted 14 patches 5 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250707172009.3884-1-philmd@linaro.org
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Beniamino Galvani <b.galvani@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Strahinja Jankovic <strahinja.p.jankovic@gmail.com>, Tyrone Ting <kfting@nuvoton.com>, Hao Wu <wuhaotsh@google.com>, John Snow <jsnow@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, Jonathan Cameron <jonathan.cameron@huawei.com>, Fan Ni <fan.ni@samsung.com>, Helge Deller <deller@gmx.de>, Gerd Hoffmann <kraxel@redhat.com>, Pavel Pisa <pisa@cmp.felk.cvut.cz>, Francisco Iglesias <francisco.iglesias@amd.com>, Vikram Garhwal <vikram.garhwal@bytedance.com>, Jason Wang <jasowang@redhat.com>, Dmitry Fleytman <dmitry.fleytman@gmail.com>, Aurelien Jarno <aurelien@aurel32.net>, Nicholas Piggin <npiggin@gmail.com>, "Frédéric Barrat" <fbarrat@linux.ibm.com>, Bernhard Beschow <shentey@gmail.com>, Yoshinori Sato <yoshinori.sato@nifty.com>, Magnus Damm <magnus.damm@gmail.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Alex Williamson <alex.williamson@redhat.com>, "Cédric Le Goater" <clg@redhat.com>, Alexander Graf <agraf@csgraf.de>, Phil Dennis-Jordan <phil@philjordan.eu>, "Alex Bennée" <alex.bennee@linaro.org>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, Peter Xu <peterx@redhat.com>, Riku Voipio <riku.voipio@iki.fi>, "Daniel P. Berrangé" <berrange@redhat.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, Song Gao <gaosong@loongson.cn>, Huacai Chen <chenhuacai@kernel.org>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <arikalo@gmail.com>, Alexandre Iooss <erdnaxe@crans.org>, Mahmoud Mandour <ma.mandourr@gmail.com>
meson.build                           |  1 +
include/exec/tswap.h                  | 83 +--------------------------
include/gdbstub/helpers.h             | 15 ++---
include/hw/arm/machines-qom.h         | 31 ++++++++++
include/hw/boards.h                   |  6 +-
include/qemu/bswap.h                  | 73 +++++++++++++++++++++++
include/qemu/target-info-impl.h       |  8 ++-
include/qemu/target-info-qapi.h       | 36 ++++++++++++
include/qemu/target-info.h            | 10 +++-
include/system/memory.h               |  1 -
include/user/abitypes.h               |  1 -
target/ppc/mmu-hash64.h               |  2 -
cpu-target.c                          |  7 ---
hw/acpi/bios-linker-loader.c          |  2 -
hw/arm/allwinner-r40.c                |  1 -
hw/arm/boot.c                         |  2 +
hw/arm/npcm7xx.c                      |  2 +-
hw/block/hd-geometry.c                |  1 -
hw/char/riscv_htif.c                  |  1 -
hw/core/cpu-system.c                  |  2 +-
hw/core/machine-qmp-cmds.c            |  8 +--
hw/core/null-machine.c                | 20 ++++++-
hw/cxl/cxl-events.c                   |  2 -
hw/display/artist.c                   |  1 +
hw/display/ati.c                      |  1 +
hw/display/vga.c                      |  2 +-
hw/net/can/ctucan_core.c              |  1 -
hw/net/lan9118.c                      |  1 +
hw/net/rtl8139.c                      |  1 +
hw/net/vmxnet3.c                      |  1 -
hw/pci-host/gt64120.c                 |  1 +
hw/pci-host/pnv_phb3.c                |  1 +
hw/pci-host/pnv_phb4.c                |  1 +
hw/pci-host/ppce500.c                 |  1 -
hw/pci-host/sh_pci.c                  |  1 -
hw/s390x/s390-pci-inst.c              |  1 +
hw/sensor/lsm303dlhc_mag.c            |  1 -
hw/smbios/smbios.c                    |  1 +
hw/vfio/migration-multifd.c           |  1 -
hw/virtio/virtio-config-io.c          |  1 -
hw/virtio/virtio-pci.c                |  1 +
hw/virtio/virtio.c                    |  2 +-
hw/vmapple/virtio-blk.c               |  1 -
system/memory.c                       |  1 +
system/qtest.c                        |  1 +
target-info-qom.c                     | 24 ++++++++
target-info-stub.c                    |  3 +
target-info.c                         | 33 +++++++++++
target/arm/arm-qmp-cmds.c             |  3 +-
target/arm/cpu.c                      |  1 -
target/arm/machine.c                  | 12 ++++
target/i386/tcg/system/excp_helper.c  |  1 -
target/i386/xsave_helper.c            |  1 -
target/loongarch/loongarch-qmp-cmds.c |  3 +-
target/mips/system/mips-qmp-cmds.c    |  3 +-
target/riscv/vector_helper.c          |  1 -
tests/tcg/plugins/mem.c               |  1 +
hw/block/meson.build                  |  6 +-
hw/virtio/meson.build                 | 20 ++++---
59 files changed, 302 insertions(+), 149 deletions(-)
create mode 100644 include/hw/arm/machines-qom.h
create mode 100644 include/qemu/target-info-qapi.h
create mode 100644 target-info-qom.c
[RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros
Posted by Philippe Mathieu-Daudé 5 months, 1 week ago
Rather than re-spinning the whole "single-binary: Make hw/arm/
common" series, restrict to the API additions, but include
examples of their usefulness (hundreds of virtio objects
removed from default Linux build).
Time passed since I context-switched out of this work so I'm
not sure the DEFINE_MACHINE_WITH_INTERFACES() implementation
is in the form Zoltan asked.

Philippe Mathieu-Daudé (14):
  target/qmp: Use target_cpu_type()
  qemu/target-info: Factor target_arch() out
  qemu/target-info: Add %target_arch field to TargetInfo
  qemu/target-info: Introduce target_base_arch()
  qemu/target-info: Add target_endian_mode()
  qemu: Convert target_words_bigendian() to TargetInfo API
  gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian()
  qemu: Declare all load/store helpert in 'qemu/bswap.h'
  hw/virtio: Build various files once
  hw/core/null-machine: Define machine as generic QOM type
  hw/arm: Register TYPE_TARGET_ARM/AARCH64_MACHINE QOM interfaces
  hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine
  hw/boards: Introduce DEFINE_MACHINE_WITH_INTERFACES() macro
  hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros

 meson.build                           |  1 +
 include/exec/tswap.h                  | 83 +--------------------------
 include/gdbstub/helpers.h             | 15 ++---
 include/hw/arm/machines-qom.h         | 31 ++++++++++
 include/hw/boards.h                   |  6 +-
 include/qemu/bswap.h                  | 73 +++++++++++++++++++++++
 include/qemu/target-info-impl.h       |  8 ++-
 include/qemu/target-info-qapi.h       | 36 ++++++++++++
 include/qemu/target-info.h            | 10 +++-
 include/system/memory.h               |  1 -
 include/user/abitypes.h               |  1 -
 target/ppc/mmu-hash64.h               |  2 -
 cpu-target.c                          |  7 ---
 hw/acpi/bios-linker-loader.c          |  2 -
 hw/arm/allwinner-r40.c                |  1 -
 hw/arm/boot.c                         |  2 +
 hw/arm/npcm7xx.c                      |  2 +-
 hw/block/hd-geometry.c                |  1 -
 hw/char/riscv_htif.c                  |  1 -
 hw/core/cpu-system.c                  |  2 +-
 hw/core/machine-qmp-cmds.c            |  8 +--
 hw/core/null-machine.c                | 20 ++++++-
 hw/cxl/cxl-events.c                   |  2 -
 hw/display/artist.c                   |  1 +
 hw/display/ati.c                      |  1 +
 hw/display/vga.c                      |  2 +-
 hw/net/can/ctucan_core.c              |  1 -
 hw/net/lan9118.c                      |  1 +
 hw/net/rtl8139.c                      |  1 +
 hw/net/vmxnet3.c                      |  1 -
 hw/pci-host/gt64120.c                 |  1 +
 hw/pci-host/pnv_phb3.c                |  1 +
 hw/pci-host/pnv_phb4.c                |  1 +
 hw/pci-host/ppce500.c                 |  1 -
 hw/pci-host/sh_pci.c                  |  1 -
 hw/s390x/s390-pci-inst.c              |  1 +
 hw/sensor/lsm303dlhc_mag.c            |  1 -
 hw/smbios/smbios.c                    |  1 +
 hw/vfio/migration-multifd.c           |  1 -
 hw/virtio/virtio-config-io.c          |  1 -
 hw/virtio/virtio-pci.c                |  1 +
 hw/virtio/virtio.c                    |  2 +-
 hw/vmapple/virtio-blk.c               |  1 -
 system/memory.c                       |  1 +
 system/qtest.c                        |  1 +
 target-info-qom.c                     | 24 ++++++++
 target-info-stub.c                    |  3 +
 target-info.c                         | 33 +++++++++++
 target/arm/arm-qmp-cmds.c             |  3 +-
 target/arm/cpu.c                      |  1 -
 target/arm/machine.c                  | 12 ++++
 target/i386/tcg/system/excp_helper.c  |  1 -
 target/i386/xsave_helper.c            |  1 -
 target/loongarch/loongarch-qmp-cmds.c |  3 +-
 target/mips/system/mips-qmp-cmds.c    |  3 +-
 target/riscv/vector_helper.c          |  1 -
 tests/tcg/plugins/mem.c               |  1 +
 hw/block/meson.build                  |  6 +-
 hw/virtio/meson.build                 | 20 ++++---
 59 files changed, 302 insertions(+), 149 deletions(-)
 create mode 100644 include/hw/arm/machines-qom.h
 create mode 100644 include/qemu/target-info-qapi.h
 create mode 100644 target-info-qom.c

-- 
2.49.0


Re: [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros
Posted by Michael S. Tsirkin 5 months, 1 week ago
On Mon, Jul 07, 2025 at 07:19:54PM +0200, Philippe Mathieu-Daudé wrote:
> Rather than re-spinning the whole "single-binary: Make hw/arm/
> common" series, restrict to the API additions, but include
> examples of their usefulness (hundreds of virtio objects
> removed from default Linux build).
> Time passed since I context-switched out of this work so I'm
> not sure the DEFINE_MACHINE_WITH_INTERFACES() implementation
> is in the form Zoltan asked.


I think I'd prefer to defer cleanups to post 10.1 - already
too much on my plate as I was out sick. Unless there's a reason
I'm missing to rush this in? Is there a feature we want in
10.1 that depends on it?

> Philippe Mathieu-Daudé (14):
>   target/qmp: Use target_cpu_type()
>   qemu/target-info: Factor target_arch() out
>   qemu/target-info: Add %target_arch field to TargetInfo
>   qemu/target-info: Introduce target_base_arch()
>   qemu/target-info: Add target_endian_mode()
>   qemu: Convert target_words_bigendian() to TargetInfo API
>   gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian()
>   qemu: Declare all load/store helpert in 'qemu/bswap.h'
>   hw/virtio: Build various files once
>   hw/core/null-machine: Define machine as generic QOM type
>   hw/arm: Register TYPE_TARGET_ARM/AARCH64_MACHINE QOM interfaces
>   hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine
>   hw/boards: Introduce DEFINE_MACHINE_WITH_INTERFACES() macro
>   hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros
> 
>  meson.build                           |  1 +
>  include/exec/tswap.h                  | 83 +--------------------------
>  include/gdbstub/helpers.h             | 15 ++---
>  include/hw/arm/machines-qom.h         | 31 ++++++++++
>  include/hw/boards.h                   |  6 +-
>  include/qemu/bswap.h                  | 73 +++++++++++++++++++++++
>  include/qemu/target-info-impl.h       |  8 ++-
>  include/qemu/target-info-qapi.h       | 36 ++++++++++++
>  include/qemu/target-info.h            | 10 +++-
>  include/system/memory.h               |  1 -
>  include/user/abitypes.h               |  1 -
>  target/ppc/mmu-hash64.h               |  2 -
>  cpu-target.c                          |  7 ---
>  hw/acpi/bios-linker-loader.c          |  2 -
>  hw/arm/allwinner-r40.c                |  1 -
>  hw/arm/boot.c                         |  2 +
>  hw/arm/npcm7xx.c                      |  2 +-
>  hw/block/hd-geometry.c                |  1 -
>  hw/char/riscv_htif.c                  |  1 -
>  hw/core/cpu-system.c                  |  2 +-
>  hw/core/machine-qmp-cmds.c            |  8 +--
>  hw/core/null-machine.c                | 20 ++++++-
>  hw/cxl/cxl-events.c                   |  2 -
>  hw/display/artist.c                   |  1 +
>  hw/display/ati.c                      |  1 +
>  hw/display/vga.c                      |  2 +-
>  hw/net/can/ctucan_core.c              |  1 -
>  hw/net/lan9118.c                      |  1 +
>  hw/net/rtl8139.c                      |  1 +
>  hw/net/vmxnet3.c                      |  1 -
>  hw/pci-host/gt64120.c                 |  1 +
>  hw/pci-host/pnv_phb3.c                |  1 +
>  hw/pci-host/pnv_phb4.c                |  1 +
>  hw/pci-host/ppce500.c                 |  1 -
>  hw/pci-host/sh_pci.c                  |  1 -
>  hw/s390x/s390-pci-inst.c              |  1 +
>  hw/sensor/lsm303dlhc_mag.c            |  1 -
>  hw/smbios/smbios.c                    |  1 +
>  hw/vfio/migration-multifd.c           |  1 -
>  hw/virtio/virtio-config-io.c          |  1 -
>  hw/virtio/virtio-pci.c                |  1 +
>  hw/virtio/virtio.c                    |  2 +-
>  hw/vmapple/virtio-blk.c               |  1 -
>  system/memory.c                       |  1 +
>  system/qtest.c                        |  1 +
>  target-info-qom.c                     | 24 ++++++++
>  target-info-stub.c                    |  3 +
>  target-info.c                         | 33 +++++++++++
>  target/arm/arm-qmp-cmds.c             |  3 +-
>  target/arm/cpu.c                      |  1 -
>  target/arm/machine.c                  | 12 ++++
>  target/i386/tcg/system/excp_helper.c  |  1 -
>  target/i386/xsave_helper.c            |  1 -
>  target/loongarch/loongarch-qmp-cmds.c |  3 +-
>  target/mips/system/mips-qmp-cmds.c    |  3 +-
>  target/riscv/vector_helper.c          |  1 -
>  tests/tcg/plugins/mem.c               |  1 +
>  hw/block/meson.build                  |  6 +-
>  hw/virtio/meson.build                 | 20 ++++---
>  59 files changed, 302 insertions(+), 149 deletions(-)
>  create mode 100644 include/hw/arm/machines-qom.h
>  create mode 100644 include/qemu/target-info-qapi.h
>  create mode 100644 target-info-qom.c
> 
> -- 
> 2.49.0
Re: [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros
Posted by Alex Bennée 5 months, 1 week ago
"Michael S. Tsirkin" <mst@redhat.com> writes:

> On Mon, Jul 07, 2025 at 07:19:54PM +0200, Philippe Mathieu-Daudé wrote:
>> Rather than re-spinning the whole "single-binary: Make hw/arm/
>> common" series, restrict to the API additions, but include
>> examples of their usefulness (hundreds of virtio objects
>> removed from default Linux build).
>> Time passed since I context-switched out of this work so I'm
>> not sure the DEFINE_MACHINE_WITH_INTERFACES() implementation
>> is in the form Zoltan asked.
>
> I think I'd prefer to defer cleanups to post 10.1 - already
> too much on my plate as I was out sick. Unless there's a reason
> I'm missing to rush this in? Is there a feature we want in
> 10.1 that depends on it?

This is all part of reducing the number of duplicate builds of device
models which after the stubs VirtIO is the main remaining sub-system due
for clean-up:

  ➜  ./.gitlab-ci.d/check-units.py ./builds/system/compile_commands.json -n 80
  Total source files: 3595
  Total build units: 5658
  Most rebuilt units:
    ../../dump/win_dump.c built 29 times
    ../../cpu-target.c built 29 times
    ../../system/arch_init.c built 29 times
    ../../system/globals-target.c built 29 times
    ../../page-target.c built 29 times
    ../../page-vary-target.c built 29 times
    ../../target-info-stub.c built 29 times
    ../../migration/ram.c built 29 times
    ../../migration/target.c built 29 times
    ../../monitor/hmp-cmds-target.c built 29 times
    ../../monitor/hmp-target.c built 29 times
    ../../accel/accel-target.c built 29 times
    ../../accel/stubs/hvf-stub.c built 29 times
    ../../accel/stubs/nvmm-stub.c built 29 times
    ../../accel/stubs/whpx-stub.c built 29 times
    ../../accel/qtest/qtest.c built 29 times
    ../../system/main.c built 29 times
    ../../hw/i386/kvm/xen-stubs.c built 27 times
    ../../accel/stubs/xen-stub.c built 27 times
    ../../accel/stubs/kvm-stub.c built 27 times
    ../../hw/9pfs/virtio-9p-device.c built 23 times
    ../../hw/block/virtio-blk.c built 23 times
    ../../hw/block/virtio-blk-common.c built 23 times
    ../../hw/char/virtio-serial-bus.c built 23 times
    ../../hw/net/virtio-net.c built 23 times
    ../../hw/scsi/virtio-scsi.c built 23 times
    ../../hw/scsi/vhost-scsi-common.c built 23 times
    ../../hw/virtio/virtio.c built 23 times
    ../../hw/virtio/virtio-config-io.c built 23 times
    ../../hw/virtio/virtio-qmp.c built 23 times
    ../../hw/virtio/vhost-backend.c built 23 times
    ../../hw/virtio/vhost-iova-tree.c built 23 times
    ../../hw/virtio/vhost-user.c built 23 times
    ../../hw/virtio/vhost-shadow-virtqueue.c built 23 times
    ../../hw/virtio/virtio-balloon.c built 23 times
    ../../hw/virtio/vhost-user-fs.c built 23 times
    ../../hw/virtio/vhost-vsock.c built 23 times
    ../../hw/virtio/vhost-user-vsock.c built 23 times
    ../../hw/virtio/virtio-rng.c built 23 times
    ../../hw/block/vhost-user-blk.c built 22 times
    ../../hw/vfio/listener.c built 22 times
    ../../hw/vfio/container-base.c built 22 times
    ../../hw/vfio/container.c built 22 times
    ../../hw/vfio/helpers.c built 22 times
    ../../hw/vfio/pci-quirks.c built 22 times
    ../../hw/vfio/pci.c built 22 times
    ../../hw/virtio/vhost-vsock-pci.c built 22 times
    ../../hw/virtio/vhost-user-vsock-pci.c built 22 times
    ../../hw/virtio/vhost-user-blk-pci.c built 22 times
    ../../hw/virtio/vhost-user-scsi-pci.c built 22 times
    ../../hw/virtio/vhost-scsi-pci.c built 22 times
    ../../hw/virtio/vhost-user-fs-pci.c built 22 times
    ../../hw/virtio/virtio-crypto-pci.c built 22 times
    ../../hw/virtio/virtio-input-host-pci.c built 22 times
    ../../hw/virtio/virtio-input-pci.c built 22 times
    ../../hw/virtio/virtio-rng-pci.c built 22 times
    ../../hw/virtio/virtio-balloon-pci.c built 22 times
    ../../hw/virtio/virtio-9p-pci.c built 22 times
    ../../hw/virtio/virtio-scsi-pci.c built 22 times
    ../../hw/virtio/virtio-blk-pci.c built 22 times
    ../../hw/virtio/virtio-net-pci.c built 22 times
    ../../hw/virtio/virtio-serial-pci.c built 22 times
    ../../hw/virtio/virtio-iommu-pci.c built 22 times
    ../../hw/virtio/vdpa-dev-pci.c built 22 times
    ../../tests/unit/iothread.c built 16 times
    ../../hw/nvram/fw_cfg-acpi.c built 13 times
    ../../semihosting/guestfd.c built 11 times
    ../../semihosting/syscalls.c built 11 times
    ../../tests/qtest/tpm-emu.c built 8 times
    ../../hw/vfio/platform.c built 7 times
    ../../tests/qtest/tpm-util.c built 7 times
    ../../tests/qtest/tpm-tests.c built 7 times
    ../../hw/virtio/virtio-mem.c built 5 times
    ../../hw/virtio/virtio-mem-pci.c built 5 times
    ../../hw/virtio/virtio-md-pci.c built 5 times
    ../../tests/unit/socket-helpers.c built 5 times
    ../../tests/unit/io-channel-helpers.c built 5 times
    ../../fpu/softfloat.c built 4 times
    ../../semihosting/arm-compat-semi.c built 4 times
    ../../target/mips/system/addr.c built 4 times

Aside from reducing build times and overall load on the CI systems its
required to advance the single-binary QEMU build and get us closer to
being able to do proper heterogeneous emulation.

I don't think missing 10.1 would be critical for the single binary proof
of concept but obviously as with all changes that touch the whole code
base the longer the review takes the more time they spend in re-base
hell.

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro
Re: [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros
Posted by Philippe Mathieu-Daudé 5 months, 1 week ago
On 7/7/25 19:55, Michael S. Tsirkin wrote:
> On Mon, Jul 07, 2025 at 07:19:54PM +0200, Philippe Mathieu-Daudé wrote:
>> Rather than re-spinning the whole "single-binary: Make hw/arm/
>> common" series, restrict to the API additions, but include
>> examples of their usefulness (hundreds of virtio objects
>> removed from default Linux build).
>> Time passed since I context-switched out of this work so I'm
>> not sure the DEFINE_MACHINE_WITH_INTERFACES() implementation
>> is in the form Zoltan asked.
> 
> 
> I think I'd prefer to defer cleanups to post 10.1 - already
> too much on my plate as I was out sick. Unless there's a reason
> I'm missing to rush this in? Is there a feature we want in
> 10.1 that depends on it?

Fair enough for the virtio patch.

Hopefully the previous ones (TargetInfo related, not touching
virtio) could get in (you don't have to look a them ;P).

> 
>> Philippe Mathieu-Daudé (14):
>>    target/qmp: Use target_cpu_type()
>>    qemu/target-info: Factor target_arch() out
>>    qemu/target-info: Add %target_arch field to TargetInfo
>>    qemu/target-info: Introduce target_base_arch()
>>    qemu/target-info: Add target_endian_mode()
>>    qemu: Convert target_words_bigendian() to TargetInfo API
>>    gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian()
>>    qemu: Declare all load/store helpert in 'qemu/bswap.h'

Re: [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros
Posted by Philippe Mathieu-Daudé 5 months, 1 week ago
On 7/7/25 19:19, Philippe Mathieu-Daudé wrote:
> Rather than re-spinning the whole "single-binary: Make hw/arm/
> common" series, restrict to the API additions, but include
> examples of their usefulness (hundreds of virtio objects
> removed from default Linux build).
> Time passed since I context-switched out of this work so I'm
> not sure the DEFINE_MACHINE_WITH_INTERFACES() implementation
> is in the form Zoltan asked.
> 
> Philippe Mathieu-Daudé (14):
>    target/qmp: Use target_cpu_type()
>    qemu/target-info: Factor target_arch() out
>    qemu/target-info: Add %target_arch field to TargetInfo
>    qemu/target-info: Introduce target_base_arch()
>    qemu/target-info: Add target_endian_mode()
>    qemu: Convert target_words_bigendian() to TargetInfo API
>    gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian()
>    qemu: Declare all load/store helpert in 'qemu/bswap.h'
>    hw/virtio: Build various files once

Sorry, I cut this branch incorrectly, I should have posted only up
to here, as the rest isn't required. I'll respin for clarity.

>    hw/core/null-machine: Define machine as generic QOM type
>    hw/arm: Register TYPE_TARGET_ARM/AARCH64_MACHINE QOM interfaces
>    hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine
>    hw/boards: Introduce DEFINE_MACHINE_WITH_INTERFACES() macro
>    hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros


Re: [RFC PATCH-for-10.1 v6 00/14] target-info: Add more API for VirtIO cleanups & introduce ARM macros
Posted by BALATON Zoltan 5 months, 1 week ago
On Mon, 7 Jul 2025, Philippe Mathieu-Daudé wrote:
> Rather than re-spinning the whole "single-binary: Make hw/arm/
> common" series, restrict to the API additions, but include
> examples of their usefulness (hundreds of virtio objects
> removed from default Linux build).
> Time passed since I context-switched out of this work so I'm
> not sure the DEFINE_MACHINE_WITH_INTERFACES() implementation
> is in the form Zoltan asked.

I've sent the patch here:
https://patchew.org/QEMU/cover.1751494995.git.balaton@eik.bme.hu/3c2aa5b895adbb5244b643a6672603d65dce4298.1751494995.git.balaton@eik.bme.hu/
that will hopefully be merged before the freeze so you can rebase on that.

Regards,
BALATON Zoltan

> Philippe Mathieu-Daudé (14):
>  target/qmp: Use target_cpu_type()
>  qemu/target-info: Factor target_arch() out
>  qemu/target-info: Add %target_arch field to TargetInfo
>  qemu/target-info: Introduce target_base_arch()
>  qemu/target-info: Add target_endian_mode()
>  qemu: Convert target_words_bigendian() to TargetInfo API
>  gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian()
>  qemu: Declare all load/store helpert in 'qemu/bswap.h'
>  hw/virtio: Build various files once
>  hw/core/null-machine: Define machine as generic QOM type
>  hw/arm: Register TYPE_TARGET_ARM/AARCH64_MACHINE QOM interfaces
>  hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine
>  hw/boards: Introduce DEFINE_MACHINE_WITH_INTERFACES() macro
>  hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros
>
> meson.build                           |  1 +
> include/exec/tswap.h                  | 83 +--------------------------
> include/gdbstub/helpers.h             | 15 ++---
> include/hw/arm/machines-qom.h         | 31 ++++++++++
> include/hw/boards.h                   |  6 +-
> include/qemu/bswap.h                  | 73 +++++++++++++++++++++++
> include/qemu/target-info-impl.h       |  8 ++-
> include/qemu/target-info-qapi.h       | 36 ++++++++++++
> include/qemu/target-info.h            | 10 +++-
> include/system/memory.h               |  1 -
> include/user/abitypes.h               |  1 -
> target/ppc/mmu-hash64.h               |  2 -
> cpu-target.c                          |  7 ---
> hw/acpi/bios-linker-loader.c          |  2 -
> hw/arm/allwinner-r40.c                |  1 -
> hw/arm/boot.c                         |  2 +
> hw/arm/npcm7xx.c                      |  2 +-
> hw/block/hd-geometry.c                |  1 -
> hw/char/riscv_htif.c                  |  1 -
> hw/core/cpu-system.c                  |  2 +-
> hw/core/machine-qmp-cmds.c            |  8 +--
> hw/core/null-machine.c                | 20 ++++++-
> hw/cxl/cxl-events.c                   |  2 -
> hw/display/artist.c                   |  1 +
> hw/display/ati.c                      |  1 +
> hw/display/vga.c                      |  2 +-
> hw/net/can/ctucan_core.c              |  1 -
> hw/net/lan9118.c                      |  1 +
> hw/net/rtl8139.c                      |  1 +
> hw/net/vmxnet3.c                      |  1 -
> hw/pci-host/gt64120.c                 |  1 +
> hw/pci-host/pnv_phb3.c                |  1 +
> hw/pci-host/pnv_phb4.c                |  1 +
> hw/pci-host/ppce500.c                 |  1 -
> hw/pci-host/sh_pci.c                  |  1 -
> hw/s390x/s390-pci-inst.c              |  1 +
> hw/sensor/lsm303dlhc_mag.c            |  1 -
> hw/smbios/smbios.c                    |  1 +
> hw/vfio/migration-multifd.c           |  1 -
> hw/virtio/virtio-config-io.c          |  1 -
> hw/virtio/virtio-pci.c                |  1 +
> hw/virtio/virtio.c                    |  2 +-
> hw/vmapple/virtio-blk.c               |  1 -
> system/memory.c                       |  1 +
> system/qtest.c                        |  1 +
> target-info-qom.c                     | 24 ++++++++
> target-info-stub.c                    |  3 +
> target-info.c                         | 33 +++++++++++
> target/arm/arm-qmp-cmds.c             |  3 +-
> target/arm/cpu.c                      |  1 -
> target/arm/machine.c                  | 12 ++++
> target/i386/tcg/system/excp_helper.c  |  1 -
> target/i386/xsave_helper.c            |  1 -
> target/loongarch/loongarch-qmp-cmds.c |  3 +-
> target/mips/system/mips-qmp-cmds.c    |  3 +-
> target/riscv/vector_helper.c          |  1 -
> tests/tcg/plugins/mem.c               |  1 +
> hw/block/meson.build                  |  6 +-
> hw/virtio/meson.build                 | 20 ++++---
> 59 files changed, 302 insertions(+), 149 deletions(-)
> create mode 100644 include/hw/arm/machines-qom.h
> create mode 100644 include/qemu/target-info-qapi.h
> create mode 100644 target-info-qom.c
>
>