Skip to contentSkip to conversation

Misc single binary patches for 2025-04-25

GIT PULL Applied Philippe Mathieu-Daudé 5 participants 69 messages Apr 25, 2025 – Jun 10, 2025

Subsystems (10)
lore
Share & tools
lore
#0 lore raw

The following changes since commit 019fbfa4bcd2d3a835c241295e22ab2b5b56129b:

Merge tag 'pull-misc-2025-04-24' of https://repo.or.cz/qemu/armbru into staging (2025-04-24 13:44:57 -0400)

are available in the Git repository at:

https://github.com/philmd/qemu.git tags/single-binary-20250425

for you to fetch changes up to 3d881164d4fb2b0f6791cf28d9725926b8ded0d6:

qemu: Convert target_name() to TargetInfo API (2025-04-25 17:09:58 +0200)

----------------------------------------------------------------
Various patches loosely related to single binary work:

- Replace cpu_list() definition by CPUClass::list_cpus() callback
- Remove few MO_TE definitions on Hexagon / X86 targets
- Remove target_ulong uses in ARMMMUFaultInfo and ARM CPUWatchpoint
- Remove DEVICE_HOST_ENDIAN definition
- Evaluate TARGET_BIG_ENDIAN at compile time and use target_needs_bswap() more
- Rename target_words_bigendian() as target_big_endian()
- Convert target_name() and target_cpu_type() to TargetInfo API
- Constify QOM TypeInfo class_data/interfaces fields
- Get default_cpu_type calling machine_class_default_cpu_type()
- Correct various uses of GLibCompareDataFunc prototype
- Simplify ARM/Aarch64 gdb_get_core_xml_file() handling a bit
- Move device tree files in their own pc-bios/dtb/ subdir
- Correctly check strchrnul() symbol availability on macOS SDK
- Move target-agnostic methods out of cpu-target.c and accel-target.c
- Unmap canceled USB XHCI packet
- Use deposit/extract API in designware model
- Fix MIPS16e translation
- Few missing header fixes

Following checkpatch errors deliberately ignored:

13/58 Checking commit 16f9997f3e8f (qom: Have class_init() take a const data argument)
WARNING: line over 80 characters
#21029: FILE: scripts/codeconverter/codeconverter/qom_type_info.py:801:
+# yield self.prepend(('static void %s_class_init(ObjectClass *oc,\n'

WARNING: line over 80 characters
#21030: FILE: scripts/codeconverter/codeconverter/qom_type_info.py:802:
+# 'const void *data)\n'

total: 0 errors, 2 warnings, 13722 lines checked

57/58 Checking commit 95be355a03e5 (accel: Move target-agnostic code from accel-target.c -> accel-common.c)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#21:
new file mode 100644

WARNING: Saw acceptable license 'MIT' but note 'GPL-2.0-or-later' is preferred for new files unless the code is derived from a source file with an existing declared license that must be retained. Please explain the license choice in the commit message.
total: 0 errors, 2 warnings, 288 lines checked

Patch 57/58 has style problems, please review. If any of these errors

----------------------------------------------------------------

Akihiko Odaki (5):
hw/usb/hcd-xhci: Unmap canceled packet
meson: Use has_header_symbol() to check getcpu()
meson: Remove CONFIG_STATX and CONFIG_STATX_MNT_ID
meson: Share common C source prefixes
meson: Use osdep_prefix for strchrnul()

BALATON Zoltan (3):
hw/intc/i8259: Remove unused DEBUG_PIC define system/datadir: Add new type constant for DTB files
pc-bios: Move device tree files in their own subdir

Hauke Mehrtens (1):
target/mips: Fix MIPS16e translation

Kohei Tokunaga (5):
qom/object: Fix type conflict of GLib function pointers hw/core/loader: Fix type conflict of GLib function pointers hw/net/can: Fix type conflict of GLib function pointers contrib/plugins: Fix type conflict of GLib function pointers system/vl: Fix type conflict of GLib function pointers

Peter Maydell (5):
hw/core/cpu: gdb_arch_name string should not be freed
gdbstub: Allow gdb_core_xml_file to be set at runtime target/arm: Handle AArch64 in TYPE_ARM_CPU gdb_arch_name target/arm: Handle gdb_core_xml_file in TYPE_ARM_CPU target/arm: Handle AArch64 gdb read/write regs in TYPE_ARM_CPU

Philippe Mathieu-Daudé (38):
target/hexagon: Explode MO_TExx -> MO_TE | MO_xx target/hexagon: Replace MO_TE -> MO_LE
target/i386: Replace MO_TE* -> MO_LE*
cpus: Introduce CPUClass::list_cpus() callback target/i386: Register CPUClass:list_cpus
target/ppc: Register CPUClass:list_cpus
target/sparc: Register CPUClass:list_cpus
target/s390x: Register CPUClass:list_cpus
cpus: Remove #ifdef check on cpu_list definition hw/pci-host/designware: Use deposit/extract API hw/misc/edu: Convert type_init() -> DEFINE_TYPES()
qom: Have class_base_init() take a const data argument
qom: Have class_init() take a const data argument
qom: Constify TypeInfo::class_data
qom: Constify TypeInfo::interfaces
qom: Make InterfaceInfo[] uses const
hw/core: Get default_cpu_type calling machine_class_default_cpu_type() target/arm: Replace target_ulong -> hwaddr in ARMMMUFaultInfo target/arm: Replace target_ulong -> vaddr for CPUWatchpoint
exec: Rename target_words_bigendian() -> target_big_endian() system/memory: Remove DEVICE_HOST_ENDIAN definition accel/tcg: Correct list of included headers in tcg-stub.c target/hexagon: Include missing 'accel/tcg/getpc.h' linux-user/elfload: Use target_needs_bswap()
accel/kvm: Use target_needs_bswap()
target/mips: Check CPU endianness at runtime using env_is_bigendian() target/xtensa: Evaluate TARGET_BIG_ENDIAN at compile time hw/mips: Evaluate TARGET_BIG_ENDIAN at compile time hw/microblaze: Evaluate TARGET_BIG_ENDIAN at compile time
qapi: Rename TargetInfo structure as QemuTargetInfo
qemu: Introduce target_cpu_type()
cpus: Replace CPU_RESOLVING_TYPE -> target_cpu_type()
cpus: Move target-agnostic methods out of cpu-target.c
accel: Implement accel_init_ops_interfaces() for both system/user mode
accel: Include missing 'qemu/accel.h' header in accel-internal.h
accel: Make AccelCPUClass structure target-agnostic
accel: Move target-agnostic code from accel-target.c -> accel-common.c
qemu: Convert target_name() to TargetInfo API

Pierrick Bouvier (1):
system/kvm: make functions accessible from common code

 MAINTAINERS                                   |  13 +-
 docs/devel/qom.rst                            |   8 +-
 docs/devel/reset.rst                          |   2 +-
 docs/devel/virtio-backends.rst                |   2 +-
 meson.build                                   |  85 +++++------
 qapi/machine.json                             |  10 +-
 accel/{accel-system.h => accel-internal.h}    |  10 +-
 hw/usb/hcd-uhci.h                             |   2 +-
 include/accel/accel-cpu-target.h              |  12 +-
 include/accel/accel-cpu.h                     |  23 +++
 include/exec/cpu-common.h                     |   6 -
 include/exec/tswap.h                          |  12 +-
 include/hw/boards.h                           |   2 +-
 include/hw/core/cpu.h                         |  12 +-
 include/hw/i386/pc.h                          |   5 +-
 include/hw/virtio/virtio-pci.h                |   4 +-
 include/qemu/datadir.h                        |  11 +-
 include/qemu/target-info-impl.h               |  26 ++++
 include/qemu/target-info.h                    |  26 ++++
 include/qom/object.h                          |  12 +-
 include/system/kvm.h                          |   8 +-
 system/memory-internal.h                      |   5 +-
 target/arm/cpu.h                              |   2 +-
 target/arm/internals.h                        |  20 ++-
 target/hexagon/macros.h                       |  11 +-
 target/hexagon/mmvec/macros.h                 |   1 +
 target/i386/cpu.h                             |   3 -
 target/ppc/cpu.h                              |   7 +-
 target/s390x/cpu.h                            |   7 -
 target/s390x/cpu_models.h                     |   3 +
 target/sparc/cpu.h                            |   3 -
 accel/accel-common.c                          | 142 ++++++++++++++++++
 accel/accel-system.c                          |   4 +-
 accel/accel-target.c                          | 134 -----------------
 accel/accel-user.c                            |   6 +
 accel/hvf/hvf-accel-ops.c                     |   4 +-
 accel/kvm/kvm-accel-ops.c                     |   2 +-
 accel/kvm/kvm-all.c                           |  32 ++--
 accel/qtest/qtest.c                           |   4 +-
 accel/stubs/tcg-stub.c                        |   3 +-
 accel/tcg/tcg-accel-ops.c                     |   2 +-
 accel/tcg/tcg-all.c                           |   7 +-
 accel/xen/xen-all.c                           |   4 +-
 authz/list.c                                  |   4 +-
 authz/listfile.c                              |   4 +-
 authz/pamacct.c                               |   4 +-
 authz/simple.c                                |   4 +-
 backends/confidential-guest-support.c         |   3 +-
 backends/cryptodev-builtin.c                  |   2 +-
 backends/cryptodev-lkcf.c                     |   2 +-
 backends/cryptodev-vhost-user.c               |   2 +-
 backends/cryptodev.c                          |   4 +-
 backends/dbus-vmstate.c                       |   4 +-
 backends/host_iommu_device.c                  |   2 +-
 backends/hostmem-epc.c                        |   2 +-
 backends/hostmem-file.c                       |   2 +-
 backends/hostmem-memfd.c                      |   2 +-
 backends/hostmem-ram.c                        |   2 +-
 backends/hostmem-shm.c                        |   2 +-
 backends/hostmem.c                            |   4 +-
 backends/iommufd.c                            |   6 +-
 backends/rng-builtin.c                        |   2 +-
 backends/rng-egd.c                            |   2 +-
 backends/rng-random.c                         |   2 +-
 backends/rng.c                                |   4 +-
 backends/tpm/tpm_emulator.c                   |   2 +-
 backends/tpm/tpm_passthrough.c                |   2 +-
 backends/vhost-user.c                         |   2 +-
 block/throttle-groups.c                       |   5 +-
 chardev/baum.c                                |   2 +-
 chardev/char-console.c                        |   2 +-
 chardev/char-fd.c                             |   2 +-
 chardev/char-file.c                           |   2 +-
 chardev/char-hub.c                            |   2 +-
 chardev/char-mux.c                            |   2 +-
 chardev/char-null.c                           |   2 +-
 chardev/char-parallel.c                       |   2 +-
 chardev/char-pipe.c                           |   2 +-
 chardev/char-pty.c                            |   2 +-
 chardev/char-ringbuf.c                        |   2 +-
 chardev/char-serial.c                         |   2 +-
 chardev/char-socket.c                         |   2 +-
 chardev/char-stdio.c                          |   2 +-
 chardev/char-udp.c                            |   2 +-
 chardev/char-win-stdio.c                      |   2 +-
 chardev/char-win.c                            |   2 +-
 chardev/char.c                                |   2 +-
 chardev/msmouse.c                             |   2 +-
 chardev/spice.c                               |   6 +-
 chardev/testdev.c                             |   2 +-
 chardev/wctablet.c                            |   2 +-
 contrib/plugins/cache.c                       |  12 +-
 contrib/plugins/cflow.c                       |  10 +-
 contrib/plugins/hotblocks.c                   |   4 +-
 contrib/plugins/hotpages.c                    |   4 +-
 contrib/plugins/howvec.c                      |   4 +-
 contrib/plugins/hwprofile.c                   |   8 +-
 cpu-target.c                                  |  86 +----------
 crypto/secret.c                               |   2 +-
 crypto/secret_common.c                        |   4 +-
 crypto/secret_keyring.c                       |   2 +-
 crypto/tls-cipher-suites.c                    |   5 +-
 crypto/tlscreds.c                             |   2 +-
 crypto/tlscredsanon.c                         |   4 +-
 crypto/tlscredspsk.c                          |   4 +-
 crypto/tlscredsx509.c                         |   4 +-
 event-loop-base.c                             |   5 +-
 gdbstub/gdbstub.c                             |  23 ++-
 gdbstub/system.c                              |   2 +-
 hw/9pfs/virtio-9p-device.c                    |   2 +-
 hw/acpi/erst.c                                |   4 +-
 hw/acpi/generic_event_device.c                |   4 +-
 hw/acpi/pci.c                                 |   4 +-
 hw/acpi/piix4.c                               |   4 +-
 hw/acpi/vmclock.c                             |   2 +-
 hw/acpi/vmgenid.c                             |   2 +-
 hw/adc/aspeed_adc.c                           |  10 +-
 hw/adc/npcm7xx_adc.c                          |   2 +-
 hw/adc/stm32f2xx_adc.c                        |   2 +-
 hw/adc/zynq-xadc.c                            |   2 +-
 hw/alpha/typhoon.c                            |   2 +-
 hw/arm/allwinner-a10.c                        |   2 +-
 hw/arm/allwinner-h3.c                         |   2 +-
 hw/arm/allwinner-r40.c                        |   2 +-
 hw/arm/armsse.c                               |   6 +-
 hw/arm/armv7m.c                               |   4 +-
 hw/arm/aspeed.c                               |  59 +++++---
 hw/arm/aspeed_ast10x0.c                       |   2 +-
 hw/arm/aspeed_ast2400.c                       |   4 +-
 hw/arm/aspeed_ast2600.c                       |   2 +-
 hw/arm/aspeed_ast27x0.c                       |   4 +-
 hw/arm/aspeed_soc_common.c                    |   2 +-
 hw/arm/b-l475e-iot01a.c                       |   2 +-
 hw/arm/bcm2835_peripherals.c                  |   2 +-
 hw/arm/bcm2836.c                              |   8 +-
 hw/arm/bcm2838.c                              |   2 +-
 hw/arm/bcm2838_peripherals.c                  |   2 +-
 hw/arm/collie.c                               |   2 +-
 hw/arm/digic.c                                |   2 +-
 hw/arm/exynos4210.c                           |   2 +-
 hw/arm/exynos4_boards.c                       |   4 +-
 hw/arm/fby35.c                                |   2 +-
 hw/arm/fsl-imx25.c                            |   2 +-
 hw/arm/fsl-imx31.c                            |   2 +-
 hw/arm/fsl-imx6.c                             |   2 +-
 hw/arm/fsl-imx6ul.c                           |   2 +-
 hw/arm/fsl-imx7.c                             |   2 +-
 hw/arm/fsl-imx8mp.c                           |   2 +-
 hw/arm/highbank.c                             |   6 +-
 hw/arm/integratorcp.c                         |   6 +-
 hw/arm/microbit.c                             |   2 +-
 hw/arm/mps2-tz.c                              |  12 +-
 hw/arm/mps2.c                                 |  10 +-
 hw/arm/mps3r.c                                |   4 +-
 hw/arm/msf2-soc.c                             |   2 +-
 hw/arm/musca.c                                |   6 +-
 hw/arm/musicpal.c                             |  14 +-
 hw/arm/npcm7xx.c                              |   6 +-
 hw/arm/npcm7xx_boards.c                       |  12 +-
 hw/arm/npcm8xx.c                              |   2 +-
 hw/arm/npcm8xx_boards.c                       |   4 +-
 hw/arm/nrf51_soc.c                            |   2 +-
 hw/arm/omap_sx1.c                             |   4 +-
 hw/arm/raspi.c                                |  10 +-
 hw/arm/raspi4b.c                              |   2 +-
 hw/arm/realview.c                             |   8 +-
 hw/arm/sbsa-ref.c                             |   2 +-
 hw/arm/smmu-common.c                          |   2 +-
 hw/arm/smmuv3.c                               |   4 +-
 hw/arm/stellaris.c                            |  10 +-
 hw/arm/stm32f100_soc.c                        |   2 +-
 hw/arm/stm32f205_soc.c                        |   2 +-
 hw/arm/stm32f405_soc.c                        |   2 +-
 hw/arm/stm32l4x5_soc.c                        |   8 +-
 hw/arm/strongarm.c                            |  13 +-
 hw/arm/versatilepb.c                          |   6 +-
 hw/arm/vexpress.c                             |   6 +-
 hw/arm/virt.c                                 |   6 +-
 hw/arm/xen-pvh.c                              |   2 +-
 hw/arm/xilinx_zynq.c                          |   2 +-
 hw/arm/xlnx-versal-virt.c                     |   2 +-
 hw/arm/xlnx-versal.c                          |   2 +-
 hw/arm/xlnx-zcu102.c                          |   2 +-
 hw/arm/xlnx-zynqmp.c                          |   2 +-
 hw/audio/ac97.c                               |   4 +-
 hw/audio/adlib.c                              |   2 +-
 hw/audio/asc.c                                |   2 +-
 hw/audio/cs4231.c                             |   2 +-
 hw/audio/cs4231a.c                            |   2 +-
 hw/audio/es1370.c                             |   4 +-
 hw/audio/gus.c                                |   2 +-
 hw/audio/hda-codec.c                          |   8 +-
 hw/audio/intel-hda.c                          |  10 +-
 hw/audio/marvell_88w8618.c                    |   2 +-
 hw/audio/pcspk.c                              |   2 +-
 hw/audio/pl041.c                              |   2 +-
 hw/audio/sb16.c                               |   2 +-
 hw/audio/via-ac97.c                           |   8 +-
 hw/audio/virtio-snd-pci.c                     |   2 +-
 hw/audio/virtio-snd.c                         |   2 +-
 hw/audio/wm8750.c                             |   2 +-
 hw/avr/arduino.c                              |  10 +-
 hw/avr/atmega.c                               |  10 +-
 hw/block/fdc-isa.c                            |   4 +-
 hw/block/fdc-sysbus.c                         |   6 +-
 hw/block/fdc.c                                |   2 +-
 hw/block/m25p80.c                             |   6 +-
 hw/block/nand.c                               |   2 +-
 hw/block/pflash_cfi01.c                       |   2 +-
 hw/block/pflash_cfi02.c                       |   2 +-
 hw/block/swim.c                               |   4 +-
 hw/block/vhost-user-blk.c                     |   2 +-
 hw/block/virtio-blk.c                         |   2 +-
 hw/block/xen-block.c                          |   6 +-
 hw/char/avr_usart.c                           |   2 +-
 hw/char/bcm2835_aux.c                         |   2 +-
 hw/char/cadence_uart.c                        |   2 +-
 hw/char/cmsdk-apb-uart.c                      |   2 +-
 hw/char/debugcon.c                            |   2 +-
 hw/char/digic-uart.c                          |   2 +-
 hw/char/diva-gsp.c                            |   8 +-
 hw/char/escc.c                                |   2 +-
 hw/char/exynos4210_uart.c                     |   2 +-
 hw/char/goldfish_tty.c                        |   2 +-
 hw/char/grlib_apbuart.c                       |   2 +-
 hw/char/ibex_uart.c                           |   2 +-
 hw/char/imx_serial.c                          |   2 +-
 hw/char/ipoctal232.c                          |   2 +-
 hw/char/mcf_uart.c                            |   2 +-
 hw/char/mchp_pfsoc_mmuart.c                   |   2 +-
 hw/char/nrf51_uart.c                          |   2 +-
 hw/char/parallel.c                            |   4 +-
 hw/char/pl011.c                               |   2 +-
 hw/char/renesas_sci.c                         |   2 +-
 hw/char/sclpconsole-lm.c                      |   2 +-
 hw/char/sclpconsole.c                         |   2 +-
 hw/char/serial-isa.c                          |   4 +-
 hw/char/serial-mm.c                           |   2 +-
 hw/char/serial-pci-multi.c                    |  10 +-
 hw/char/serial-pci.c                          |   4 +-
 hw/char/serial.c                              |   2 +-
 hw/char/sh_serial.c                           |   2 +-
 hw/char/shakti_uart.c                         |   2 +-
 hw/char/sifive_uart.c                         |   2 +-
 hw/char/spapr_vty.c                           |   2 +-
 hw/char/stm32f2xx_usart.c                     |   2 +-
 hw/char/stm32l4x5_usart.c                     |   9 +-
 hw/char/terminal3270.c                        |   2 +-
 hw/char/virtio-console.c                      |   4 +-
 hw/char/virtio-serial-bus.c                   |   8 +-
 hw/char/xen_console.c                         |   2 +-
 hw/char/xilinx_uartlite.c                     |   2 +-
 hw/core/bus.c                                 |   4 +-
 hw/core/clock.c                               |   2 +-
 hw/core/cpu-common.c                          |  76 +++++++++-
 hw/core/cpu-system.c                          |   2 +-
 hw/core/generic-loader.c                      |   2 +-
 hw/core/guest-loader.c                        |   2 +-
 hw/core/loader.c                              |   4 +-
 hw/core/machine-qmp-cmds.c                    |  10 +-
 hw/core/machine.c                             |   4 +-
 hw/core/or-irq.c                              |   2 +-
 hw/core/platform-bus.c                        |   2 +-
 hw/core/qdev.c                                |   6 +-
 hw/core/register.c                            |   2 +-
 hw/core/reset.c                               |   2 +-
 hw/core/resetcontainer.c                      |   3 +-
 hw/core/split-irq.c                           |   2 +-
 hw/core/sysbus.c                              |   7 +-
 hw/cpu/a15mpcore.c                            |   2 +-
 hw/cpu/a9mpcore.c                             |   2 +-
 hw/cpu/arm11mpcore.c                          |   2 +-
 hw/cpu/cluster.c                              |   2 +-
 hw/cpu/core.c                                 |   2 +-
 hw/cpu/realview_mpcore.c                      |   2 +-
 hw/cxl/switch-mailbox-cci.c                   |   4 +-
 hw/display/artist.c                           |   2 +-
 hw/display/ati.c                              |   4 +-
 hw/display/bcm2835_fb.c                       |   2 +-
 hw/display/bochs-display.c                    |   4 +-
 hw/display/cg3.c                              |   2 +-
 hw/display/cirrus_vga.c                       |   4 +-
 hw/display/cirrus_vga_isa.c                   |   2 +-
 hw/display/dm163.c                            |   2 +-
 hw/display/dpcd.c                             |   2 +-
 hw/display/exynos4210_fimd.c                  |   2 +-
 hw/display/g364fb.c                           |   2 +-
 hw/display/i2c-ddc.c                          |   2 +-
 hw/display/jazz_led.c                         |   2 +-
 hw/display/macfb.c                            |   4 +-
 hw/display/next-fb.c                          |   2 +-
 hw/display/pl110.c                            |   2 +-
 hw/display/qxl.c                              |   8 +-
 hw/display/ramfb-standalone.c                 |   2 +-
 hw/display/sii9022.c                          |   2 +-
 hw/display/sm501.c                            |   6 +-
 hw/display/ssd0303.c                          |   2 +-
 hw/display/ssd0323.c                          |   2 +-
 hw/display/tcx.c                              |   2 +-
 hw/display/vga-isa.c                          |   2 +-
 hw/display/vga-mmio.c                         |   2 +-
 hw/display/vga-pci.c                          |   8 +-
 hw/display/vga.c                              |   2 +-
 hw/display/vhost-user-gpu.c                   |   2 +-
 hw/display/virtio-gpu-base.c                  |   2 +-
 hw/display/virtio-gpu-gl.c                    |   2 +-
 hw/display/virtio-gpu-pci-rutabaga.c          |   2 +-
 hw/display/virtio-gpu-pci.c                   |   2 +-
 hw/display/virtio-gpu-rutabaga.c              |   2 +-
 hw/display/virtio-gpu.c                       |   2 +-
 hw/display/virtio-vga.c                       |   2 +-
 hw/display/vmware_vga.c                       |   4 +-
 hw/display/xlnx_dp.c                          |   2 +-
 hw/dma/bcm2835_dma.c                          |   2 +-
 hw/dma/i82374.c                               |   2 +-
 hw/dma/i8257.c                                |   4 +-
 hw/dma/pl080.c                                |   2 +-
 hw/dma/pl330.c                                |   2 +-
 hw/dma/rc4030.c                               |   4 +-
 hw/dma/sifive_pdma.c                          |   2 +-
 hw/dma/sparc32_dma.c                          |  10 +-
 hw/dma/xilinx_axidma.c                        |   9 +-
 hw/dma/xlnx-zdma.c                            |   2 +-
 hw/dma/xlnx-zynq-devcfg.c                     |   2 +-
 hw/dma/xlnx_csu_dma.c                         |   4 +-
 hw/dma/xlnx_dpdma.c                           |   2 +-
 hw/fsi/aspeed_apb2opb.c                       |   2 +-
 hw/fsi/cfam.c                                 |   2 +-
 hw/fsi/fsi-master.c                           |   2 +-
 hw/fsi/fsi.c                                  |   2 +-
 hw/fsi/lbus.c                                 |   2 +-
 hw/gpio/aspeed_gpio.c                         |  16 +-
 hw/gpio/bcm2835_gpio.c                        |   2 +-
 hw/gpio/bcm2838_gpio.c                        |   2 +-
 hw/gpio/gpio_key.c                            |   2 +-
 hw/gpio/imx_gpio.c                            |   2 +-
 hw/gpio/mpc8xxx.c                             |   2 +-
 hw/gpio/npcm7xx_gpio.c                        |   2 +-
 hw/gpio/nrf51_gpio.c                          |   2 +-
 hw/gpio/omap_gpio.c                           |   2 +-
 hw/gpio/pca9552.c                             |   4 +-
 hw/gpio/pca9554.c                             |   2 +-
 hw/gpio/pcf8574.c                             |   2 +-
 hw/gpio/pl061.c                               |   2 +-
 hw/gpio/sifive_gpio.c                         |   2 +-
 hw/gpio/stm32l4x5_gpio.c                      |   2 +-
 hw/gpio/zaurus.c                              |   2 +-
 hw/hppa/machine.c                             |   8 +-
 hw/hyperv/hv-balloon.c                        |   2 +-
 hw/hyperv/hyperv.c                            |   2 +-
 hw/hyperv/hyperv_testdev.c                    |   2 +-
 hw/hyperv/syndbg.c                            |   2 +-
 hw/hyperv/vmbus.c                             |   6 +-
 hw/i2c/allwinner-i2c.c                        |   2 +-
 hw/i2c/aspeed_i2c.c                           |  17 ++-
 hw/i2c/bcm2835_i2c.c                          |   2 +-
 hw/i2c/bitbang_i2c.c                          |   2 +-
 hw/i2c/core.c                                 |   2 +-
 hw/i2c/exynos4210_i2c.c                       |   2 +-
 hw/i2c/i2c_mux_pca954x.c                      |   6 +-
 hw/i2c/imx_i2c.c                              |   2 +-
 hw/i2c/microbit_i2c.c                         |   2 +-
 hw/i2c/mpc_i2c.c                              |   2 +-
 hw/i2c/npcm7xx_smbus.c                        |   2 +-
 hw/i2c/omap_i2c.c                             |   2 +-
 hw/i2c/pmbus_device.c                         |   2 +-
 hw/i2c/ppc4xx_i2c.c                           |   2 +-
 hw/i2c/smbus_eeprom.c                         |   2 +-
 hw/i2c/smbus_ich9.c                           |   4 +-
 hw/i2c/smbus_slave.c                          |   2 +-
 hw/i386/amd_iommu.c                           |   9 +-
 hw/i386/intel_iommu.c                         |   4 +-
 hw/i386/kvm/apic.c                            |   2 +-
 hw/i386/kvm/clock.c                           |   2 +-
 hw/i386/kvm/i8254.c                           |   2 +-
 hw/i386/kvm/i8259.c                           |   2 +-
 hw/i386/kvm/ioapic.c                          |   2 +-
 hw/i386/kvm/xen_evtchn.c                      |   2 +-
 hw/i386/kvm/xen_gnttab.c                      |   2 +-
 hw/i386/kvm/xen_overlay.c                     |   2 +-
 hw/i386/kvm/xen_primary_console.c             |   2 +-
 hw/i386/kvm/xen_xenstore.c                    |   2 +-
 hw/i386/microvm.c                             |   4 +-
 hw/i386/nitro_enclave.c                       |   2 +-
 hw/i386/pc.c                                  |   4 +-
 hw/i386/port92.c                              |   2 +-
 hw/i386/sgx-epc.c                             |   4 +-
 hw/i386/vapic.c                               |   2 +-
 hw/i386/vmmouse.c                             |   2 +-
 hw/i386/vmport.c                              |   2 +-
 hw/i386/x86-iommu.c                           |   2 +-
 hw/i386/x86.c                                 |   4 +-
 hw/i386/xen/xen-pvh.c                         |   2 +-
 hw/i386/xen/xen_apic.c                        |   2 +-
 hw/i386/xen/xen_platform.c                    |   4 +-
 hw/i386/xen/xen_pvdevice.c                    |   4 +-
 hw/ide/ahci-allwinner.c                       |   2 +-
 hw/ide/ahci-sysbus.c                          |   2 +-
 hw/ide/cf.c                                   |   2 +-
 hw/ide/cmd646.c                               |   2 +-
 hw/ide/ich.c                                  |   4 +-
 hw/ide/ide-bus.c                              |   2 +-
 hw/ide/ide-dev.c                              |   6 +-
 hw/ide/isa.c                                  |   2 +-
 hw/ide/macio.c                                |   2 +-
 hw/ide/mmio.c                                 |   2 +-
 hw/ide/pci.c                                  |   2 +-
 hw/ide/piix.c                                 |   4 +-
 hw/ide/sii3112.c                              |   2 +-
 hw/ide/via.c                                  |   2 +-
 hw/input/adb-kbd.c                            |   2 +-
 hw/input/adb-mouse.c                          |   2 +-
 hw/input/adb.c                                |   4 +-
 hw/input/lasips2.c                            |   8 +-
 hw/input/pckbd.c                              |   6 +-
 hw/input/pl050.c                              |   6 +-
 hw/input/ps2.c                                |   6 +-
 hw/input/stellaris_gamepad.c                  |   2 +-
 hw/input/virtio-input-hid.c                   |   6 +-
 hw/input/virtio-input-host.c                  |   2 +-
 hw/input/virtio-input.c                       |   2 +-
 hw/intc/allwinner-a10-pic.c                   |   2 +-
 hw/intc/apic.c                                |   2 +-
 hw/intc/apic_common.c                         |   2 +-
 hw/intc/arm_gic.c                             |   2 +-
 hw/intc/arm_gic_common.c                      |   4 +-
 hw/intc/arm_gic_kvm.c                         |   2 +-
 hw/intc/arm_gicv2m.c                          |   2 +-
 hw/intc/arm_gicv3.c                           |   2 +-
 hw/intc/arm_gicv3_common.c                    |   4 +-
 hw/intc/arm_gicv3_its.c                       |   2 +-
 hw/intc/arm_gicv3_its_common.c                |   2 +-
 hw/intc/arm_gicv3_its_kvm.c                   |   2 +-
 hw/intc/arm_gicv3_kvm.c                       |   2 +-
 hw/intc/armv7m_nvic.c                         |   2 +-
 hw/intc/aspeed_intc.c                         |   6 +-
 hw/intc/aspeed_vic.c                          |   2 +-
 hw/intc/bcm2835_ic.c                          |   2 +-
 hw/intc/bcm2836_control.c                     |   2 +-
 hw/intc/exynos4210_combiner.c                 |   2 +-
 hw/intc/exynos4210_gic.c                      |   2 +-
 hw/intc/goldfish_pic.c                        |   4 +-
 hw/intc/grlib_irqmp.c                         |   2 +-
 hw/intc/heathrow_pic.c                        |   2 +-
 hw/intc/i8259.c                               |   7 +-
 hw/intc/i8259_common.c                        |   4 +-
 hw/intc/imx_avic.c                            |   2 +-
 hw/intc/imx_gpcv2.c                           |   2 +-
 hw/intc/ioapic.c                              |   2 +-
 hw/intc/ioapic_common.c                       |   4 +-
 hw/intc/loongarch_extioi.c                    |   2 +-
 hw/intc/loongarch_extioi_common.c             |   5 +-
 hw/intc/loongarch_ipi.c                       |   4 +-
 hw/intc/loongarch_pch_msi.c                   |   2 +-
 hw/intc/loongarch_pch_pic.c                   |   2 +-
 hw/intc/loongarch_pic_common.c                |   3 +-
 hw/intc/loongson_ipi.c                        |   2 +-
 hw/intc/loongson_ipi_common.c                 |   2 +-
 hw/intc/m68k_irqc.c                           |   4 +-
 hw/intc/mips_gic.c                            |   2 +-
 hw/intc/omap_intc.c                           |   2 +-
 hw/intc/ompic.c                               |   2 +-
 hw/intc/openpic.c                             |   2 +-
 hw/intc/openpic_kvm.c                         |   2 +-
 hw/intc/pl190.c                               |   2 +-
 hw/intc/pnv_xive.c                            |   4 +-
 hw/intc/pnv_xive2.c                           |   4 +-
 hw/intc/ppc-uic.c                             |   2 +-
 hw/intc/realview_gic.c                        |   2 +-
 hw/intc/riscv_aclint.c                        |   4 +-
 hw/intc/riscv_aplic.c                         |   2 +-
 hw/intc/riscv_imsic.c                         |   2 +-
 hw/intc/rx_icu.c                              |   2 +-
 hw/intc/s390_flic.c                           |   4 +-
 hw/intc/s390_flic_kvm.c                       |   2 +-
 hw/intc/sifive_plic.c                         |   2 +-
 hw/intc/slavio_intctl.c                       |   4 +-
 hw/intc/spapr_xive.c                          |   4 +-
 hw/intc/xics.c                                |   4 +-
 hw/intc/xics_pnv.c                            |   2 +-
 hw/intc/xics_spapr.c                          |   4 +-
 hw/intc/xilinx_intc.c                         |   2 +-
 hw/intc/xive.c                                |  10 +-
 hw/intc/xive2.c                               |   6 +-
 hw/intc/xlnx-pmu-iomod-intc.c                 |   2 +-
 hw/intc/xlnx-zynqmp-ipi.c                     |   2 +-
 hw/ipack/ipack.c                              |   2 +-
 hw/ipack/tpci200.c                            |   4 +-
 hw/ipmi/ipmi.c                                |   4 +-
 hw/ipmi/ipmi_bmc_extern.c                     |   2 +-
 hw/ipmi/ipmi_bmc_sim.c                        |   2 +-
 hw/ipmi/isa_ipmi_bt.c                         |   4 +-
 hw/ipmi/isa_ipmi_kcs.c                        |   4 +-
 hw/ipmi/pci_ipmi_bt.c                         |   4 +-
 hw/ipmi/pci_ipmi_kcs.c                        |   4 +-
 hw/ipmi/smbus_ipmi.c                          |   4 +-
 hw/isa/fdc37m81x-superio.c                    |   2 +-
 hw/isa/i82378.c                               |   4 +-
 hw/isa/isa-bus.c                              |   6 +-
 hw/isa/isa-superio.c                          |   2 +-
 hw/isa/lpc_ich9.c                             |   4 +-
 hw/isa/pc87312.c                              |   2 +-
 hw/isa/piix.c                                 |   8 +-
 hw/isa/smc37c669-superio.c                    |   2 +-
 hw/isa/vt82c686.c                             |  20 +--
 hw/loongarch/virt.c                           |   4 +-
 hw/m68k/mcf5206.c                             |   2 +-
 hw/m68k/mcf_intc.c                            |   2 +-
 hw/m68k/next-cube.c                           |   8 +-
 hw/m68k/next-kbd.c                            |   2 +-
 hw/m68k/q800-glue.c                           |   4 +-
 hw/m68k/q800.c                                |   2 +-
 hw/m68k/virt.c                                |   4 +-
 hw/mem/cxl_type3.c                            |   4 +-
 hw/mem/npcm7xx_mc.c                           |   2 +-
 hw/mem/nvdimm.c                               |   2 +-
 hw/mem/pc-dimm.c                              |   4 +-
 hw/mem/sparse-mem.c                           |   2 +-
 hw/microblaze/boot.c                          |   2 +-
 hw/microblaze/petalogix_ml605_mmu.c           |  12 +-
 hw/microblaze/petalogix_s3adsp1800_mmu.c      |   3 +-
 hw/microblaze/xlnx-zynqmp-pmu.c               |  14 +-
 hw/mips/cps.c                                 |   2 +-
 hw/mips/jazz.c                                |  15 +-
 hw/mips/loongson3_virt.c                      |   2 +-
 hw/mips/malta.c                               |  21 +--
 hw/mips/mipssim.c                             |  11 +-
 hw/misc/a9scu.c                               |   2 +-
 hw/misc/allwinner-a10-ccm.c                   |   2 +-
 hw/misc/allwinner-a10-dramc.c                 |   2 +-
 hw/misc/allwinner-cpucfg.c                    |   2 +-
 hw/misc/allwinner-h3-ccu.c                    |   2 +-
 hw/misc/allwinner-h3-dramc.c                  |   2 +-
 hw/misc/allwinner-h3-sysctrl.c                |   3 +-
 hw/misc/allwinner-r40-ccu.c                   |   2 +-
 hw/misc/allwinner-r40-dramc.c                 |   2 +-
 hw/misc/allwinner-sid.c                       |   2 +-
 hw/misc/allwinner-sramc.c                     |   4 +-
 hw/misc/applesmc.c                            |   4 +-
 hw/misc/arm11scu.c                            |   2 +-
 hw/misc/arm_l2x0.c                            |   2 +-
 hw/misc/arm_sysctl.c                          |   2 +-
 hw/misc/armsse-cpu-pwrctrl.c                  |   2 +-
 hw/misc/armsse-cpuid.c                        |   2 +-
 hw/misc/armsse-mhu.c                          |   2 +-
 hw/misc/armv7m_ras.c                          |   2 +-
 hw/misc/aspeed_hace.c                         |  12 +-
 hw/misc/aspeed_i3c.c                          |   4 +-
 hw/misc/aspeed_lpc.c                          |   2 +-
 hw/misc/aspeed_peci.c                         |   2 +-
 hw/misc/aspeed_sbc.c                          |   4 +-
 hw/misc/aspeed_scu.c                          |  14 +-
 hw/misc/aspeed_sdmc.c                         |  10 +-
 hw/misc/aspeed_sli.c                          |   6 +-
 hw/misc/aspeed_xdma.c                         |   8 +-
 hw/misc/auxbus.c                              |   6 +-
 hw/misc/avr_power.c                           |   2 +-
 hw/misc/axp2xx.c                              |   6 +-
 hw/misc/bcm2835_cprman.c                      |  10 +-
 hw/misc/bcm2835_mbox.c                        |   2 +-
 hw/misc/bcm2835_mphi.c                        |   2 +-
 hw/misc/bcm2835_powermgt.c                    |   2 +-
 hw/misc/bcm2835_property.c                    |   2 +-
 hw/misc/bcm2835_rng.c                         |   2 +-
 hw/misc/bcm2835_thermal.c                     |   2 +-
 hw/misc/debugexit.c                           |   2 +-
 hw/misc/djmemc.c                              |   2 +-
 hw/misc/eccmemctl.c                           |   2 +-
 hw/misc/edu.c                                 |  23 ++-
 hw/misc/empty_slot.c                          |   2 +-
 hw/misc/exynos4210_clk.c                      |   2 +-
 hw/misc/exynos4210_pmu.c                      |   2 +-
 hw/misc/exynos4210_rng.c                      |   2 +-
 hw/misc/grlib_ahb_apb_pnp.c                   |   4 +-
 hw/misc/i2c-echo.c                            |   2 +-
 hw/misc/imx25_ccm.c                           |   2 +-
 hw/misc/imx31_ccm.c                           |   2 +-
 hw/misc/imx6_ccm.c                            |   2 +-
 hw/misc/imx6_src.c                            |   2 +-
 hw/misc/imx6ul_ccm.c                          |   2 +-
 hw/misc/imx7_ccm.c                            |   4 +-
 hw/misc/imx7_gpr.c                            |   2 +-
 hw/misc/imx7_snvs.c                           |   2 +-
 hw/misc/imx7_src.c                            |   2 +-
 hw/misc/imx8mp_analog.c                       |   2 +-
 hw/misc/imx8mp_ccm.c                          |   2 +-
 hw/misc/imx_rngc.c                            |   2 +-
 hw/misc/iosb.c                                |   2 +-
 hw/misc/iotkit-secctl.c                       |   2 +-
 hw/misc/iotkit-sysctl.c                       |   2 +-
 hw/misc/iotkit-sysinfo.c                      |   2 +-
 hw/misc/ivshmem-flat.c                        |   2 +-
 hw/misc/ivshmem-pci.c                         |   8 +-
 hw/misc/lasi.c                                |   2 +-
 hw/misc/led.c                                 |   2 +-
 hw/misc/mac_via.c                             |   4 +-
 hw/misc/macio/cuda.c                          |   4 +-
 hw/misc/macio/gpio.c                          |   4 +-
 hw/misc/macio/mac_dbdma.c                     |   2 +-
 hw/misc/macio/macio.c                         |   8 +-
 hw/misc/macio/pmu.c                           |   4 +-
 hw/misc/mchp_pfsoc_dmc.c                      |   5 +-
 hw/misc/mchp_pfsoc_ioscb.c                    |   2 +-
 hw/misc/mchp_pfsoc_sysreg.c                   |   2 +-
 hw/misc/mips_cmgcr.c                          |   2 +-
 hw/misc/mips_cpc.c                            |   2 +-
 hw/misc/mips_itu.c                            |   2 +-
 hw/misc/mos6522.c                             |   2 +-
 hw/misc/mps2-fpgaio.c                         |   2 +-
 hw/misc/mps2-scc.c                            |   2 +-
 hw/misc/msf2-sysreg.c                         |   2 +-
 hw/misc/npcm7xx_mft.c                         |   2 +-
 hw/misc/npcm7xx_pwm.c                         |   2 +-
 hw/misc/npcm7xx_rng.c                         |   2 +-
 hw/misc/npcm_clk.c                            |  12 +-
 hw/misc/npcm_gcr.c                            |   6 +-
 hw/misc/nrf51_rng.c                           |   2 +-
 hw/misc/pc-testdev.c                          |   2 +-
 hw/misc/pci-testdev.c                         |   4 +-
 hw/misc/pvpanic-isa.c                         |   4 +-
 hw/misc/pvpanic-mmio.c                        |   2 +-
 hw/misc/pvpanic-pci.c                         |   4 +-
 hw/misc/sbsa_ec.c                             |   2 +-
 hw/misc/sifive_e_aon.c                        |   2 +-
 hw/misc/sifive_u_otp.c                        |   2 +-
 hw/misc/sifive_u_prci.c                       |   2 +-
 hw/misc/slavio_misc.c                         |   2 +-
 hw/misc/stm32_rcc.c                           |   2 +-
 hw/misc/stm32f2xx_syscfg.c                    |   2 +-
 hw/misc/stm32f4xx_exti.c                      |   2 +-
 hw/misc/stm32f4xx_syscfg.c                    |   2 +-
 hw/misc/stm32l4x5_exti.c                      |   2 +-
 hw/misc/stm32l4x5_rcc.c                       |   6 +-
 hw/misc/stm32l4x5_syscfg.c                    |   2 +-
 hw/misc/tz-mpc.c                              |   4 +-
 hw/misc/tz-msc.c                              |   2 +-
 hw/misc/tz-ppc.c                              |   2 +-
 hw/misc/unimp.c                               |   2 +-
 hw/misc/virt_ctrl.c                           |   2 +-
 hw/misc/vmcoreinfo.c                          |   2 +-
 hw/misc/xlnx-versal-cframe-reg.c              |   6 +-
 hw/misc/xlnx-versal-cfu.c                     |  10 +-
 hw/misc/xlnx-versal-crl.c                     |   2 +-
 hw/misc/xlnx-versal-pmc-iou-slcr.c            |   3 +-
 hw/misc/xlnx-versal-trng.c                    |   2 +-
 hw/misc/xlnx-versal-xramc.c                   |   2 +-
 hw/misc/xlnx-zynqmp-apu-ctrl.c                |   2 +-
 hw/misc/xlnx-zynqmp-crf.c                     |   2 +-
 hw/misc/zynq_slcr.c                           |   2 +-
 hw/net/allwinner-sun8i-emac.c                 |   3 +-
 hw/net/allwinner_emac.c                       |   2 +-
 hw/net/cadence_gem.c                          |   2 +-
 hw/net/can/can_kvaser_pci.c                   |   4 +-
 hw/net/can/can_mioe3680_pci.c                 |   4 +-
 hw/net/can/can_pcm3680_pci.c                  |   4 +-
 hw/net/can/ctucan_pci.c                       |   4 +-
 hw/net/can/xlnx-versal-canfd.c                |   6 +-
 hw/net/can/xlnx-zynqmp-can.c                  |   2 +-
 hw/net/dp8393x.c                              |   2 +-
 hw/net/e1000.c                                |   6 +-
 hw/net/e1000e.c                               |   4 +-
 hw/net/eepro100.c                             |   4 +-
 hw/net/fsl_etsec/etsec.c                      |   2 +-
 hw/net/ftgmac100.c                            |   4 +-
 hw/net/igb.c                                  |   4 +-
 hw/net/igbvf.c                                |   4 +-
 hw/net/imx_fec.c                              |   2 +-
 hw/net/lan9118.c                              |   2 +-
 hw/net/lan9118_phy.c                          |   2 +-
 hw/net/lance.c                                |   2 +-
 hw/net/lasi_i82596.c                          |   2 +-
 hw/net/mcf_fec.c                              |   2 +-
 hw/net/mipsnet.c                              |   2 +-
 hw/net/msf2-emac.c                            |   2 +-
 hw/net/mv88w8618_eth.c                        |   2 +-
 hw/net/ne2000-isa.c                           |   2 +-
 hw/net/ne2000-pci.c                           |   4 +-
 hw/net/npcm7xx_emc.c                          |   2 +-
 hw/net/npcm_gmac.c                            |   2 +-
 hw/net/npcm_pcs.c                             |   2 +-
 hw/net/opencores_eth.c                        |   2 +-
 hw/net/pcnet-pci.c                            |   4 +-
 hw/net/rocker/rocker.c                        |   4 +-
 hw/net/rtl8139.c                              |   4 +-
 hw/net/smc91c111.c                            |   2 +-
 hw/net/spapr_llan.c                           |   2 +-
 hw/net/stellaris_enet.c                       |   2 +-
 hw/net/sungem.c                               |   4 +-
 hw/net/sunhme.c                               |   4 +-
 hw/net/tulip.c                                |   4 +-
 hw/net/virtio-net.c                           |   2 +-
 hw/net/vmxnet3.c                              |   4 +-
 hw/net/xen_nic.c                              |   2 +-
 hw/net/xgmac.c                                |   2 +-
 hw/net/xilinx_axienet.c                       |  11 +-
 hw/net/xilinx_ethlite.c                       |   2 +-
 hw/nubus/mac-nubus-bridge.c                   |   2 +-
 hw/nubus/nubus-bridge.c                       |   2 +-
 hw/nubus/nubus-bus.c                          |   2 +-
 hw/nubus/nubus-device.c                       |   2 +-
 hw/nubus/nubus-virtio-mmio.c                  |   2 +-
 hw/nvme/ctrl.c                                |   4 +-
 hw/nvme/ns.c                                  |   2 +-
 hw/nvme/subsys.c                              |   2 +-
 hw/nvram/bcm2835_otp.c                        |   2 +-
 hw/nvram/ds1225y.c                            |   2 +-
 hw/nvram/eeprom_at24c.c                       |   2 +-
 hw/nvram/fw_cfg.c                             |   6 +-
 hw/nvram/mac_nvram.c                          |   2 +-
 hw/nvram/npcm7xx_otp.c                        |   6 +-
 hw/nvram/nrf51_nvm.c                          |   2 +-
 hw/nvram/spapr_nvram.c                        |   2 +-
 hw/nvram/xlnx-bbram.c                         |   2 +-
 hw/nvram/xlnx-efuse.c                         |   2 +-
 hw/nvram/xlnx-versal-efuse-cache.c            |   2 +-
 hw/nvram/xlnx-versal-efuse-ctrl.c             |   2 +-
 hw/nvram/xlnx-zynqmp-efuse.c                  |   2 +-
 hw/openrisc/openrisc_sim.c                    |   2 +-
 hw/openrisc/virt.c                            |   2 +-
 hw/pci-bridge/cxl_downstream.c                |   4 +-
 hw/pci-bridge/cxl_root_port.c                 |   4 +-
 hw/pci-bridge/cxl_upstream.c                  |   4 +-
 hw/pci-bridge/gen_pcie_root_port.c            |   2 +-
 hw/pci-bridge/i82801b11.c                     |   4 +-
 hw/pci-bridge/ioh3420.c                       |   2 +-
 hw/pci-bridge/pci_bridge_dev.c                |   6 +-
 hw/pci-bridge/pci_expander_bridge.c           |  18 +--
 hw/pci-bridge/pcie_pci_bridge.c               |   4 +-
 hw/pci-bridge/pcie_root_port.c                |   4 +-
 hw/pci-bridge/simba.c                         |   4 +-
 hw/pci-bridge/xio3130_downstream.c            |   4 +-
 hw/pci-bridge/xio3130_upstream.c              |   4 +-
 hw/pci-host/articia.c                         |  10 +-
 hw/pci-host/astro.c                           |   6 +-
 hw/pci-host/bonito.c                          |   6 +-
 hw/pci-host/designware.c                      |  59 +++-----
 hw/pci-host/dino.c                            |   2 +-
 hw/pci-host/fsl_imx8m_phy.c                   |   2 +-
 hw/pci-host/gpex.c                            |   6 +-
 hw/pci-host/grackle.c                         |   6 +-
 hw/pci-host/gt64120.c                         |   6 +-
 hw/pci-host/i440fx.c                          |   6 +-
 hw/pci-host/mv64361.c                         |   8 +-
 hw/pci-host/pnv_phb.c                         |   4 +-
 hw/pci-host/pnv_phb3.c                        |   6 +-
 hw/pci-host/pnv_phb3_msi.c                    |   2 +-
 hw/pci-host/pnv_phb3_pbcq.c                   |   4 +-
 hw/pci-host/pnv_phb4.c                        |   8 +-
 hw/pci-host/pnv_phb4_pec.c                    |   8 +-
 hw/pci-host/ppc440_pcix.c                     |   2 +-
 hw/pci-host/ppc4xx_pci.c                      |   6 +-
 hw/pci-host/ppce500.c                         |   6 +-
 hw/pci-host/q35.c                             |   6 +-
 hw/pci-host/raven.c                           |   6 +-
 hw/pci-host/remote.c                          |   2 +-
 hw/pci-host/sabre.c                           |   6 +-
 hw/pci-host/sh_pci.c                          |   6 +-
 hw/pci-host/uninorth.c                        |  27 ++--
 hw/pci-host/versatile.c                       |   6 +-
 hw/pci-host/xen_igd_pt.c                      |   3 +-
 hw/pci-host/xilinx-pcie.c                     |   6 +-
 hw/pci/pci.c                                  |  10 +-
 hw/pci/pci_bridge.c                           |   4 +-
 hw/pci/pci_host.c                             |   2 +-
 hw/pci/pcie_port.c                            |   6 +-
 hw/ppc/amigaone.c                             |   2 +-
 hw/ppc/e500plat.c                             |   4 +-
 hw/ppc/mac_newworld.c                         |   4 +-
 hw/ppc/mac_oldworld.c                         |   4 +-
 hw/ppc/mpc8544ds.c                            |   2 +-
 hw/ppc/pef.c                                  |   2 +-
 hw/ppc/pegasos2.c                             |   4 +-
 hw/ppc/pnv.c                                  |  33 ++--
 hw/ppc/pnv_adu.c                              |   4 +-
 hw/ppc/pnv_chiptod.c                          |  10 +-
 hw/ppc/pnv_core.c                             |  14 +-
 hw/ppc/pnv_homer.c                            |   8 +-
 hw/ppc/pnv_i2c.c                              |   4 +-
 hw/ppc/pnv_lpc.c                              |  10 +-
 hw/ppc/pnv_n1_chiplet.c                       |   4 +-
 hw/ppc/pnv_nest_pervasive.c                   |   4 +-
 hw/ppc/pnv_occ.c                              |   8 +-
 hw/ppc/pnv_pnor.c                             |   2 +-
 hw/ppc/pnv_psi.c                              |  12 +-
 hw/ppc/pnv_sbe.c                              |   6 +-
 hw/ppc/ppc440_bamboo.c                        |   2 +-
 hw/ppc/ppc440_uc.c                            |   2 +-
 hw/ppc/ppc4xx_devs.c                          |   8 +-
 hw/ppc/ppc4xx_sdram.c                         |   4 +-
 hw/ppc/ppce500_spin.c                         |   2 +-
 hw/ppc/prep_systemio.c                        |   2 +-
 hw/ppc/rs6000_mc.c                            |   2 +-
 hw/ppc/sam460ex.c                             |   2 +-
 hw/ppc/spapr.c                                |   6 +-
 hw/ppc/spapr_cpu_core.c                       |   4 +-
 hw/ppc/spapr_drc.c                            |  16 +-
 hw/ppc/spapr_iommu.c                          |   5 +-
 hw/ppc/spapr_nvdimm.c                         |   2 +-
 hw/ppc/spapr_pci.c                            |   4 +-
 hw/ppc/spapr_rng.c                            |   2 +-
 hw/ppc/spapr_rtc.c                            |   2 +-
 hw/ppc/spapr_tpm_proxy.c                      |   2 +-
 hw/ppc/spapr_vio.c                            |   6 +-
 hw/ppc/virtex_ml507.c                         |   2 +-
 hw/remote/machine.c                           |   4 +-
 hw/remote/proxy.c                             |   4 +-
 hw/remote/remote-obj.c                        |   4 +-
 hw/remote/vfio-user-obj.c                     |   4 +-
 hw/riscv/microchip_pfsoc.c                    |   5 +-
 hw/riscv/opentitan.c                          |   4 +-
 hw/riscv/riscv-iommu-pci.c                    |   4 +-
 hw/riscv/riscv-iommu-sys.c                    |   2 +-
 hw/riscv/riscv-iommu.c                        |   4 +-
 hw/riscv/riscv_hart.c                         |   2 +-
 hw/riscv/shakti_c.c                           |   4 +-
 hw/riscv/sifive_e.c                           |   4 +-
 hw/riscv/sifive_u.c                           |   4 +-
 hw/riscv/spike.c                              |   2 +-
 hw/riscv/virt.c                               |   4 +-
 hw/rtc/allwinner-rtc.c                        |   8 +-
 hw/rtc/aspeed_rtc.c                           |   2 +-
 hw/rtc/ds1338.c                               |   2 +-
 hw/rtc/exynos4210_rtc.c                       |   2 +-
 hw/rtc/goldfish_rtc.c                         |   2 +-
 hw/rtc/ls7a_rtc.c                             |   2 +-
 hw/rtc/m41t80.c                               |   2 +-
 hw/rtc/m48t59-isa.c                           |   6 +-
 hw/rtc/m48t59.c                               |   7 +-
 hw/rtc/mc146818rtc.c                          |   4 +-
 hw/rtc/pl031.c                                |   2 +-
 hw/rtc/rs5c372.c                              |   2 +-
 hw/rtc/sun4v-rtc.c                            |   2 +-
 hw/rtc/xlnx-zynqmp-rtc.c                      |   2 +-
 hw/rx/rx-gdbsim.c                             |   6 +-
 hw/rx/rx62n.c                                 |   6 +-
 hw/s390x/3270-ccw.c                           |   2 +-
 hw/s390x/ap-bridge.c                          |   6 +-
 hw/s390x/ap-device.c                          |   2 +-
 hw/s390x/ccw-device.c                         |   2 +-
 hw/s390x/css-bridge.c                         |   6 +-
 hw/s390x/event-facility.c                     |   4 +-
 hw/s390x/ipl.c                                |   2 +-
 hw/s390x/s390-ccw.c                           |   2 +-
 hw/s390x/s390-pci-bus.c                       |   9 +-
 hw/s390x/s390-skeys-kvm.c                     |   2 +-
 hw/s390x/s390-skeys.c                         |   4 +-
 hw/s390x/s390-stattrib-kvm.c                  |   2 +-
 hw/s390x/s390-stattrib.c                      |   4 +-
 hw/s390x/s390-virtio-ccw.c                    |   8 +-
 hw/s390x/sclp.c                               |   2 +-
 hw/s390x/sclpcpu.c                            |   2 +-
 hw/s390x/sclpquiesce.c                        |   2 +-
 hw/s390x/tod-kvm.c                            |   2 +-
 hw/s390x/tod-tcg.c                            |   2 +-
 hw/s390x/tod.c                                |   2 +-
 hw/s390x/vhost-scsi-ccw.c                     |   2 +-
 hw/s390x/vhost-user-fs-ccw.c                  |   2 +-
 hw/s390x/vhost-vsock-ccw.c                    |   2 +-
 hw/s390x/virtio-ccw-9p.c                      |   2 +-
 hw/s390x/virtio-ccw-balloon.c                 |   2 +-
 hw/s390x/virtio-ccw-blk.c                     |   2 +-
 hw/s390x/virtio-ccw-crypto.c                  |   2 +-
 hw/s390x/virtio-ccw-gpu.c                     |   2 +-
 hw/s390x/virtio-ccw-input.c                   |   2 +-
 hw/s390x/virtio-ccw-md.c                      |   2 +-
 hw/s390x/virtio-ccw-mem.c                     |   2 +-
 hw/s390x/virtio-ccw-net.c                     |   2 +-
 hw/s390x/virtio-ccw-rng.c                     |   2 +-
 hw/s390x/virtio-ccw-scsi.c                    |   2 +-
 hw/s390x/virtio-ccw-serial.c                  |   2 +-
 hw/s390x/virtio-ccw.c                         |   4 +-
 hw/scsi/esp-pci.c                             |   6 +-
 hw/scsi/esp.c                                 |   4 +-
 hw/scsi/lsi53c895a.c                          |   6 +-
 hw/scsi/megasas.c                             |  10 +-
 hw/scsi/mptsas.c                              |   4 +-
 hw/scsi/scsi-bus.c                            |   6 +-
 hw/scsi/scsi-disk.c                           |   8 +-
 hw/scsi/scsi-generic.c                        |   2 +-
 hw/scsi/spapr_vscsi.c                         |   2 +-
 hw/scsi/vhost-scsi.c                          |   4 +-
 hw/scsi/vhost-user-scsi.c                     |   4 +-
 hw/scsi/virtio-scsi.c                         |   6 +-
 hw/scsi/vmw_pvscsi.c                          |   4 +-
 hw/sd/allwinner-sdhost.c                      |  15 +-
 hw/sd/aspeed_sdhci.c                          |  10 +-
 hw/sd/bcm2835_sdhost.c                        |   2 +-
 hw/sd/cadence_sdhci.c                         |   2 +-
 hw/sd/npcm7xx_sdhci.c                         |   2 +-
 hw/sd/omap_mmc.c                              |   2 +-
 hw/sd/pl181.c                                 |   4 +-
 hw/sd/sd.c                                    |   8 +-
 hw/sd/sdhci-pci.c                             |   4 +-
 hw/sd/sdhci.c                                 |   4 +-
 hw/sd/ssi-sd.c                                |   2 +-
 hw/sensor/adm1266.c                           |   2 +-
 hw/sensor/adm1272.c                           |   2 +-
 hw/sensor/dps310.c                            |   2 +-
 hw/sensor/emc141x.c                           |   4 +-
 hw/sensor/isl_pmbus_vr.c                      |   8 +-
 hw/sensor/lsm303dlhc_mag.c                    |   2 +-
 hw/sensor/max31785.c                          |   2 +-
 hw/sensor/max34451.c                          |   2 +-
 hw/sensor/tmp105.c                            |   2 +-
 hw/sensor/tmp421.c                            |   4 +-
 hw/sparc/sun4m.c                              |  28 ++--
 hw/sparc/sun4m_iommu.c                        |   5 +-
 hw/sparc64/niagara.c                          |   2 +-
 hw/sparc64/sun4u.c                            |  16 +-
 hw/sparc64/sun4u_iommu.c                      |   5 +-
 hw/ssi/allwinner-a10-spi.c                    |   2 +-
 hw/ssi/aspeed_smc.c                           |  36 ++---
 hw/ssi/bcm2835_spi.c                          |   2 +-
 hw/ssi/ibex_spi_host.c                        |   2 +-
 hw/ssi/imx_spi.c                              |   2 +-
 hw/ssi/mss-spi.c                              |   2 +-
 hw/ssi/npcm7xx_fiu.c                          |   2 +-
 hw/ssi/npcm_pspi.c                            |   2 +-
 hw/ssi/pl022.c                                |   2 +-
 hw/ssi/pnv_spi.c                              |   4 +-
 hw/ssi/sifive_spi.c                           |   2 +-
 hw/ssi/ssi.c                                  |   4 +-
 hw/ssi/stm32f2xx_spi.c                        |   2 +-
 hw/ssi/xilinx_spi.c                           |   2 +-
 hw/ssi/xilinx_spips.c                         |   6 +-
 hw/ssi/xlnx-versal-ospi.c                     |   2 +-
 hw/timer/a9gtimer.c                           |   2 +-
 hw/timer/allwinner-a10-pit.c                  |   2 +-
 hw/timer/arm_mptimer.c                        |   2 +-
 hw/timer/arm_timer.c                          |   2 +-
 hw/timer/armv7m_systick.c                     |   2 +-
 hw/timer/aspeed_timer.c                       |  12 +-
 hw/timer/avr_timer16.c                        |   2 +-
 hw/timer/bcm2835_systmr.c                     |   2 +-
 hw/timer/cadence_ttc.c                        |   2 +-
 hw/timer/cmsdk-apb-dualtimer.c                |   2 +-
 hw/timer/cmsdk-apb-timer.c                    |   2 +-
 hw/timer/digic-timer.c                        |   2 +-
 hw/timer/exynos4210_mct.c                     |   2 +-
 hw/timer/exynos4210_pwm.c                     |   2 +-
 hw/timer/grlib_gptimer.c                      |   2 +-
 hw/timer/hpet.c                               |   2 +-
 hw/timer/i8254.c                              |   2 +-
 hw/timer/i8254_common.c                       |   2 +-
 hw/timer/ibex_timer.c                         |   2 +-
 hw/timer/imx_epit.c                           |   2 +-
 hw/timer/imx_gpt.c                            |   2 +-
 hw/timer/mss-timer.c                          |   2 +-
 hw/timer/npcm7xx_timer.c                      |   2 +-
 hw/timer/nrf51_timer.c                        |   2 +-
 hw/timer/pxa2xx_timer.c                       |   4 +-
 hw/timer/renesas_cmt.c                        |   2 +-
 hw/timer/renesas_tmr.c                        |   2 +-
 hw/timer/sifive_pwm.c                         |   2 +-
 hw/timer/slavio_timer.c                       |   2 +-
 hw/timer/sse-counter.c                        |   2 +-
 hw/timer/sse-timer.c                          |   2 +-
 hw/timer/stellaris-gptm.c                     |   2 +-
 hw/timer/stm32f2xx_timer.c                    |   2 +-
 hw/timer/xilinx_timer.c                       |   2 +-
 hw/tpm/tpm_crb.c                              |   4 +-
 hw/tpm/tpm_spapr.c                            |   4 +-
 hw/tpm/tpm_tis_i2c.c                          |   4 +-
 hw/tpm/tpm_tis_isa.c                          |   4 +-
 hw/tpm/tpm_tis_sysbus.c                       |   4 +-
 hw/tricore/tc27x_soc.c                        |   4 +-
 hw/tricore/triboard.c                         |   2 +-
 hw/tricore/tricore_testdevice.c               |   2 +-
 hw/uefi/var-service-sysbus.c                  |   4 +-
 hw/ufs/lu.c                                   |   2 +-
 hw/ufs/ufs.c                                  |   6 +-
 hw/usb/bus.c                                  |   6 +-
 hw/usb/canokey.c                              |   2 +-
 hw/usb/ccid-card-emulated.c                   |   2 +-
 hw/usb/ccid-card-passthru.c                   |   2 +-
 hw/usb/chipidea.c                             |   2 +-
 hw/usb/dev-audio.c                            |   2 +-
 hw/usb/dev-hid.c                              |   8 +-
 hw/usb/dev-hub.c                              |   2 +-
 hw/usb/dev-mtp.c                              |   2 +-
 hw/usb/dev-network.c                          |   2 +-
 hw/usb/dev-serial.c                           |   6 +-
 hw/usb/dev-smartcard-reader.c                 |   6 +-
 hw/usb/dev-storage-bot.c                      |   2 +-
 hw/usb/dev-storage-classic.c                  |   2 +-
 hw/usb/dev-storage.c                          |   2 +-
 hw/usb/dev-uas.c                              |   2 +-
 hw/usb/dev-wacom.c                            |   2 +-
 hw/usb/hcd-dwc2.c                             |   2 +-
 hw/usb/hcd-dwc3.c                             |   2 +-
 hw/usb/hcd-ehci-pci.c                         |   6 +-
 hw/usb/hcd-ehci-sysbus.c                      |  16 +-
 hw/usb/hcd-ohci-pci.c                         |   4 +-
 hw/usb/hcd-ohci-sysbus.c                      |   2 +-
 hw/usb/hcd-uhci.c                             |   6 +-
 hw/usb/hcd-xhci-nec.c                         |   2 +-
 hw/usb/hcd-xhci-pci.c                         |   6 +-
 hw/usb/hcd-xhci-sysbus.c                      |   2 +-
 hw/usb/hcd-xhci.c                             |  15 +-
 hw/usb/host-libusb.c                          |   2 +-
 hw/usb/imx-usb-phy.c                          |   2 +-
 hw/usb/redirect.c                             |   2 +-
 hw/usb/u2f-emulated.c                         |   2 +-
 hw/usb/u2f-passthru.c                         |   2 +-
 hw/usb/u2f.c                                  |   2 +-
 hw/usb/xlnx-usb-subsystem.c                   |   2 +-
 hw/usb/xlnx-versal-usb2-ctrl-regs.c           |   2 +-
 hw/vfio/amd-xgbe.c                            |   2 +-
 hw/vfio/ap.c                                  |   2 +-
 hw/vfio/calxeda-xgmac.c                       |   2 +-
 hw/vfio/ccw.c                                 |   2 +-
 hw/vfio/container.c                           |   4 +-
 hw/vfio/igd.c                                 |   5 +-
 hw/vfio/iommufd.c                             |   4 +-
 hw/vfio/pci.c                                 |   7 +-
 hw/vfio/platform.c                            |   2 +-
 hw/vfio/spapr.c                               |   2 +-
 hw/virtio/vdpa-dev-pci.c                      |   3 +-
 hw/virtio/vdpa-dev.c                          |   2 +-
 hw/virtio/vhost-scsi-pci.c                    |   2 +-
 hw/virtio/vhost-user-base.c                   |   2 +-
 hw/virtio/vhost-user-blk-pci.c                |   2 +-
 hw/virtio/vhost-user-device-pci.c             |   3 +-
 hw/virtio/vhost-user-device.c                 |   2 +-
 hw/virtio/vhost-user-fs-pci.c                 |   2 +-
 hw/virtio/vhost-user-fs.c                     |   2 +-
 hw/virtio/vhost-user-gpio-pci.c               |   2 +-
 hw/virtio/vhost-user-gpio.c                   |   2 +-
 hw/virtio/vhost-user-i2c-pci.c                |   2 +-
 hw/virtio/vhost-user-i2c.c                    |   2 +-
 hw/virtio/vhost-user-input.c                  |   2 +-
 hw/virtio/vhost-user-rng-pci.c                |   2 +-
 hw/virtio/vhost-user-rng.c                    |   2 +-
 hw/virtio/vhost-user-scmi-pci.c               |   2 +-
 hw/virtio/vhost-user-scmi.c                   |   2 +-
 hw/virtio/vhost-user-scsi-pci.c               |   2 +-
 hw/virtio/vhost-user-snd-pci.c                |   2 +-
 hw/virtio/vhost-user-snd.c                    |   2 +-
 hw/virtio/vhost-user-vsock-pci.c              |   3 +-
 hw/virtio/vhost-user-vsock.c                  |   2 +-
 hw/virtio/vhost-vsock-common.c                |   2 +-
 hw/virtio/vhost-vsock-pci.c                   |   2 +-
 hw/virtio/vhost-vsock.c                       |   2 +-
 hw/virtio/virtio-9p-pci.c                     |   2 +-
 hw/virtio/virtio-balloon-pci.c                |   2 +-
 hw/virtio/virtio-balloon.c                    |   2 +-
 hw/virtio/virtio-blk-pci.c                    |   2 +-
 hw/virtio/virtio-bus.c                        |   2 +-
 hw/virtio/virtio-crypto-pci.c                 |   2 +-
 hw/virtio/virtio-crypto.c                     |   2 +-
 hw/virtio/virtio-input-pci.c                  |   7 +-
 hw/virtio/virtio-iommu-pci.c                  |   2 +-
 hw/virtio/virtio-iommu.c                      |   4 +-
 hw/virtio/virtio-md-pci.c                     |   2 +-
 hw/virtio/virtio-mem-pci.c                    |   2 +-
 hw/virtio/virtio-mem.c                        |   7 +-
 hw/virtio/virtio-mmio.c                       |   4 +-
 hw/virtio/virtio-net-pci.c                    |   2 +-
 hw/virtio/virtio-nsm-pci.c                    |   2 +-
 hw/virtio/virtio-nsm.c                        |   2 +-
 hw/virtio/virtio-pci.c                        |  18 +--
 hw/virtio/virtio-pmem-pci.c                   |   2 +-
 hw/virtio/virtio-pmem.c                       |   2 +-
 hw/virtio/virtio-rng-pci.c                    |   2 +-
 hw/virtio/virtio-rng.c                        |   2 +-
 hw/virtio/virtio-scsi-pci.c                   |   2 +-
 hw/virtio/virtio-serial-pci.c                 |   2 +-
 hw/virtio/virtio.c                            |   4 +-
 hw/vmapple/aes.c                              |   2 +-
 hw/vmapple/bdif.c                             |   2 +-
 hw/vmapple/cfg.c                              |   2 +-
 hw/vmapple/virtio-blk.c                       |   5 +-
 hw/vmapple/vmapple.c                          |   2 +-
 hw/watchdog/allwinner-wdt.c                   |   6 +-
 hw/watchdog/cmsdk-apb-watchdog.c              |   2 +-
 hw/watchdog/sbsa_gwdt.c                       |   2 +-
 hw/watchdog/spapr_watchdog.c                  |   2 +-
 hw/watchdog/wdt_aspeed.c                      |  12 +-
 hw/watchdog/wdt_diag288.c                     |   2 +-
 hw/watchdog/wdt_i6300esb.c                    |   4 +-
 hw/watchdog/wdt_ib700.c                       |   2 +-
 hw/watchdog/wdt_imx2.c                        |   2 +-
 hw/xen/xen-bus.c                              |   6 +-
 hw/xen/xen-legacy-backend.c                   |   6 +-
 hw/xen/xen-pvh-common.c                       |   2 +-
 hw/xen/xen_pt.c                               |   4 +-
 hw/xen/xen_pt_graphics.c                      |   4 +-
 hw/xtensa/xtfpga.c                            |  16 +-
 io/channel-buffer.c                           |   2 +-
 io/channel-command.c                          |   2 +-
 io/channel-file.c                             |   2 +-
 io/channel-null.c                             |   2 +-
 io/channel-socket.c                           |   2 +-
 io/channel-tls.c                              |   2 +-
 io/channel-websock.c                          |   2 +-
 iothread.c                                    |   2 +-
 linux-user/elfload.c                          |  63 +++++---
 migration/channel-block.c                     |   2 +-
 migration/migration.c                         |   2 +-
 migration/rdma.c                              |   2 +-
 net/can/can_core.c                            |   4 +-
 net/can/can_host.c                            |   4 +-
 net/can/can_socketcan.c                       |   2 +-
 net/colo-compare.c                            |   4 +-
 net/dump.c                                    |   2 +-
 net/filter-buffer.c                           |   2 +-
 net/filter-mirror.c                           |   4 +-
 net/filter-replay.c                           |   2 +-
 net/filter-rewriter.c                         |   2 +-
 net/filter.c                                  |   4 +-
 plugins/loader.c                              |   2 +-
 qom/object.c                                  |  15 +-
 scsi/pr-manager-helper.c                      |   2 +-
 scsi/pr-manager.c                             |   2 +-
 system/datadir.c                              |   5 +-
 system/memory.c                               |   6 +-
 system/qtest.c                                |   6 +-
 system/vl.c                                   |   6 +-
 target-info-stub.c                            |  26 ++++
 target-info.c                                 |  16 ++
 target/alpha/cpu.c                            |   2 +-
 target/arm/cpu.c                              |  25 ++-
 target/arm/cpu64.c                            |  18 +--
 target/arm/gdbstub.c                          |  12 ++
 target/arm/hyp_gdbstub.c                      |   8 +-
 target/arm/tcg/cpu-v7m.c                      |   3 +-
 target/avr/cpu.c                              |   2 +-
 target/hexagon/cpu.c                          |   2 +-
 target/hexagon/genptr.c                       |   8 +-
 target/hexagon/idef-parser/parser-helpers.c   |   2 +-
 target/hexagon/translate.c                    |   6 +-
 target/hppa/cpu.c                             |   2 +-
 target/i386/confidential-guest.c              |   2 +-
 target/i386/cpu.c                             |  11 +-
 target/i386/host-cpu.c                        |   2 +-
 target/i386/hvf/hvf-cpu.c                     |   2 +-
 target/i386/kvm/kvm-cpu.c                     |   2 +-
 target/i386/nvmm/nvmm-accel-ops.c             |   2 +-
 target/i386/nvmm/nvmm-all.c                   |   2 +-
 target/i386/sev.c                             |   8 +-
 target/i386/tcg/tcg-cpu.c                     |   2 +-
 target/i386/whpx/whpx-accel-ops.c             |   2 +-
 target/i386/whpx/whpx-all.c                   |   2 +-
 target/i386/whpx/whpx-apic.c                  |   2 +-
 target/loongarch/cpu.c                        |   6 +-
 target/m68k/cpu.c                             |   6 +-
 target/microblaze/cpu.c                       |   2 +-
 target/mips/cpu.c                             |   6 +-
 target/mips/tcg/msa_helper.c                  |  34 ++---
 target/openrisc/cpu.c                         |   2 +-
 target/ppc/cpu-models.c                       |   2 +-
 target/ppc/cpu_init.c                         |  97 ++++++------
 target/ppc/kvm.c                              |   4 +-
 target/riscv/cpu.c                            |   4 +-
 target/riscv/kvm/kvm-cpu.c                    |   4 +-
 target/riscv/tcg/tcg-cpu.c                    |   2 +-
 target/rx/cpu.c                               |   2 +-
 target/s390x/cpu.c                            |   3 +-
 target/s390x/cpu_models.c                     |  14 +-
 target/s390x/kvm/pv.c                         |   2 +-
 target/sh4/cpu.c                              |   8 +-
 target/sparc/cpu.c                            |   9 +-
 target/tricore/cpu.c                          |   2 +-
 target/xtensa/cpu.c                           |   2 +-
 target/xtensa/helper.c                        |   4 +-
 target/xtensa/translate.c                     |  10 +-
 tests/tcg/plugins/mem.c                       |   4 +-
 tests/tcg/plugins/syscall.c                   |   4 +-
 tests/unit/check-qom-interface.c              |   4 +-
 tests/unit/check-qom-proplist.c               |   8 +-
 tests/unit/test-qdev-global-props.c           |   8 +-
 tests/unit/test-smp-parse.c                   |  23 +--
 ui/console-vc.c                               |   6 +-
 ui/console.c                                  |   4 +-
 ui/dbus-chardev.c                             |   2 +-
 ui/dbus.c                                     |   6 +-
 ui/gtk.c                                      |   2 +-
 ui/input-barrier.c                            |   4 +-
 ui/input-linux.c                              |   4 +-
 ui/spice-app.c                                |   2 +-
 ui/vdagent.c                                  |   2 +-
 util/main-loop.c                              |   2 +-
 util/thread-context.c                         |   4 +-
 target/i386/tcg/emit.c.inc                    |   6 +-
 target/mips/tcg/mips16e_translate.c.inc       |   4 +-
 accel/meson.build                             |   1 +
 hw/display/apple-gfx-mmio.m                   |   2 +-
 hw/display/apple-gfx-pci.m                    |   4 +-
 pc-bios/{ => dtb}/bamboo.dtb                  | Bin
 pc-bios/{ => dtb}/bamboo.dts                  |   0
 pc-bios/{ => dtb}/canyonlands.dtb             | Bin
 pc-bios/{ => dtb}/canyonlands.dts             |   0
 pc-bios/dtb/meson.build                       |  23 +++
 pc-bios/{ => dtb}/petalogix-ml605.dtb         | Bin
 pc-bios/{ => dtb}/petalogix-ml605.dts         |   0
 pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb    | Bin
 pc-bios/{ => dtb}/petalogix-s3adsp1800.dts    |   0
 pc-bios/meson.build                           |  23 +--
 qemu.nsi                                      |   2 +-
 rust/qemu-api/src/qom.rs                      |   8 +-
 .../codeconverter/qom_type_info.py            |   3 +-
 .../codeconverter/test_regexps.py             |  12 +-
 1202 files changed, 2817 insertions(+), 2612 deletions(-)
 rename accel/{accel-system.h => accel-internal.h} (56%)
 create mode 100644 include/accel/accel-cpu.h
 create mode 100644 include/qemu/target-info-impl.h
 create mode 100644 include/qemu/target-info.h
 create mode 100644 accel/accel-common.c
 create mode 100644 target-info-stub.c
 create mode 100644 target-info.c
 rename pc-bios/{ => dtb}/bamboo.dtb (100%)
 rename pc-bios/{ => dtb}/bamboo.dts (100%)
 rename pc-bios/{ => dtb}/canyonlands.dtb (100%)
 rename pc-bios/{ => dtb}/canyonlands.dts (100%)
 create mode 100644 pc-bios/dtb/meson.build
 rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%)
 rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%)
 rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%)
 rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)
Signature · 1 line
2.47.1
#1 lore raw

[PULL 01/58] target/hexagon: Explode MO_TExx -> MO_TE | MO_xx

Extract the implicit MO_TE definition in order to replace it in the next commit.

Mechanical change using:

  $ for n in UW UL UQ UO SW SL SQ; do \
      sed -i -e "s/MO_TE$n/MO_TE | MO_$n/" \
           $(git grep -l MO_TE$n target/hexagon); \
    done

Message-Id: <[email protected]>

---
 target/hexagon/macros.h    | 10 +++++-----
 target/hexagon/genptr.c    |  8 ++++----
 target/hexagon/translate.c |  6 +++---
 3 files changed, 12 insertions(+), 12 deletions(-)
target/hexagon/macros.h +5 -5
index ee3d4c88e7b..57825efa55d 100644
@@ -115,27 +115,27 @@
 #define MEM_LOAD2s(DST, VA) \
     do { \
         CHECK_NOSHUF(VA, 2); \
-        tcg_gen_qemu_ld_tl(DST, VA, ctx->mem_idx, MO_TESW); \
+        tcg_gen_qemu_ld_tl(DST, VA, ctx->mem_idx, MO_TE | MO_SW); \
     } while (0)
 #define MEM_LOAD2u(DST, VA) \
     do { \
         CHECK_NOSHUF(VA, 2); \
-        tcg_gen_qemu_ld_tl(DST, VA, ctx->mem_idx, MO_TEUW); \
+        tcg_gen_qemu_ld_tl(DST, VA, ctx->mem_idx, MO_TE | MO_UW); \
     } while (0)
 #define MEM_LOAD4s(DST, VA) \
     do { \
         CHECK_NOSHUF(VA, 4); \
-        tcg_gen_qemu_ld_tl(DST, VA, ctx->mem_idx, MO_TESL); \
+        tcg_gen_qemu_ld_tl(DST, VA, ctx->mem_idx, MO_TE | MO_SL); \
     } while (0)
 #define MEM_LOAD4u(DST, VA) \
     do { \
         CHECK_NOSHUF(VA, 4); \
-        tcg_gen_qemu_ld_tl(DST, VA, ctx->mem_idx, MO_TEUL); \
+        tcg_gen_qemu_ld_tl(DST, VA, ctx->mem_idx, MO_TE | MO_UL); \
     } while (0)
 #define MEM_LOAD8u(DST, VA) \
     do { \
         CHECK_NOSHUF(VA, 8); \
-        tcg_gen_qemu_ld_i64(DST, VA, ctx->mem_idx, MO_TEUQ); \
+        tcg_gen_qemu_ld_i64(DST, VA, ctx->mem_idx, MO_TE | MO_UQ); \
     } while (0)
 
 #define MEM_STORE1_FUNC(X) \
target/hexagon/genptr.c +4 -4
index 2c5e15cfcf6..561e93c9fd4 100644
@@ -329,14 +329,14 @@ void gen_set_byte_i64(int N, TCGv_i64 result, TCGv src)
 
 static inline void gen_load_locked4u(TCGv dest, TCGv vaddr, int mem_index)
 {
-    tcg_gen_qemu_ld_tl(dest, vaddr, mem_index, MO_TEUL);
+    tcg_gen_qemu_ld_tl(dest, vaddr, mem_index, MO_TE | MO_UL);
     tcg_gen_mov_tl(hex_llsc_addr, vaddr);
     tcg_gen_mov_tl(hex_llsc_val, dest);
 }
 
 static inline void gen_load_locked8u(TCGv_i64 dest, TCGv vaddr, int mem_index)
 {
-    tcg_gen_qemu_ld_i64(dest, vaddr, mem_index, MO_TEUQ);
+    tcg_gen_qemu_ld_i64(dest, vaddr, mem_index, MO_TE | MO_UQ);
     tcg_gen_mov_tl(hex_llsc_addr, vaddr);
     tcg_gen_mov_i64(hex_llsc_val_i64, dest);
 }
@@ -756,7 +756,7 @@ static void gen_load_frame(DisasContext *ctx, TCGv_i64 frame, TCGv EA)
 {
     Insn *insn = ctx->insn;  /* Needed for CHECK_NOSHUF */
     CHECK_NOSHUF(EA, 8);
-    tcg_gen_qemu_ld_i64(frame, EA, ctx->mem_idx, MO_TEUQ);
+    tcg_gen_qemu_ld_i64(frame, EA, ctx->mem_idx, MO_TE | MO_UQ);
 }
 
 #ifndef CONFIG_HEXAGON_IDEF_PARSER
@@ -1230,7 +1230,7 @@ static void gen_vreg_load(DisasContext *ctx, intptr_t dstoff, TCGv src,
         tcg_gen_andi_tl(src, src, ~((int32_t)sizeof(MMVector) - 1));
     }
     for (int i = 0; i < sizeof(MMVector) / 8; i++) {
-        tcg_gen_qemu_ld_i64(tmp, src, ctx->mem_idx, MO_TEUQ);
+        tcg_gen_qemu_ld_i64(tmp, src, ctx->mem_idx, MO_TE | MO_UQ);
         tcg_gen_addi_tl(src, src, 8);
         tcg_gen_st_i64(tmp, tcg_env, dstoff + i * 8);
     }
target/hexagon/translate.c +3 -3
index dd26801e647..0109f31e19f 100644
@@ -656,17 +656,17 @@ void process_store(DisasContext *ctx, int slot_num)
         case 2:
             tcg_gen_qemu_st_tl(hex_store_val32[slot_num],
                                hex_store_addr[slot_num],
-                               ctx->mem_idx, MO_TEUW);
+                               ctx->mem_idx, MO_TE | MO_UW);
             break;
         case 4:
             tcg_gen_qemu_st_tl(hex_store_val32[slot_num],
                                hex_store_addr[slot_num],
-                               ctx->mem_idx, MO_TEUL);
+                               ctx->mem_idx, MO_TE | MO_UL);
             break;
         case 8:
             tcg_gen_qemu_st_i64(hex_store_val64[slot_num],
                                 hex_store_addr[slot_num],
-                                ctx->mem_idx, MO_TEUQ);
+                                ctx->mem_idx, MO_TE | MO_UQ);
             break;
         default:
             {
Signature · 1 line
2.47.1
#2 lore raw

[PULL 02/58] target/hexagon: Replace MO_TE -> MO_LE

In reply to Philippe Mathieu-Daudé

We only build the Hexagon target using little endianness order. The MO_TE definition always expands to MO_LE. Use the latter to simplify.

Message-Id: <[email protected]>

---
 target/hexagon/macros.h                     | 10 +++++-----
 target/hexagon/genptr.c                     |  8 ++++----
 target/hexagon/idef-parser/parser-helpers.c |  2 +-
 target/hexagon/translate.c                  |  6 +++---
 4 files changed, 13 insertions(+), 13 deletions(-)
target/hexagon/macros.h +5 -5
index 57825efa55d..e5eb31e6711 100644
@@ -115,27 +115,27 @@
 #define MEM_LOAD2s(DST, VA) \
     do { \
         CHECK_NOSHUF(VA, 2); \
-        tcg_gen_qemu_ld_tl(DST, VA, ctx->mem_idx, MO_TE | MO_SW); \
+        tcg_gen_qemu_ld_tl(DST, VA, ctx->mem_idx, MO_LE | MO_SW); \
     } while (0)
 #define MEM_LOAD2u(DST, VA) \
     do { \
         CHECK_NOSHUF(VA, 2); \
-        tcg_gen_qemu_ld_tl(DST, VA, ctx->mem_idx, MO_TE | MO_UW); \
+        tcg_gen_qemu_ld_tl(DST, VA, ctx->mem_idx, MO_LE | MO_UW); \
     } while (0)
 #define MEM_LOAD4s(DST, VA) \
     do { \
         CHECK_NOSHUF(VA, 4); \
-        tcg_gen_qemu_ld_tl(DST, VA, ctx->mem_idx, MO_TE | MO_SL); \
+        tcg_gen_qemu_ld_tl(DST, VA, ctx->mem_idx, MO_LE | MO_SL); \
     } while (0)
 #define MEM_LOAD4u(DST, VA) \
     do { \
         CHECK_NOSHUF(VA, 4); \
-        tcg_gen_qemu_ld_tl(DST, VA, ctx->mem_idx, MO_TE | MO_UL); \
+        tcg_gen_qemu_ld_tl(DST, VA, ctx->mem_idx, MO_LE | MO_UL); \
     } while (0)
 #define MEM_LOAD8u(DST, VA) \
     do { \
         CHECK_NOSHUF(VA, 8); \
-        tcg_gen_qemu_ld_i64(DST, VA, ctx->mem_idx, MO_TE | MO_UQ); \
+        tcg_gen_qemu_ld_i64(DST, VA, ctx->mem_idx, MO_LE | MO_UQ); \
     } while (0)
 
 #define MEM_STORE1_FUNC(X) \
target/hexagon/genptr.c +4 -4
index 561e93c9fd4..08fc5413de7 100644
@@ -329,14 +329,14 @@ void gen_set_byte_i64(int N, TCGv_i64 result, TCGv src)
 
 static inline void gen_load_locked4u(TCGv dest, TCGv vaddr, int mem_index)
 {
-    tcg_gen_qemu_ld_tl(dest, vaddr, mem_index, MO_TE | MO_UL);
+    tcg_gen_qemu_ld_tl(dest, vaddr, mem_index, MO_LE | MO_UL);
     tcg_gen_mov_tl(hex_llsc_addr, vaddr);
     tcg_gen_mov_tl(hex_llsc_val, dest);
 }
 
 static inline void gen_load_locked8u(TCGv_i64 dest, TCGv vaddr, int mem_index)
 {
-    tcg_gen_qemu_ld_i64(dest, vaddr, mem_index, MO_TE | MO_UQ);
+    tcg_gen_qemu_ld_i64(dest, vaddr, mem_index, MO_LE | MO_UQ);
     tcg_gen_mov_tl(hex_llsc_addr, vaddr);
     tcg_gen_mov_i64(hex_llsc_val_i64, dest);
 }
@@ -756,7 +756,7 @@ static void gen_load_frame(DisasContext *ctx, TCGv_i64 frame, TCGv EA)
 {
     Insn *insn = ctx->insn;  /* Needed for CHECK_NOSHUF */
     CHECK_NOSHUF(EA, 8);
-    tcg_gen_qemu_ld_i64(frame, EA, ctx->mem_idx, MO_TE | MO_UQ);
+    tcg_gen_qemu_ld_i64(frame, EA, ctx->mem_idx, MO_LE | MO_UQ);
 }
 
 #ifndef CONFIG_HEXAGON_IDEF_PARSER
@@ -1230,7 +1230,7 @@ static void gen_vreg_load(DisasContext *ctx, intptr_t dstoff, TCGv src,
         tcg_gen_andi_tl(src, src, ~((int32_t)sizeof(MMVector) - 1));
     }
     for (int i = 0; i < sizeof(MMVector) / 8; i++) {
-        tcg_gen_qemu_ld_i64(tmp, src, ctx->mem_idx, MO_TE | MO_UQ);
+        tcg_gen_qemu_ld_i64(tmp, src, ctx->mem_idx, MO_LE | MO_UQ);
         tcg_gen_addi_tl(src, src, 8);
         tcg_gen_st_i64(tmp, tcg_env, dstoff + i * 8);
     }
target/hexagon/idef-parser/parser-helpers.c +1 -1
index a7dcd85fe43..542af8d0a65 100644
@@ -1761,7 +1761,7 @@ void gen_load(Context *c, YYLTYPE *locp, HexValue *width,
     if (signedness == SIGNED) {
         OUT(c, locp, " | MO_SIGN");
     }
-    OUT(c, locp, " | MO_TE);\n");
+    OUT(c, locp, " | MO_LE);\n");
 }
 
 void gen_store(Context *c, YYLTYPE *locp, HexValue *width, HexValue *ea,
target/hexagon/translate.c +3 -3
index 0109f31e19f..02fd40c160f 100644
@@ -656,17 +656,17 @@ void process_store(DisasContext *ctx, int slot_num)
         case 2:
             tcg_gen_qemu_st_tl(hex_store_val32[slot_num],
                                hex_store_addr[slot_num],
-                               ctx->mem_idx, MO_TE | MO_UW);
+                               ctx->mem_idx, MO_LE | MO_UW);
             break;
         case 4:
             tcg_gen_qemu_st_tl(hex_store_val32[slot_num],
                                hex_store_addr[slot_num],
-                               ctx->mem_idx, MO_TE | MO_UL);
+                               ctx->mem_idx, MO_LE | MO_UL);
             break;
         case 8:
             tcg_gen_qemu_st_i64(hex_store_val64[slot_num],
                                 hex_store_addr[slot_num],
-                                ctx->mem_idx, MO_TE | MO_UQ);
+                                ctx->mem_idx, MO_LE | MO_UQ);
             break;
         default:
             {
Signature · 1 line
2.47.1
#3 lore raw

[PULL 09/58] cpus: Remove #ifdef check on cpu_list definition

In reply to Philippe Mathieu-Daudé

Since we removed all definitions of cpu_list, the #ifdef check is always true. Remove it, inlining cpu_list().

Message-Id: <[email protected]>

---
 cpu-target.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)
cpu-target.c +6 -13
index d139a18f5b1..c99d208a7c4 100644
@@ -77,7 +77,6 @@ const char *parse_cpu_option(const char *cpu_option)
     return cpu_type;
 }
 
-#ifndef cpu_list
 static void cpu_list_entry(gpointer data, gpointer user_data)
 {
     CPUClass *cc = CPU_CLASS(OBJECT_CLASS(data));
@@ -91,17 +90,6 @@ static void cpu_list_entry(gpointer data, gpointer user_data)
     }
 }
 
-static void cpu_list(void)
-{
-    GSList *list;
-
-    list = object_class_get_list_sorted(TYPE_CPU, false);
-    qemu_printf("Available CPUs:\n");
-    g_slist_foreach(list, cpu_list_entry, NULL);
-    g_slist_free(list);
-}
-#endif
-
 void list_cpus(void)
 {
     CPUClass *cc = CPU_CLASS(object_class_by_name(CPU_RESOLVING_TYPE));
@@ -109,7 +97,12 @@ void list_cpus(void)
     if (cc->list_cpus) {
         cc->list_cpus();
     } else {
-        cpu_list();
+        GSList *list;
+
+        list = object_class_get_list_sorted(TYPE_CPU, false);
+        qemu_printf("Available CPUs:\n");
+        g_slist_foreach(list, cpu_list_entry, NULL);
+        g_slist_free(list);
     }
 }
 
Signature · 1 line
2.47.1
#4 lore raw

[PULL 10/58] hw/pci-host/designware: Use deposit/extract API

In reply to Philippe Mathieu-Daudé

Prefer the safer (less bug-prone) deposit/extract API to access lower/upper 32-bit of 64-bit registers.

Message-Id: <[email protected]>

---
 hw/pci-host/designware.c | 48 ++++++++++++++--------------------------
 1 file changed, 17 insertions(+), 31 deletions(-)
hw/pci-host/designware.c +17 -31
index 5598d18f478..9c3a5f8d910 100644
@@ -22,6 +22,7 @@
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "qemu/log.h"
+#include "qemu/bitops.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/pci_bridge.h"
 #include "hw/pci/pci_host.h"
@@ -162,11 +163,9 @@ designware_pcie_root_config_read(PCIDevice *d, uint32_t address, int len)
         break;
 
     case DESIGNWARE_PCIE_MSI_ADDR_LO:
-        val = root->msi.base;
-        break;
-
     case DESIGNWARE_PCIE_MSI_ADDR_HI:
-        val = root->msi.base >> 32;
+        val = extract64(root->msi.base,
+                        address == DESIGNWARE_PCIE_MSI_ADDR_LO ? 0 : 32, 32);
         break;
 
     case DESIGNWARE_PCIE_MSI_INTR0_ENABLE:
@@ -190,19 +189,16 @@ designware_pcie_root_config_read(PCIDevice *d, uint32_t address, int len)
         break;
 
     case DESIGNWARE_PCIE_ATU_LOWER_BASE:
-        val = viewport->base;
-        break;
-
     case DESIGNWARE_PCIE_ATU_UPPER_BASE:
-        val = viewport->base >> 32;
+        val = extract64(viewport->base,
+                        address == DESIGNWARE_PCIE_ATU_LOWER_BASE ? 0 : 32, 32);
         break;
 
     case DESIGNWARE_PCIE_ATU_LOWER_TARGET:
-        val = viewport->target;
-        break;
-
     case DESIGNWARE_PCIE_ATU_UPPER_TARGET:
-        val = viewport->target >> 32;
+        val = extract64(viewport->target,
+                        address == DESIGNWARE_PCIE_ATU_LOWER_TARGET ? 0 : 32,
+                        32);
         break;
 
     case DESIGNWARE_PCIE_ATU_LIMIT:
@@ -321,14 +317,10 @@ static void designware_pcie_root_config_write(PCIDevice *d, uint32_t address,
         break;
 
     case DESIGNWARE_PCIE_MSI_ADDR_LO:
-        root->msi.base &= 0xFFFFFFFF00000000ULL;
-        root->msi.base |= val;
-        designware_pcie_root_update_msi_mapping(root);
-        break;
-
     case DESIGNWARE_PCIE_MSI_ADDR_HI:
-        root->msi.base &= 0x00000000FFFFFFFFULL;
-        root->msi.base |= (uint64_t)val << 32;
+        root->msi.base = deposit64(root->msi.base,
+                                   address == DESIGNWARE_PCIE_MSI_ADDR_LO
+                                   ? 0 : 32, 32, val);
         designware_pcie_root_update_msi_mapping(root);
         break;
 
@@ -355,23 +347,17 @@ static void designware_pcie_root_config_write(PCIDevice *d, uint32_t address,
         break;
 
     case DESIGNWARE_PCIE_ATU_LOWER_BASE:
-        viewport->base &= 0xFFFFFFFF00000000ULL;
-        viewport->base |= val;
-        break;
-
     case DESIGNWARE_PCIE_ATU_UPPER_BASE:
-        viewport->base &= 0x00000000FFFFFFFFULL;
-        viewport->base |= (uint64_t)val << 32;
+        viewport->base = deposit64(root->msi.base,
+                                   address == DESIGNWARE_PCIE_ATU_LOWER_BASE
+                                   ? 0 : 32, 32, val);
         break;
 
     case DESIGNWARE_PCIE_ATU_LOWER_TARGET:
-        viewport->target &= 0xFFFFFFFF00000000ULL;
-        viewport->target |= val;
-        break;
-
     case DESIGNWARE_PCIE_ATU_UPPER_TARGET:
-        viewport->target &= 0x00000000FFFFFFFFULL;
-        viewport->target |= (uint64_t)val << 32;
+        viewport->target = deposit64(root->msi.base,
+                                     address == DESIGNWARE_PCIE_ATU_LOWER_TARGET
+                                     ? 0 : 32, 32, val);
         break;
 
     case DESIGNWARE_PCIE_ATU_LIMIT:
Signature · 1 line
2.47.1
#5 lore raw

[PULL 06/58] target/ppc: Register CPUClass:list_cpus

In reply to Philippe Mathieu-Daudé

Register ppc_cpu_list() as CPUClass:list_cpus callback. Reduce its scope and remove the cpu_list definition.

Message-Id: <[email protected]>

---
 target/ppc/cpu.h      | 4 ----
 target/ppc/cpu_init.c | 3 ++-
 2 files changed, 2 insertions(+), 5 deletions(-)
target/ppc/cpu.h +0 -4
index 3c02f7f7d45..f4cc823c5c2 100644
@@ -1610,8 +1610,6 @@ void ppc_store_dawrx1(CPUPPCState *env, uint32_t value);
 #endif /* !defined(CONFIG_USER_ONLY) */
 void ppc_store_msr(CPUPPCState *env, target_ulong value);
 
-void ppc_cpu_list(void);
-
 /* Time-base and decrementer management */
 uint64_t cpu_ppc_load_tbl(CPUPPCState *env);
 uint32_t cpu_ppc_load_tbu(CPUPPCState *env);
@@ -1673,8 +1671,6 @@ static inline uint64_t ppc_dump_gpr(CPUPPCState *env, int gprn)
 int ppc_dcr_read(ppc_dcr_t *dcr_env, int dcrn, uint32_t *valp);
 int ppc_dcr_write(ppc_dcr_t *dcr_env, int dcrn, uint32_t val);
 
-#define cpu_list ppc_cpu_list
-
 /* MMU modes definitions */
 #define MMU_USER_IDX 0
 static inline int ppc_env_mmu_index(CPUPPCState *env, bool ifetch)
target/ppc/cpu_init.c +2 -1
index fde7d71fc68..077991ed535 100644
@@ -7177,7 +7177,7 @@ static void ppc_cpu_list_entry(gpointer data, gpointer user_data)
     g_free(name);
 }
 
-void ppc_cpu_list(void)
+static void ppc_cpu_list(void)
 {
     GSList *list;
 
@@ -7521,6 +7521,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data)
                                        &pcc->parent_phases);
 
     cc->class_by_name = ppc_cpu_class_by_name;
+    cc->list_cpus = ppc_cpu_list;
     cc->dump_state = ppc_cpu_dump_state;
     cc->set_pc = ppc_cpu_set_pc;
     cc->get_pc = ppc_cpu_get_pc;
Signature · 1 line
2.47.1
#6 lore raw

[PULL 15/58] qom: Constify TypeInfo::interfaces

In reply to Philippe Mathieu-Daudé

Message-Id: <[email protected]>

---
 include/hw/virtio/virtio-pci.h | 2 +-
 include/qom/object.h           | 2 +-
 hw/scsi/megasas.c              | 2 +-
 rust/qemu-api/src/qom.rs       | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
include/hw/virtio/virtio-pci.h +1 -1
index 567a9b0a9da..31ec144509f 100644
@@ -256,7 +256,7 @@ typedef struct VirtioPCIDeviceTypeInfo {
     void (*instance_init)(Object *obj);
     void (*instance_finalize)(Object *obj);
     void (*class_init)(ObjectClass *klass, const void *data);
-    InterfaceInfo *interfaces;
+    const InterfaceInfo *interfaces;
 } VirtioPCIDeviceTypeInfo;
 
 /* Register virtio-pci type(s).  @t must be static. */
include/qom/object.h +1 -1
index 42b75d10a43..26a45f638cd 100644
@@ -490,7 +490,7 @@ struct TypeInfo
     void (*class_base_init)(ObjectClass *klass, const void *data);
     const void *class_data;
 
-    InterfaceInfo *interfaces;
+    const InterfaceInfo *interfaces;
 };
 
 /**
hw/scsi/megasas.c +1 -1
index b024905a01f..a39e3e0e4fa 100644
@@ -2486,7 +2486,7 @@ typedef struct MegasasInfo {
     const VMStateDescription *vmsd;
     const Property *props;
     size_t props_count;
-    InterfaceInfo *interfaces;
+    const InterfaceInfo *interfaces;
 } MegasasInfo;
 
 static struct MegasasInfo megasas_devices[] = {
rust/qemu-api/src/qom.rs +1 -1
index f0a79f96d5e..f1b4022157b 100644
@@ -514,7 +514,7 @@ pub trait ObjectImpl: ObjectType + IsA<Object> {
         class_init: Some(rust_class_init::<Self>),
         class_base_init: Self::CLASS_BASE_INIT,
         class_data: core::ptr::null(),
-        interfaces: core::ptr::null_mut(),
+        interfaces: core::ptr::null(),
     };
 
     // methods on ObjectClass
Signature · 1 line
2.47.1
#7 lore raw

[PULL 11/58] hw/misc/edu: Convert type_init() -> DEFINE_TYPES()

In reply to Philippe Mathieu-Daudé

Prefer DEFINE_TYPES() macro over type_init() to register QOM types.

Initialize the .interfaces struct field as compound literal casted to InterfaceInfo type like the rest of our code base.

Message-Id: <[email protected]>

---
 hw/misc/edu.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)
hw/misc/edu.c +9 -12
index 504178b4a22..5723ef0ed13 100644
@@ -429,21 +429,18 @@ static void edu_class_init(ObjectClass *class, void *data)
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
-static void pci_edu_register_types(void)
-{
-    static InterfaceInfo interfaces[] = {
-        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-        { },
-    };
-    static const TypeInfo edu_info = {
+static const TypeInfo edu_types[] = {
+    {
         .name          = TYPE_PCI_EDU_DEVICE,
         .parent        = TYPE_PCI_DEVICE,
         .instance_size = sizeof(EduState),
         .instance_init = edu_instance_init,
         .class_init    = edu_class_init,
-        .interfaces = interfaces,
-    };
+        .interfaces    = (InterfaceInfo[]) {
+            { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+            { },
+        },
+    }
+};
 
-    type_register_static(&edu_info);
-}
-type_init(pci_edu_register_types)
+DEFINE_TYPES(edu_types)
Signature · 1 line
2.47.1
#8 lore raw

[PULL 05/58] target/i386: Register CPUClass:list_cpus

In reply to Philippe Mathieu-Daudé

Register x86_cpu_list() as CPUClass:list_cpus callback. Reduce its scope and remove the cpu_list definition.

Message-Id: <[email protected]>

---
 target/i386/cpu.h | 3 ---
 target/i386/cpu.c | 3 ++-
 2 files changed, 2 insertions(+), 4 deletions(-)
target/i386/cpu.h +0 -3
index 9866595cd0e..54bf9639f19 100644
@@ -2365,7 +2365,6 @@ int x86_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg);
 int x86_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
 void x86_cpu_gdb_init(CPUState *cs);
 
-void x86_cpu_list(void);
 int cpu_x86_support_mca_broadcast(CPUX86State *env);
 
 #ifndef CONFIG_USER_ONLY
@@ -2559,8 +2558,6 @@ uint64_t cpu_get_tsc(CPUX86State *env);
 #define TARGET_DEFAULT_CPU_TYPE X86_CPU_TYPE_NAME("qemu32")
 #endif
 
-#define cpu_list x86_cpu_list
-
 /* MMU modes definitions */
 #define MMU_KSMAP64_IDX    0
 #define MMU_KSMAP32_IDX    1
target/i386/cpu.c +2 -1
index 1f970aa4daa..955295fe798 100644
@@ -6319,7 +6319,7 @@ static void x86_cpu_list_entry(gpointer data, gpointer user_data)
 }
 
 /* list available CPU models and flags */
-void x86_cpu_list(void)
+static void x86_cpu_list(void)
 {
     int i, j;
     GSList *list;
@@ -8905,6 +8905,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data)
     cc->reset_dump_flags = CPU_DUMP_FPU | CPU_DUMP_CCOP;
 
     cc->class_by_name = x86_cpu_class_by_name;
+    cc->list_cpus = x86_cpu_list;
     cc->parse_features = x86_cpu_parse_featurestr;
     cc->dump_state = x86_cpu_dump_state;
     cc->set_pc = x86_cpu_set_pc;
Signature · 1 line
2.47.1
#9 lore raw

[PULL 17/58] qom/object: Fix type conflict of GLib function pointers

In reply to Philippe Mathieu-Daudé

From: Kohei Tokunaga <[email protected]>

On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_list_sort_with_data and g_slist_sort_with_data should be used instead, as they do not rely on function pointer casting.

Message-ID: <8ca13f4e2b9eba9d1f6030b0afb442a24330e463.1745295397.git.ktokunaga.mail@gmail.com>

---
 qom/object.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
qom/object.c +4 -3
index 425ee2f0ee8..664f0f24ae8 100644
@@ -1191,7 +1191,7 @@ GSList *object_class_get_list(const char *implements_type,
     return list;
 }
 
-static gint object_class_cmp(gconstpointer a, gconstpointer b)
+static gint object_class_cmp(gconstpointer a, gconstpointer b, gpointer d)
 {
     return strcasecmp(object_class_get_name((ObjectClass *)a),
                       object_class_get_name((ObjectClass *)b));
@@ -1200,8 +1200,9 @@ static gint object_class_cmp(gconstpointer a, gconstpointer b)
 GSList *object_class_get_list_sorted(const char *implements_type,
                                      bool include_abstract)
 {
-    return g_slist_sort(object_class_get_list(implements_type, include_abstract),
-                        object_class_cmp);
+    return g_slist_sort_with_data(
+        object_class_get_list(implements_type, include_abstract),
+        object_class_cmp, NULL);
 }
 
 Object *object_ref(void *objptr)
Signature · 1 line
2.47.1
#10 lore raw

[PULL 27/58] exec: Rename target_words_bigendian() -> target_big_endian()

In reply to Philippe Mathieu-Daudé

In commit 98ed8ecfc9d ("exec: introduce target_words_bigendian() helper") target_words_bigendian() was matching the definition it was depending on (TARGET_WORDS_BIGENDIAN). Later in commit ee3eb3a7ce7 ("Replace TARGET_WORDS_BIGENDIAN") the definition was renamed as TARGET_BIG_ENDIAN but we didn't update the helper. Do it now mechanically using:

  $ sed -i -e s/target_words_bigendian/target_big_endian/g \
        $(git grep -wl target_words_bigendian)

Message-Id: <[email protected]>

---
 include/exec/tswap.h     | 12 ++++++------
 system/memory-internal.h |  2 +-
 cpu-target.c             |  4 ++--
 hw/core/cpu-system.c     |  2 +-
 hw/display/vga.c         |  2 +-
 hw/virtio/virtio.c       |  2 +-
 system/memory.c          |  4 ++--
 system/qtest.c           |  2 +-
 8 files changed, 15 insertions(+), 15 deletions(-)
include/exec/tswap.h +6 -6
index 84060a49994..49511f26117 100644
@@ -11,15 +11,15 @@
 #include "qemu/bswap.h"
 
 /**
- * target_words_bigendian:
+ * target_big_endian:
  * Returns true if the (default) endianness of the target is big endian,
  * false otherwise. Common code should normally never need to know about the
  * endianness of the target, so please do *not* use this function unless you
  * know very well what you are doing!
  */
-bool target_words_bigendian(void);
+bool target_big_endian(void);
 #ifdef COMPILING_PER_TARGET
-#define target_words_bigendian()  TARGET_BIG_ENDIAN
+#define target_big_endian()   TARGET_BIG_ENDIAN
 #endif
 
 /*
@@ -29,7 +29,7 @@ bool target_words_bigendian(void);
 #ifdef COMPILING_PER_TARGET
 #define target_needs_bswap()  (HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN)
 #else
-#define target_needs_bswap()  (HOST_BIG_ENDIAN != target_words_bigendian())
+#define target_needs_bswap()  (HOST_BIG_ENDIAN != target_big_endian())
 #endif /* COMPILING_PER_TARGET */
 
 static inline uint16_t tswap16(uint16_t s)
@@ -83,7 +83,7 @@ static inline void tswap64s(uint64_t *s)
 /* Return ld{word}_{le,be}_p following target endianness. */
 #define LOAD_IMPL(word, args...)                    \
 do {                                                \
-    if (target_words_bigendian()) {                 \
+    if (target_big_endian()) {                      \
         return glue(glue(ld, word), _be_p)(args);   \
     } else {                                        \
         return glue(glue(ld, word), _le_p)(args);   \
@@ -120,7 +120,7 @@ static inline uint64_t ldn_p(const void *ptr, int sz)
 /* Call st{word}_{le,be}_p following target endianness. */
 #define STORE_IMPL(word, args...)           \
 do {                                        \
-    if (target_words_bigendian()) {         \
+    if (target_big_endian()) {              \
         glue(glue(st, word), _be_p)(args);  \
     } else {                                \
         glue(glue(st, word), _le_p)(args);  \
system/memory-internal.h +1 -1
index 085e81a9fe4..29717b3c58f 100644
@@ -45,7 +45,7 @@ static inline bool devend_big_endian(enum device_endian end)
                       DEVICE_HOST_ENDIAN != DEVICE_BIG_ENDIAN);
 
     if (end == DEVICE_NATIVE_ENDIAN) {
-        return target_words_bigendian();
+        return target_big_endian();
     }
     return end == DEVICE_BIG_ENDIAN;
 }
cpu-target.c +2 -2
index c99d208a7c4..d68cbab5da9 100644
@@ -160,8 +160,8 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...)
     abort();
 }
 
-#undef target_words_bigendian
-bool target_words_bigendian(void)
+#undef target_big_endian
+bool target_big_endian(void)
 {
     return TARGET_BIG_ENDIAN;
 }
hw/core/cpu-system.c +1 -1
index 82b68b8927d..3c84176a0c5 100644
@@ -133,7 +133,7 @@ bool cpu_virtio_is_big_endian(CPUState *cpu)
     if (cpu->cc->sysemu_ops->virtio_is_big_endian) {
         return cpu->cc->sysemu_ops->virtio_is_big_endian(cpu);
     }
-    return target_words_bigendian();
+    return target_big_endian();
 }
 
 GuestPanicInformation *cpu_get_crash_info(CPUState *cpu)
hw/display/vga.c +1 -1
index b01f67c65fb..20475ebbd31 100644
@@ -2264,7 +2264,7 @@ bool vga_common_init(VGACommonState *s, Object *obj, Error **errp)
      * into a device attribute set by the machine/platform to remove
      * all target endian dependencies from this file.
      */
-    s->default_endian_fb = target_words_bigendian();
+    s->default_endian_fb = target_big_endian();
     s->big_endian_fb = s->default_endian_fb;
 
     vga_dirty_log_start(s);
hw/virtio/virtio.c +1 -1
index f0fa36f8ce8..480c2e50365 100644
@@ -2248,7 +2248,7 @@ int virtio_set_status(VirtIODevice *vdev, uint8_t val)
 
 static enum virtio_device_endian virtio_default_endian(void)
 {
-    if (target_words_bigendian()) {
+    if (target_big_endian()) {
         return VIRTIO_DEVICE_ENDIAN_BIG;
     } else {
         return VIRTIO_DEVICE_ENDIAN_LITTLE;
system/memory.c +2 -2
index 7e2f16f4e95..67e433095b4 100644
@@ -2575,7 +2575,7 @@ void memory_region_add_eventfd(MemoryRegion *mr,
     unsigned i;
 
     if (size) {
-        MemOp mop = (target_words_bigendian() ? MO_BE : MO_LE) | size_memop(size);
+        MemOp mop = (target_big_endian() ? MO_BE : MO_LE) | size_memop(size);
         adjust_endianness(mr, &mrfd.data, mop);
     }
     memory_region_transaction_begin();
@@ -2611,7 +2611,7 @@ void memory_region_del_eventfd(MemoryRegion *mr,
     unsigned i;
 
     if (size) {
-        MemOp mop = (target_words_bigendian() ? MO_BE : MO_LE) | size_memop(size);
+        MemOp mop = (target_big_endian() ? MO_BE : MO_LE) | size_memop(size);
         adjust_endianness(mr, &mrfd.data, mop);
     }
     memory_region_transaction_begin();
system/qtest.c +1 -1
index ade3eb32212..301b03be2d3 100644
@@ -693,7 +693,7 @@ static void qtest_process_command(CharBackend *chr, gchar **words)
 
         qtest_send(chr, "OK\n");
     } else if (strcmp(words[0], "endianness") == 0) {
-        if (target_words_bigendian()) {
+        if (target_big_endian()) {
             qtest_sendf(chr, "OK big\n");
         } else {
             qtest_sendf(chr, "OK little\n");
Signature · 1 line
2.47.1
#11 lore raw

[PULL 08/58] target/s390x: Register CPUClass:list_cpus

In reply to Philippe Mathieu-Daudé

Both s390_cpu_list() and s390_set_qemu_cpu_model() are defined in cpu_models.c, move their declarations in the related "cpu_models.h" header. Use full path to header in s390-virtio-ccw.c file.

Register s390_cpu_list() as CPUClass:list_cpus callback and remove the cpu_list definition.

Message-Id: <[email protected]>

---
 target/s390x/cpu.h         | 7 -------
 target/s390x/cpu_models.h  | 3 +++
 hw/s390x/s390-virtio-ccw.c | 2 +-
 target/s390x/cpu.c         | 1 +
 4 files changed, 5 insertions(+), 8 deletions(-)
target/s390x/cpu.h +0 -7
index 90f64ee20cc..d9ca2506e27 100644
@@ -900,13 +900,6 @@ static inline uint8_t s390_cpu_get_state(S390CPU *cpu)
 }
 
 
-/* cpu_models.c */
-void s390_cpu_list(void);
-#define cpu_list s390_cpu_list
-void s390_set_qemu_cpu_model(uint16_t type, uint8_t gen, uint8_t ec_ga,
-                             const S390FeatInit feat_init);
-
-
 /* helper.c */
 #define CPU_RESOLVING_TYPE TYPE_S390_CPU
 
target/s390x/cpu_models.h +3 -0
index 71d4bc2dd4a..f701bc0b532 100644
@@ -113,6 +113,9 @@ static inline uint64_t s390_cpuid_from_cpu_model(const S390CPUModel *model)
 }
 S390CPUDef const *s390_find_cpu_def(uint16_t type, uint8_t gen, uint8_t ec_ga,
                                     S390FeatBitmap features);
+void s390_set_qemu_cpu_model(uint16_t type, uint8_t gen, uint8_t ec_ga,
+                             const S390FeatInit feat_init);
+void s390_cpu_list(void);
 
 bool kvm_s390_cpu_models_supported(void);
 bool kvm_s390_get_host_cpu_model(S390CPUModel *model, Error **errp);
hw/s390x/s390-virtio-ccw.c +1 -1
index 52c273b3dea..cf5b9974c58 100644
@@ -35,7 +35,7 @@
 #include "hw/s390x/css-bridge.h"
 #include "hw/s390x/ap-bridge.h"
 #include "migration/register.h"
-#include "cpu_models.h"
+#include "target/s390x/cpu_models.h"
 #include "hw/nmi.h"
 #include "hw/qdev-properties.h"
 #include "hw/s390x/tod.h"
target/s390x/cpu.c +1 -0
index 41cccc1e692..43fc3194bc9 100644
@@ -386,6 +386,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
                                        &scc->parent_phases);
 
     cc->class_by_name = s390_cpu_class_by_name;
+    cc->list_cpus = s390_cpu_list;
     cc->dump_state = s390_cpu_dump_state;
     cc->query_cpu_fast = s390_query_cpu_fast;
     cc->set_pc = s390_cpu_set_pc;
Signature · 1 line
2.47.1
#12 lore raw

[PULL 24/58] target/arm: Replace target_ulong -> hwaddr in ARMMMUFaultInfo

In reply to Philippe Mathieu-Daudé

Message-Id: <[email protected]>

---
 target/arm/internals.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
target/arm/internals.h +3 -2
index 08f4bd16791..0818de530b2 100644
@@ -25,6 +25,7 @@
 #ifndef TARGET_ARM_INTERNALS_H
 #define TARGET_ARM_INTERNALS_H
 
+#include "exec/hwaddr.h"
 #include "exec/breakpoint.h"
 #include "hw/registerfields.h"
 #include "tcg/tcg-gvec-desc.h"
@@ -726,8 +727,8 @@ typedef struct ARMMMUFaultInfo ARMMMUFaultInfo;
 struct ARMMMUFaultInfo {
     ARMFaultType type;
     ARMGPCF gpcf;
-    target_ulong s2addr;
-    target_ulong paddr;
+    hwaddr s2addr;
+    hwaddr paddr;
     ARMSecuritySpace paddr_space;
     int level;
     int domain;
Signature · 1 line
2.47.1
#13 lore raw

[PULL 16/58] qom: Make InterfaceInfo[] uses const

In reply to Philippe Mathieu-Daudé

Mechanical change using:

  $ sed -i -E 's/\(InterfaceInfo.?\[/\(const InterfaceInfo\[/g' \
              $(git grep -lE '\(InterfaceInfo.?\[\]\)')

Message-Id: <[email protected]>

---
 include/qom/object.h                                |  2 +-
 authz/list.c                                        |  2 +-
 authz/listfile.c                                    |  2 +-
 authz/pamacct.c                                     |  2 +-
 authz/simple.c                                      |  2 +-
 backends/cryptodev.c                                |  2 +-
 backends/dbus-vmstate.c                             |  2 +-
 backends/hostmem.c                                  |  2 +-
 backends/iommufd.c                                  |  2 +-
 backends/rng.c                                      |  2 +-
 block/throttle-groups.c                             |  2 +-
 crypto/secret_common.c                              |  2 +-
 crypto/tls-cipher-suites.c                          |  2 +-
 crypto/tlscredsanon.c                               |  2 +-
 crypto/tlscredspsk.c                                |  2 +-
 crypto/tlscredsx509.c                               |  2 +-
 event-loop-base.c                                   |  2 +-
 hw/acpi/erst.c                                      |  2 +-
 hw/acpi/generic_event_device.c                      |  2 +-
 hw/acpi/piix4.c                                     |  2 +-
 hw/arm/armsse.c                                     |  2 +-
 hw/arm/mps2-tz.c                                    |  2 +-
 hw/arm/virt.c                                       |  2 +-
 hw/audio/ac97.c                                     |  2 +-
 hw/audio/es1370.c                                   |  2 +-
 hw/audio/intel-hda.c                                |  2 +-
 hw/audio/via-ac97.c                                 |  4 ++--
 hw/block/fdc-isa.c                                  |  2 +-
 hw/char/diva-gsp.c                                  |  4 ++--
 hw/char/parallel.c                                  |  2 +-
 hw/char/serial-isa.c                                |  2 +-
 hw/char/serial-pci-multi.c                          |  4 ++--
 hw/char/serial-pci.c                                |  2 +-
 hw/char/virtio-serial-bus.c                         |  2 +-
 hw/core/bus.c                                       |  2 +-
 hw/core/qdev.c                                      |  2 +-
 hw/cxl/switch-mailbox-cci.c                         |  2 +-
 hw/display/ati.c                                    |  2 +-
 hw/display/bochs-display.c                          |  2 +-
 hw/display/cirrus_vga.c                             |  2 +-
 hw/display/qxl.c                                    |  2 +-
 hw/display/sm501.c                                  |  2 +-
 hw/display/vga-pci.c                                |  2 +-
 hw/display/virtio-gpu-pci-rutabaga.c                |  2 +-
 hw/display/vmware_vga.c                             |  2 +-
 hw/dma/i8257.c                                      |  2 +-
 hw/dma/xilinx_axidma.c                              |  4 ++--
 hw/dma/xlnx_csu_dma.c                               |  2 +-
 hw/hppa/machine.c                                   |  4 ++--
 hw/i2c/smbus_ich9.c                                 |  2 +-
 hw/i386/amd_iommu.c                                 |  2 +-
 hw/i386/microvm.c                                   |  2 +-
 hw/i386/pc.c                                        |  2 +-
 hw/i386/sgx-epc.c                                   |  2 +-
 hw/i386/x86.c                                       |  2 +-
 hw/i386/xen/xen_platform.c                          |  2 +-
 hw/i386/xen/xen_pvdevice.c                          |  2 +-
 hw/ide/ich.c                                        |  2 +-
 hw/ide/pci.c                                        |  2 +-
 hw/input/pckbd.c                                    |  2 +-
 hw/intc/arm_gic_common.c                            |  2 +-
 hw/intc/arm_gicv3_common.c                          |  2 +-
 hw/intc/goldfish_pic.c                              |  2 +-
 hw/intc/i8259_common.c                              |  2 +-
 hw/intc/ioapic_common.c                             |  2 +-
 hw/intc/loongarch_extioi_common.c                   |  2 +-
 hw/intc/loongarch_ipi.c                             |  2 +-
 hw/intc/m68k_irqc.c                                 |  2 +-
 hw/intc/pnv_xive.c                                  |  2 +-
 hw/intc/pnv_xive2.c                                 |  2 +-
 hw/intc/slavio_intctl.c                             |  2 +-
 hw/intc/spapr_xive.c                                |  2 +-
 hw/intc/xics_spapr.c                                |  2 +-
 hw/intc/xive.c                                      |  2 +-
 hw/intc/xive2.c                                     |  2 +-
 hw/ipack/tpci200.c                                  |  2 +-
 hw/ipmi/isa_ipmi_bt.c                               |  2 +-
 hw/ipmi/isa_ipmi_kcs.c                              |  2 +-
 hw/ipmi/pci_ipmi_bt.c                               |  2 +-
 hw/ipmi/pci_ipmi_kcs.c                              |  2 +-
 hw/ipmi/smbus_ipmi.c                                |  2 +-
 hw/isa/i82378.c                                     |  2 +-
 hw/isa/lpc_ich9.c                                   |  2 +-
 hw/isa/piix.c                                       |  2 +-
 hw/isa/vt82c686.c                                   |  4 ++--
 hw/loongarch/virt.c                                 |  2 +-
 hw/m68k/q800-glue.c                                 |  2 +-
 hw/mem/cxl_type3.c                                  |  2 +-
 hw/mem/pc-dimm.c                                    |  2 +-
 hw/misc/applesmc.c                                  |  2 +-
 hw/misc/edu.c                                       |  2 +-
 hw/misc/ivshmem-pci.c                               |  2 +-
 hw/misc/macio/gpio.c                                |  2 +-
 hw/misc/macio/macio.c                               |  2 +-
 hw/misc/pci-testdev.c                               |  2 +-
 hw/misc/pvpanic-isa.c                               |  2 +-
 hw/misc/pvpanic-pci.c                               |  2 +-
 hw/misc/xlnx-versal-cframe-reg.c                    |  2 +-
 hw/misc/xlnx-versal-cfu.c                           |  4 ++--
 hw/net/can/can_kvaser_pci.c                         |  2 +-
 hw/net/can/can_mioe3680_pci.c                       |  2 +-
 hw/net/can/can_pcm3680_pci.c                        |  2 +-
 hw/net/can/ctucan_pci.c                             |  2 +-
 hw/net/e1000.c                                      |  2 +-
 hw/net/e1000e.c                                     |  2 +-
 hw/net/eepro100.c                                   |  2 +-
 hw/net/igb.c                                        |  2 +-
 hw/net/igbvf.c                                      |  2 +-
 hw/net/ne2000-pci.c                                 |  2 +-
 hw/net/pcnet-pci.c                                  |  2 +-
 hw/net/rocker/rocker.c                              |  2 +-
 hw/net/rtl8139.c                                    |  2 +-
 hw/net/sungem.c                                     |  2 +-
 hw/net/sunhme.c                                     |  2 +-
 hw/net/tulip.c                                      |  2 +-
 hw/net/vmxnet3.c                                    |  2 +-
 hw/net/xilinx_axienet.c                             |  4 ++--
 hw/nvme/ctrl.c                                      |  2 +-
 hw/pci-bridge/cxl_downstream.c                      |  2 +-
 hw/pci-bridge/cxl_root_port.c                       |  2 +-
 hw/pci-bridge/cxl_upstream.c                        |  2 +-
 hw/pci-bridge/i82801b11.c                           |  2 +-
 hw/pci-bridge/pci_bridge_dev.c                      |  2 +-
 hw/pci-bridge/pci_expander_bridge.c                 |  6 +++---
 hw/pci-bridge/pcie_pci_bridge.c                     |  2 +-
 hw/pci-bridge/pcie_root_port.c                      |  2 +-
 hw/pci-bridge/simba.c                               |  2 +-
 hw/pci-bridge/xio3130_downstream.c                  |  2 +-
 hw/pci-bridge/xio3130_upstream.c                    |  2 +-
 hw/pci-host/articia.c                               |  4 ++--
 hw/pci-host/bonito.c                                |  2 +-
 hw/pci-host/designware.c                            |  2 +-
 hw/pci-host/gpex.c                                  |  2 +-
 hw/pci-host/grackle.c                               |  2 +-
 hw/pci-host/gt64120.c                               |  2 +-
 hw/pci-host/i440fx.c                                |  2 +-
 hw/pci-host/mv64361.c                               |  2 +-
 hw/pci-host/pnv_phb3_pbcq.c                         |  2 +-
 hw/pci-host/pnv_phb4.c                              |  2 +-
 hw/pci-host/pnv_phb4_pec.c                          |  4 ++--
 hw/pci-host/ppc4xx_pci.c                            |  2 +-
 hw/pci-host/ppce500.c                               |  2 +-
 hw/pci-host/q35.c                                   |  2 +-
 hw/pci-host/raven.c                                 |  2 +-
 hw/pci-host/sabre.c                                 |  2 +-
 hw/pci-host/sh_pci.c                                |  2 +-
 hw/pci-host/uninorth.c                              |  8 ++++----
 hw/pci-host/versatile.c                             |  2 +-
 hw/pci-host/xilinx-pcie.c                           |  2 +-
 hw/pci/pci.c                                        |  2 +-
 hw/pci/pci_bridge.c                                 |  2 +-
 hw/pci/pcie_port.c                                  |  2 +-
 hw/ppc/e500plat.c                                   |  2 +-
 hw/ppc/mac_newworld.c                               |  2 +-
 hw/ppc/mac_oldworld.c                               |  2 +-
 hw/ppc/pegasos2.c                                   |  2 +-
 hw/ppc/pnv.c                                        |  8 ++++----
 hw/ppc/pnv_adu.c                                    |  2 +-
 hw/ppc/pnv_chiptod.c                                |  4 ++--
 hw/ppc/pnv_i2c.c                                    |  2 +-
 hw/ppc/pnv_lpc.c                                    |  2 +-
 hw/ppc/pnv_n1_chiplet.c                             |  2 +-
 hw/ppc/pnv_nest_pervasive.c                         |  2 +-
 hw/ppc/pnv_psi.c                                    |  4 ++--
 hw/ppc/spapr.c                                      |  2 +-
 hw/ppc/spapr_pci.c                                  |  2 +-
 hw/remote/machine.c                                 |  2 +-
 hw/remote/proxy.c                                   |  2 +-
 hw/remote/remote-obj.c                              |  2 +-
 hw/remote/vfio-user-obj.c                           |  2 +-
 hw/riscv/riscv-iommu-pci.c                          |  2 +-
 hw/riscv/virt.c                                     |  2 +-
 hw/rtc/m48t59-isa.c                                 |  2 +-
 hw/rtc/m48t59.c                                     |  2 +-
 hw/rtc/mc146818rtc.c                                |  2 +-
 hw/s390x/ap-bridge.c                                |  2 +-
 hw/s390x/css-bridge.c                               |  2 +-
 hw/s390x/s390-pci-bus.c                             |  2 +-
 hw/s390x/s390-virtio-ccw.c                          |  2 +-
 hw/s390x/virtio-ccw-md.c                            |  2 +-
 hw/scsi/esp-pci.c                                   |  2 +-
 hw/scsi/lsi53c895a.c                                |  2 +-
 hw/scsi/megasas.c                                   |  4 ++--
 hw/scsi/mptsas.c                                    |  2 +-
 hw/scsi/scsi-bus.c                                  |  2 +-
 hw/scsi/vhost-scsi.c                                |  2 +-
 hw/scsi/vhost-user-scsi.c                           |  2 +-
 hw/scsi/virtio-scsi.c                               |  2 +-
 hw/scsi/vmw_pvscsi.c                                |  2 +-
 hw/sd/sdhci-pci.c                                   |  2 +-
 hw/sparc64/sun4u.c                                  |  4 ++--
 hw/ssi/pnv_spi.c                                    |  2 +-
 hw/tpm/tpm_crb.c                                    |  2 +-
 hw/tpm/tpm_spapr.c                                  |  2 +-
 hw/tpm/tpm_tis_i2c.c                                |  2 +-
 hw/tpm/tpm_tis_isa.c                                |  2 +-
 hw/tpm/tpm_tis_sysbus.c                             |  2 +-
 hw/ufs/ufs.c                                        |  2 +-
 hw/usb/bus.c                                        |  2 +-
 hw/usb/dev-smartcard-reader.c                       |  2 +-
 hw/usb/hcd-ehci-pci.c                               |  2 +-
 hw/usb/hcd-ohci-pci.c                               |  2 +-
 hw/usb/hcd-uhci.c                                   |  2 +-
 hw/usb/hcd-xhci-pci.c                               |  2 +-
 hw/vfio/igd.c                                       |  2 +-
 hw/vfio/pci.c                                       |  2 +-
 hw/virtio/virtio-md-pci.c                           |  2 +-
 hw/virtio/virtio-mem.c                              |  2 +-
 hw/virtio/virtio-pci.c                              |  6 +++---
 hw/watchdog/wdt_i6300esb.c                          |  2 +-
 hw/xen/xen-bus.c                                    |  2 +-
 hw/xen/xen-legacy-backend.c                         |  2 +-
 hw/xen/xen_pt.c                                     |  2 +-
 hw/xen/xen_pt_graphics.c                            |  2 +-
 net/can/can_core.c                                  |  2 +-
 net/can/can_host.c                                  |  2 +-
 net/colo-compare.c                                  |  2 +-
 net/filter.c                                        |  2 +-
 scsi/pr-manager.c                                   |  2 +-
 system/qtest.c                                      |  2 +-
 target/i386/sev.c                                   |  2 +-
 target/ppc/cpu_init.c                               |  2 +-
 tests/unit/check-qom-interface.c                    |  2 +-
 tests/unit/check-qom-proplist.c                     |  2 +-
 ui/dbus.c                                           |  2 +-
 ui/input-barrier.c                                  |  2 +-
 ui/input-linux.c                                    |  2 +-
 util/thread-context.c                               |  2 +-
 hw/display/apple-gfx-pci.m                          |  2 +-
 scripts/codeconverter/codeconverter/test_regexps.py | 10 +++++-----
 230 files changed, 258 insertions(+), 258 deletions(-)
include/qom/object.h +1 -1
index 26a45f638cd..1d5b0337242 100644
@@ -294,7 +294,7 @@ struct Object
         .class_size = CLASS_SIZE, \
         .class_init = module_obj_name##_class_init, \
         .abstract = ABSTRACT, \
-        .interfaces = (InterfaceInfo[]) { __VA_ARGS__ } , \
+        .interfaces = (const InterfaceInfo[]) { __VA_ARGS__ } , \
     }; \
     \
     static void \
authz/list.c +1 -1
index bbd99f2b7fc..17aa0efd80e 100644
@@ -253,7 +253,7 @@ static const TypeInfo qauthz_list_info = {
     .instance_size = sizeof(QAuthZList),
     .instance_finalize = qauthz_list_finalize,
     .class_init = qauthz_list_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
authz/listfile.c +1 -1
index b58d4ebd1d8..13741d5a722 100644
@@ -272,7 +272,7 @@ static const TypeInfo qauthz_list_file_info = {
     .instance_size = sizeof(QAuthZListFile),
     .instance_finalize = qauthz_list_file_finalize,
     .class_init = qauthz_list_file_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
authz/pamacct.c +1 -1
index 07b8aad4972..c0ad67479a7 100644
@@ -136,7 +136,7 @@ static const TypeInfo qauthz_pam_info = {
     .instance_size = sizeof(QAuthZPAM),
     .instance_finalize = qauthz_pam_finalize,
     .class_init = qauthz_pam_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
authz/simple.c +1 -1
index f6985b840ea..f8f2b98518a 100644
@@ -111,7 +111,7 @@ static const TypeInfo qauthz_simple_info = {
     .instance_size = sizeof(QAuthZSimple),
     .instance_finalize = qauthz_simple_finalize,
     .class_init = qauthz_simple_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
backends/cryptodev.c +1 -1
index 51bbe5ce40f..79f8882d3be 100644
@@ -641,7 +641,7 @@ static const TypeInfo cryptodev_backend_info = {
     .instance_finalize = cryptodev_backend_finalize,
     .class_size = sizeof(CryptoDevBackendClass),
     .class_init = cryptodev_backend_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
backends/dbus-vmstate.c +1 -1
index 8c2deef43d4..7d5b58b4c90 100644
@@ -505,7 +505,7 @@ static const TypeInfo dbus_vmstate_info = {
     .instance_size = sizeof(DBusVMState),
     .instance_finalize = dbus_vmstate_finalize,
     .class_init = dbus_vmstate_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { TYPE_VMSTATE_IF },
         { }
backends/hostmem.c +1 -1
index 195f37fa443..35734d6f4d1 100644
@@ -586,7 +586,7 @@ static const TypeInfo host_memory_backend_info = {
     .instance_size = sizeof(HostMemoryBackend),
     .instance_init = host_memory_backend_init,
     .instance_post_init = host_memory_backend_post_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
backends/iommufd.c +1 -1
index 17f7ae38094..1498102099d 100644
@@ -342,7 +342,7 @@ static const TypeInfo types[] = {
         .instance_finalize = iommufd_backend_finalize,
         .class_size = sizeof(IOMMUFDBackendClass),
         .class_init = iommufd_backend_class_init,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
             { TYPE_USER_CREATABLE },
             { }
         }
backends/rng.c +1 -1
index b3480d27a12..ab94dfea850 100644
@@ -119,7 +119,7 @@ static const TypeInfo rng_backend_info = {
     .class_size = sizeof(RngBackendClass),
     .class_init = rng_backend_class_init,
     .abstract = true,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
block/throttle-groups.c +1 -1
index 9720cafb964..66fdce9a90e 100644
@@ -967,7 +967,7 @@ static const TypeInfo throttle_group_info = {
     .instance_size = sizeof(ThrottleGroup),
     .instance_init = throttle_group_obj_init,
     .instance_finalize = throttle_group_obj_finalize,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     },
crypto/secret_common.c +1 -1
index 2399ce412be..a5ecb876aeb 100644
@@ -375,7 +375,7 @@ static const TypeInfo qcrypto_secret_info = {
     .class_size = sizeof(QCryptoSecretCommonClass),
     .class_init = qcrypto_secret_class_init,
     .abstract = true,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
crypto/tls-cipher-suites.c +1 -1
index e546cc7c0e6..d9b61d0c08a 100644
@@ -118,7 +118,7 @@ static const TypeInfo qcrypto_tls_cipher_suites_info = {
     .instance_size = sizeof(QCryptoTLSCipherSuites),
     .class_size = sizeof(QCryptoTLSCredsClass),
     .class_init = qcrypto_tls_cipher_suites_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { TYPE_FW_CFG_DATA_GENERATOR_INTERFACE },
         { }
crypto/tlscredsanon.c +1 -1
index 0e2d133821f..44af9e6c9af 100644
@@ -152,7 +152,7 @@ static const TypeInfo qcrypto_tls_creds_anon_info = {
     .instance_finalize = qcrypto_tls_creds_anon_finalize,
     .class_size = sizeof(QCryptoTLSCredsAnonClass),
     .class_init = qcrypto_tls_creds_anon_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
crypto/tlscredspsk.c +1 -1
index 287c2a3c96c..5b68a6b7ba2 100644
@@ -255,7 +255,7 @@ static const TypeInfo qcrypto_tls_creds_psk_info = {
     .instance_finalize = qcrypto_tls_creds_psk_finalize,
     .class_size = sizeof(QCryptoTLSCredsPSKClass),
     .class_init = qcrypto_tls_creds_psk_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
crypto/tlscredsx509.c +1 -1
index 143993f5393..63a72fe47c8 100644
@@ -828,7 +828,7 @@ static const TypeInfo qcrypto_tls_creds_x509_info = {
     .instance_finalize = qcrypto_tls_creds_x509_finalize,
     .class_size = sizeof(QCryptoTLSCredsX509Class),
     .class_init = qcrypto_tls_creds_x509_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
event-loop-base.c +1 -1
index 733c54486c0..8ca143bea43 100644
@@ -126,7 +126,7 @@ static const TypeInfo event_loop_base_info = {
     .class_size = sizeof(EventLoopBaseClass),
     .class_init = event_loop_base_class_init,
     .abstract = true,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
hw/acpi/erst.c +1 -1
index 90148ec9dc2..099cabb7ab7 100644
@@ -1044,7 +1044,7 @@ static const TypeInfo erst_type_info = {
     .parent        = TYPE_PCI_DEVICE,
     .class_init    = erst_class_init,
     .instance_size = sizeof(ERSTDeviceState),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     }
hw/acpi/generic_event_device.c +1 -1
index f589e79a2bb..d8adfea6480 100644
@@ -494,7 +494,7 @@ static const TypeInfo acpi_ged_info = {
     .instance_size = sizeof(AcpiGedState),
     .instance_init  = acpi_ged_initfn,
     .class_init    = acpi_ged_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { TYPE_ACPI_DEVICE_IF },
         { }
hw/acpi/piix4.c +1 -1
index 5860e8408bd..b16d45f03e1 100644
@@ -657,7 +657,7 @@ static const TypeInfo piix4_pm_info = {
     .instance_init  = piix4_pm_init,
     .instance_size = sizeof(PIIX4PMState),
     .class_init    = piix4_pm_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { TYPE_ACPI_DEVICE_IF },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
hw/arm/armsse.c +1 -1
index 9403b65ddb5..50ab7f48105 100644
@@ -1713,7 +1713,7 @@ static const TypeInfo armsse_info = {
     .class_size = sizeof(ARMSSEClass),
     .instance_init = armsse_init,
     .abstract = true,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_IDAU_INTERFACE },
         { }
     }
hw/arm/mps2-tz.c +1 -1
index 8474549f5f4..5dd87cc0281 100644
@@ -1453,7 +1453,7 @@ static const TypeInfo mps2tz_info = {
     .instance_size = sizeof(MPS2TZMachineState),
     .class_size = sizeof(MPS2TZMachineClass),
     .class_init = mps2tz_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_IDAU_INTERFACE },
         { }
     },
hw/arm/virt.c +1 -1
index 17faf34aae2..177f3dd22c1 100644
@@ -3396,7 +3396,7 @@ static const TypeInfo virt_machine_info = {
     .class_size    = sizeof(VirtMachineClass),
     .class_init    = virt_machine_class_init,
     .instance_init = virt_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
          { TYPE_HOTPLUG_HANDLER },
          { }
     },
hw/audio/ac97.c +1 -1
index 7454cc60deb..669a0463cc1 100644
@@ -1351,7 +1351,7 @@ static const TypeInfo ac97_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(AC97LinkState),
     .class_init    = ac97_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/audio/es1370.c +1 -1
index 322b7798149..8efb9692128 100644
@@ -896,7 +896,7 @@ static const TypeInfo es1370_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof (ES1370State),
     .class_init    = es1370_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/audio/intel-hda.c +1 -1
index 2f1b08e9c1c..b256c8ccea1 100644
@@ -1262,7 +1262,7 @@ static const TypeInfo intel_hda_info = {
     .instance_size = sizeof(IntelHDAState),
     .class_init    = intel_hda_class_init,
     .abstract      = true,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/audio/via-ac97.c +2 -2
index 5feef663d8c..1e0a5c7398b 100644
@@ -487,7 +487,7 @@ static const TypeInfo via_ac97_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(ViaAC97State),
     .class_init    = via_ac97_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
@@ -522,7 +522,7 @@ static const TypeInfo via_mc97_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = via_mc97_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/block/fdc-isa.c +1 -1
index fbba2ab6296..6d1790e0e61 100644
@@ -331,7 +331,7 @@ static const TypeInfo isa_fdc_info = {
     .instance_size = sizeof(FDCtrlISABus),
     .class_init    = isabus_fdc_class_init,
     .instance_init = isabus_fdc_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_ACPI_DEV_AML_IF },
         { },
     },
hw/char/diva-gsp.c +2 -2
index 9a623d680b3..60f933191d2 100644
@@ -268,7 +268,7 @@ static const TypeInfo diva_aux_info = {
     .instance_size = sizeof(DivaAuxState),
     .instance_init = diva_aux_init,
     .class_init    = diva_aux_class_initfn,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
@@ -282,7 +282,7 @@ static const TypeInfo diva_serial_pci_info = {
     .instance_size = sizeof(PCIDivaSerialState),
     .instance_init = diva_serial_init,
     .class_init    = diva_serial_class_initfn,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/char/parallel.c +1 -1
index 217ddaf2e3e..8732e4e9f96 100644
@@ -627,7 +627,7 @@ static const TypeInfo parallel_isa_info = {
     .parent        = TYPE_ISA_DEVICE,
     .instance_size = sizeof(ISAParallelState),
     .class_init    = parallel_isa_class_initfn,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_ACPI_DEV_AML_IF },
         { },
     },
hw/char/serial-isa.c +1 -1
index fe7fb1625b5..0ea59a3d5c2 100644
@@ -146,7 +146,7 @@ static const TypeInfo serial_isa_info = {
     .instance_size = sizeof(ISASerialState),
     .instance_init = serial_isa_initfn,
     .class_init    = serial_isa_class_initfn,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_ACPI_DEV_AML_IF },
         { },
     },
hw/char/serial-pci-multi.c +2 -2
index ee1c0f7dc4f..fb184c2e6dc 100644
@@ -194,7 +194,7 @@ static const TypeInfo multi_2x_serial_pci_info = {
     .instance_size = sizeof(PCIMultiSerialState),
     .instance_init = multi_serial_init,
     .class_init    = multi_2x_serial_pci_class_initfn,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
@@ -206,7 +206,7 @@ static const TypeInfo multi_4x_serial_pci_info = {
     .instance_size = sizeof(PCIMultiSerialState),
     .instance_init = multi_serial_init,
     .class_init    = multi_4x_serial_pci_class_initfn,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/char/serial-pci.c +1 -1
index bd38c7428c6..8707e819144 100644
@@ -115,7 +115,7 @@ static const TypeInfo serial_pci_info = {
     .instance_size = sizeof(PCISerialState),
     .instance_init = serial_pci_init,
     .class_init    = serial_pci_class_initfn,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/char/virtio-serial-bus.c +1 -1
index 00572873d28..eb79f5258b6 100644
@@ -1188,7 +1188,7 @@ static const TypeInfo virtio_device_info = {
     .parent = TYPE_VIRTIO_DEVICE,
     .instance_size = sizeof(VirtIOSerial),
     .class_init = virtio_serial_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { }
     }
hw/core/bus.c +1 -1
index c3b431a014b..bddfc22d388 100644
@@ -260,7 +260,7 @@ static const TypeInfo bus_info = {
     .instance_init = qbus_initfn,
     .instance_finalize = qbus_finalize,
     .class_init = bus_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_RESETTABLE_INTERFACE },
         { }
     },
hw/core/qdev.c +1 -1
index 4a3760c101e..f6002261768 100644
@@ -870,7 +870,7 @@ static const TypeInfo device_type_info = {
     .class_init = device_class_init,
     .abstract = true,
     .class_size = sizeof(DeviceClass),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_VMSTATE_IF },
         { TYPE_RESETTABLE_INTERFACE },
         { }
hw/cxl/switch-mailbox-cci.c +1 -1
index b92bbeb16ed..223f2204331 100644
@@ -99,7 +99,7 @@ static const TypeInfo cswmbcci_info = {
     .parent = TYPE_PCI_DEVICE,
     .class_init = cswmbcci_class_init,
     .instance_size = sizeof(CSWMBCCIDev),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_PCIE_DEVICE },
         { }
     },
hw/display/ati.c +1 -1
index 4e88d099431..7de27732cdc 100644
@@ -1079,7 +1079,7 @@ static const TypeInfo ati_vga_info = {
     .instance_size = sizeof(ATIVGAState),
     .class_init = ati_vga_class_init,
     .instance_init = ati_vga_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
           { INTERFACE_CONVENTIONAL_PCI_DEVICE },
           { },
     },
hw/display/bochs-display.c +1 -1
index 1d329fc9cce..ad2821c9745 100644
@@ -374,7 +374,7 @@ static const TypeInfo bochs_display_type_info = {
     .instance_size  = sizeof(BochsDisplayState),
     .instance_init  = bochs_display_init,
     .class_init     = bochs_display_class_init,
-    .interfaces     = (InterfaceInfo[]) {
+    .interfaces     = (const InterfaceInfo[]) {
         { INTERFACE_PCIE_DEVICE },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
hw/display/cirrus_vga.c +1 -1
index 4e5ae04af0f..ef08694626d 100644
@@ -3013,7 +3013,7 @@ static const TypeInfo cirrus_vga_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCICirrusVGAState),
     .class_init    = cirrus_vga_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/display/qxl.c +1 -1
index 6c820bcdb58..18f482ca7f7 100644
@@ -2517,7 +2517,7 @@ static const TypeInfo qxl_pci_type_info = {
     .instance_size = sizeof(PCIQXLDevice),
     .abstract = true,
     .class_init = qxl_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/display/sm501.c +1 -1
index dcff1e978ed..6d2f18684c3 100644
@@ -2196,7 +2196,7 @@ static const TypeInfo sm501_pci_info = {
     .instance_size = sizeof(SM501PCIState),
     .class_init    = sm501_pci_class_init,
     .instance_init = sm501_pci_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/display/vga-pci.c +1 -1
index a8601972740..b81f7fd2d0f 100644
@@ -369,7 +369,7 @@ static const TypeInfo vga_pci_type_info = {
     .instance_size = sizeof(PCIVGAState),
     .abstract = true,
     .class_init = vga_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { TYPE_ACPI_DEV_AML_IF },
         { },
hw/display/virtio-gpu-pci-rutabaga.c +1 -1
index abbb898c65d..5fdff37f2c1 100644
@@ -34,7 +34,7 @@ static const TypeInfo virtio_gpu_rutabaga_pci_info[] = {
         .parent = TYPE_VIRTIO_GPU_PCI_BASE,
         .instance_size = sizeof(VirtIOGPURutabagaPCI),
         .instance_init = virtio_gpu_rutabaga_initfn,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
             { INTERFACE_CONVENTIONAL_PCI_DEVICE },
             { },
         }
hw/display/vmware_vga.c +1 -1
index 7777deb17d0..544bb65320b 100644
@@ -1363,7 +1363,7 @@ static const TypeInfo vmsvga_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(struct pci_vmsvga_state_s),
     .class_init    = vmsvga_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/dma/i8257.c +1 -1
index 1d67e505364..2463952ada2 100644
@@ -618,7 +618,7 @@ static const TypeInfo i8257_info = {
     .parent = TYPE_ISA_DEVICE,
     .instance_size = sizeof(I8257State),
     .class_init = i8257_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_ISADMA },
         { }
     }
hw/dma/xilinx_axidma.c +2 -2
index bf1b523ac88..2020399fd59 100644
@@ -662,7 +662,7 @@ static const TypeInfo xilinx_axidma_data_stream_info = {
     .instance_size = sizeof(XilinxAXIDMAStreamSink),
     .class_init    = xilinx_axidma_stream_class_init,
     .class_data    = &xilinx_axidma_data_stream_class,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_STREAM_SINK },
         { }
     }
@@ -674,7 +674,7 @@ static const TypeInfo xilinx_axidma_control_stream_info = {
     .instance_size = sizeof(XilinxAXIDMAStreamSink),
     .class_init    = xilinx_axidma_stream_class_init,
     .class_data    = &xilinx_axidma_control_stream_class,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_STREAM_SINK },
         { }
     }
hw/dma/xlnx_csu_dma.c +1 -1
index 6943c927d07..3db3904d835 100644
@@ -744,7 +744,7 @@ static const TypeInfo xlnx_csu_dma_info = {
     .class_init    = xlnx_csu_dma_class_init,
     .class_size    = sizeof(XlnxCSUDMAClass),
     .instance_init = xlnx_csu_dma_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_STREAM_SINK },
         { }
     }
hw/hppa/machine.c +2 -2
index 18122766780..dacedc5409c 100644
@@ -713,7 +713,7 @@ static const TypeInfo HP_B160L_machine_init_typeinfo = {
     .name = MACHINE_TYPE_NAME("B160L"),
     .parent = TYPE_MACHINE,
     .class_init = HP_B160L_machine_init_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_NMI },
         { }
     },
@@ -749,7 +749,7 @@ static const TypeInfo HP_C3700_machine_init_typeinfo = {
     .name = MACHINE_TYPE_NAME("C3700"),
     .parent = TYPE_MACHINE,
     .class_init = HP_C3700_machine_init_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_NMI },
         { }
     },
hw/i2c/smbus_ich9.c +1 -1
index f1fca30fea5..956c9b59bbc 100644
@@ -145,7 +145,7 @@ static const TypeInfo ich9_smb_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(ICH9SMBState),
     .class_init = ich9_smb_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { TYPE_ACPI_DEV_AML_IF },
         { },
hw/i386/amd_iommu.c +1 -1
index b94802e21a6..2cf7e24a21d 100644
@@ -1719,7 +1719,7 @@ static const TypeInfo amdvi_pci = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(AMDVIPCIState),
     .class_init = amdvi_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/i386/microvm.c +1 -1
index 14a918a531c..e0daf0d4fc3 100644
@@ -726,7 +726,7 @@ static const TypeInfo microvm_machine_info = {
     .instance_init = microvm_machine_initfn,
     .class_size    = sizeof(MicrovmMachineClass),
     .class_init    = microvm_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
          { TYPE_HOTPLUG_HANDLER },
          { }
     },
hw/i386/pc.c +1 -1
index 49753bf0b30..70656157ca0 100644
@@ -1870,7 +1870,7 @@ static const TypeInfo pc_machine_info = {
     .instance_init = pc_machine_initfn,
     .class_size = sizeof(PCMachineClass),
     .class_init = pc_machine_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
          { TYPE_HOTPLUG_HANDLER },
          { }
     },
hw/i386/sgx-epc.c +1 -1
index 8fb80900b7a..2b3b2823b5f 100644
@@ -173,7 +173,7 @@ static const TypeInfo sgx_epc_info = {
     .instance_init = sgx_epc_init,
     .class_init    = sgx_epc_class_init,
     .class_size    = sizeof(DeviceClass),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_MEMORY_DEVICE },
         { }
     },
hw/i386/x86.c +1 -1
index c8e2551b2b4..e2d04092992 100644
@@ -450,7 +450,7 @@ static const TypeInfo x86_machine_info = {
     .instance_init = x86_machine_initfn,
     .class_size = sizeof(X86MachineClass),
     .class_init = x86_machine_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
          { TYPE_NMI },
          { }
     },
hw/i386/xen/xen_platform.c +1 -1
index 7c0d345f964..c8b852be0cc 100644
@@ -604,7 +604,7 @@ static const TypeInfo xen_platform_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIXenPlatformState),
     .class_init    = xen_platform_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/i386/xen/xen_pvdevice.c +1 -1
index 65868bd5e59..87a974ae5a0 100644
@@ -139,7 +139,7 @@ static const TypeInfo xen_pv_type_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(XenPVDevice),
     .class_init    = xen_pv_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/ide/ich.c +1 -1
index f2773ab4621..4cade0d1219 100644
@@ -197,7 +197,7 @@ static const TypeInfo ich_ahci_info = {
     .instance_size = sizeof(AHCIPCIState),
     .instance_init = pci_ich9_ahci_init,
     .class_init    = ich_ahci_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/ide/pci.c +1 -1
index 0ed72e42233..1e50bb9e483 100644
@@ -625,7 +625,7 @@ static const TypeInfo pci_ide_type_info = {
     .instance_size = sizeof(PCIIDEState),
     .instance_init = pci_ide_init,
     .abstract = true,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/input/pckbd.c +1 -1
index 83930dd50c0..71f5f976e9c 100644
@@ -958,7 +958,7 @@ static const TypeInfo i8042_info = {
     .instance_size = sizeof(ISAKBDState),
     .instance_init = i8042_initfn,
     .class_init    = i8042_class_initfn,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_ACPI_DEV_AML_IF },
         { },
     },
hw/intc/arm_gic_common.c +1 -1
index f61d1c1fe60..0f0c48d89ab 100644
@@ -382,7 +382,7 @@ static const TypeInfo arm_gic_common_type = {
     .class_size = sizeof(ARMGICCommonClass),
     .class_init = arm_gic_common_class_init,
     .abstract = true,
-    .interfaces = (InterfaceInfo []) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_ARM_LINUX_BOOT_IF },
         { },
     },
hw/intc/arm_gicv3_common.c +1 -1
index dd86a50300a..1cee68193ca 100644
@@ -644,7 +644,7 @@ static const TypeInfo arm_gicv3_common_type = {
     .class_init = arm_gicv3_common_class_init,
     .instance_finalize = arm_gicv3_finalize,
     .abstract = true,
-    .interfaces = (InterfaceInfo []) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_ARM_LINUX_BOOT_IF },
         { },
     },
hw/intc/goldfish_pic.c +1 -1
index b80538cdeba..2359861785d 100644
@@ -204,7 +204,7 @@ static const TypeInfo goldfish_pic_info = {
     .class_init = goldfish_pic_class_init,
     .instance_init = goldfish_pic_instance_init,
     .instance_size = sizeof(GoldfishPICState),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
          { TYPE_INTERRUPT_STATS_PROVIDER },
          { }
     },
hw/intc/i8259_common.c +1 -1
index 4a92e0da908..602e44c8eaf 100644
@@ -226,7 +226,7 @@ static const TypeInfo pic_common_type = {
     .class_size = sizeof(PICCommonClass),
     .class_init = pic_common_class_init,
     .abstract = true,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_INTERRUPT_STATS_PROVIDER },
         { }
     },
hw/intc/ioapic_common.c +1 -1
index b0381c7990d..fce3486e519 100644
@@ -215,7 +215,7 @@ static const TypeInfo ioapic_common_type = {
     .class_size = sizeof(IOAPICCommonClass),
     .class_init = ioapic_common_class_init,
     .abstract = true,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_INTERRUPT_STATS_PROVIDER },
         { }
     },
hw/intc/loongarch_extioi_common.c +1 -1
index 126f13d12cf..9e1589060cd 100644
@@ -196,7 +196,7 @@ static const TypeInfo loongarch_extioi_common_types[] = {
         .instance_size      = sizeof(LoongArchExtIOICommonState),
         .class_size         = sizeof(LoongArchExtIOICommonClass),
         .class_init         = loongarch_extioi_common_class_init,
-        .interfaces         = (InterfaceInfo[]) {
+        .interfaces         = (const InterfaceInfo[]) {
             { TYPE_HOTPLUG_HANDLER },
             { }
         },
hw/intc/loongarch_ipi.c +1 -1
index 4dad240689f..2f8bb578284 100644
@@ -162,7 +162,7 @@ static const TypeInfo loongarch_ipi_types[] = {
         .instance_size      = sizeof(LoongarchIPIState),
         .class_size         = sizeof(LoongarchIPIClass),
         .class_init         = loongarch_ipi_class_init,
-        .interfaces         = (InterfaceInfo[]) {
+        .interfaces         = (const InterfaceInfo[]) {
             { TYPE_HOTPLUG_HANDLER },
             { }
         },
hw/intc/m68k_irqc.c +1 -1
index 215e1a6ed5b..2532322618a 100644
@@ -110,7 +110,7 @@ static const TypeInfo m68k_irqc_type_info = {
     .instance_size = sizeof(M68KIRQCState),
     .instance_init = m68k_irqc_instance_init,
     .class_init = m68k_irqc_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
          { TYPE_NMI },
          { TYPE_INTERRUPT_STATS_PROVIDER },
          { }
hw/intc/pnv_xive.c +1 -1
index cd73881b5b0..935c0e4742f 100644
@@ -2106,7 +2106,7 @@ static const TypeInfo pnv_xive_info = {
     .instance_size = sizeof(PnvXive),
     .class_init    = pnv_xive_class_init,
     .class_size    = sizeof(PnvXiveClass),
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { TYPE_PNV_XSCOM_INTERFACE },
         { }
     }
hw/intc/pnv_xive2.c +1 -1
index 02437dddac6..ec8b0c68f1a 100644
@@ -2547,7 +2547,7 @@ static const TypeInfo pnv_xive2_info = {
     .instance_size = sizeof(PnvXive2),
     .class_init    = pnv_xive2_class_init,
     .class_size    = sizeof(PnvXive2Class),
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { TYPE_PNV_XSCOM_INTERFACE },
         { }
     }
hw/intc/slavio_intctl.c +1 -1
index 5776055a8b4..00b80bb177c 100644
@@ -460,7 +460,7 @@ static const TypeInfo slavio_intctl_info = {
     .instance_size = sizeof(SLAVIO_INTCTLState),
     .instance_init = slavio_intctl_init,
     .class_init    = slavio_intctl_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_INTERRUPT_STATS_PROVIDER },
         { }
     },
hw/intc/spapr_xive.c +1 -1
index 7fde6059bfe..440edb97d8d 100644
@@ -856,7 +856,7 @@ static const TypeInfo spapr_xive_info = {
     .instance_size = sizeof(SpaprXive),
     .class_init = spapr_xive_class_init,
     .class_size = sizeof(SpaprXiveClass),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_SPAPR_INTC },
         { }
     },
hw/intc/xics_spapr.c +1 -1
index 9e465fb8f3b..7663596a4a4 100644
@@ -461,7 +461,7 @@ static const TypeInfo ics_spapr_info = {
     .name = TYPE_ICS_SPAPR,
     .parent = TYPE_ICS,
     .class_init = ics_spapr_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_SPAPR_INTC },
         { }
     },
hw/intc/xive.c +1 -1
index 069c1e9a5e8..27b473e4d76 100644
@@ -2108,7 +2108,7 @@ static const TypeInfo xive_router_info = {
     .instance_size = sizeof(XiveRouter),
     .class_size    = sizeof(XiveRouterClass),
     .class_init    = xive_router_class_init,
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { TYPE_XIVE_NOTIFIER },
         { TYPE_XIVE_PRESENTER },
         { }
hw/intc/xive2.c +1 -1
index 3337a943fb2..a08cf906d0e 100644
@@ -1609,7 +1609,7 @@ static const TypeInfo xive2_router_info = {
     .instance_size = sizeof(Xive2Router),
     .class_size    = sizeof(Xive2RouterClass),
     .class_init    = xive2_router_class_init,
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { TYPE_XIVE_NOTIFIER },
         { TYPE_XIVE_PRESENTER },
         { }
hw/ipack/tpci200.c +1 -1
index f6993330d23..40b30517c75 100644
@@ -650,7 +650,7 @@ static const TypeInfo tpci200_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(TPCI200State),
     .class_init    = tpci200_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/ipmi/isa_ipmi_bt.c +1 -1
index db539e68aee..0ad91ccf689 100644
@@ -161,7 +161,7 @@ static const TypeInfo isa_ipmi_bt_info = {
     .instance_size = sizeof(ISAIPMIBTDevice),
     .instance_init = isa_ipmi_bt_init,
     .class_init    = isa_ipmi_bt_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_IPMI_INTERFACE },
         { TYPE_ACPI_DEV_AML_IF },
         { }
hw/ipmi/isa_ipmi_kcs.c +1 -1
index 4cbc6c577cd..418d234e0f1 100644
@@ -167,7 +167,7 @@ static const TypeInfo isa_ipmi_kcs_info = {
     .instance_size = sizeof(ISAIPMIKCSDevice),
     .instance_init = isa_ipmi_kcs_init,
     .class_init    = isa_ipmi_kcs_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_IPMI_INTERFACE },
         { TYPE_ACPI_DEV_AML_IF },
         { }
hw/ipmi/pci_ipmi_bt.c +1 -1
index 23f65c6886e..905101dcafd 100644
@@ -145,7 +145,7 @@ static const TypeInfo pci_ipmi_bt_info = {
     .instance_size = sizeof(PCIIPMIBTDevice),
     .instance_init = pci_ipmi_bt_instance_init,
     .class_init    = pci_ipmi_bt_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_IPMI_INTERFACE },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
hw/ipmi/pci_ipmi_kcs.c +1 -1
index 4077b6a7b09..4d6cde826ec 100644
@@ -144,7 +144,7 @@ static const TypeInfo pci_ipmi_kcs_info = {
     .instance_size = sizeof(PCIIPMIKCSDevice),
     .instance_init = pci_ipmi_kcs_instance_init,
     .class_init    = pci_ipmi_kcs_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_IPMI_INTERFACE },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
hw/ipmi/smbus_ipmi.c +1 -1
index 7345844a3a9..78c332de54d 100644
@@ -376,7 +376,7 @@ static const TypeInfo smbus_ipmi_info = {
     .instance_size = sizeof(SMBusIPMIDevice),
     .instance_init = smbus_ipmi_init,
     .class_init    = smbus_ipmi_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_IPMI_INTERFACE },
         { TYPE_ACPI_DEV_AML_IF },
         { }
hw/isa/i82378.c +1 -1
index 26c8ec4f77a..06e8f0ce3e0 100644
@@ -142,7 +142,7 @@ static const TypeInfo i82378_type_info = {
     .instance_size = sizeof(I82378State),
     .instance_init = i82378_init,
     .class_init = i82378_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/isa/lpc_ich9.c +1 -1
index d3e623b1e88..71afb45b631 100644
@@ -915,7 +915,7 @@ static const TypeInfo ich9_lpc_info = {
     .instance_size = sizeof(ICH9LPCState),
     .instance_init = ich9_lpc_initfn,
     .class_init  = ich9_lpc_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { TYPE_ACPI_DEVICE_IF },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
hw/isa/piix.c +1 -1
index 2c6e76f97cc..52c14d3cd5b 100644
@@ -445,7 +445,7 @@ static const TypeInfo piix_pci_type_info = {
     .instance_init = pci_piix_init,
     .abstract = true,
     .class_init = pci_piix_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { TYPE_ACPI_DEV_AML_IF },
         { },
hw/isa/vt82c686.c +2 -2
index c62afc907b2..337958617a4 100644
@@ -243,7 +243,7 @@ static const TypeInfo via_pm_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(ViaPMState),
     .abstract      = true,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
@@ -634,7 +634,7 @@ static const TypeInfo via_isa_info = {
     .instance_size = sizeof(ViaISAState),
     .instance_init = via_isa_init,
     .abstract      = true,
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/loongarch/virt.c +1 -1
index fde25e94095..779544fadaf 100644
@@ -1186,7 +1186,7 @@ static const TypeInfo virt_machine_types[] = {
         .instance_size  = sizeof(LoongArchVirtMachineState),
         .class_init     = virt_class_init,
         .instance_init  = virt_initfn,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
          { TYPE_HOTPLUG_HANDLER },
          { }
         },
hw/m68k/q800-glue.c +1 -1
index b428e7c833e..36de67c328e 100644
@@ -248,7 +248,7 @@ static const TypeInfo glue_info_types[] = {
         .instance_init = glue_init,
         .instance_finalize = glue_finalize,
         .class_init = glue_class_init,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
              { TYPE_NMI },
              { }
         },
hw/mem/cxl_type3.c +1 -1
index c95722a2ae4..bba923f8eab 100644
@@ -2174,7 +2174,7 @@ static const TypeInfo ct3d_info = {
     .class_size = sizeof(struct CXLType3Class),
     .class_init = ct3_class_init,
     .instance_size = sizeof(CXLType3Dev),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CXL_DEVICE },
         { INTERFACE_PCIE_DEVICE },
         {}
hw/mem/pc-dimm.c +1 -1
index 6f68171442f..f701d5b5f9b 100644
@@ -301,7 +301,7 @@ static const TypeInfo pc_dimm_info = {
     .instance_init = pc_dimm_init,
     .class_init    = pc_dimm_class_init,
     .class_size    = sizeof(PCDIMMDeviceClass),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_MEMORY_DEVICE },
         { }
     },
hw/misc/applesmc.c +1 -1
index d83a81b60d3..a015d4a9b8c 100644
@@ -393,7 +393,7 @@ static const TypeInfo applesmc_isa_info = {
     .parent        = TYPE_ISA_DEVICE,
     .instance_size = sizeof(AppleSMCState),
     .class_init    = qdev_applesmc_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_ACPI_DEV_AML_IF },
         { },
     },
hw/misc/edu.c +1 -1
index 8224603593f..cece633e113 100644
@@ -436,7 +436,7 @@ static const TypeInfo edu_types[] = {
         .instance_size = sizeof(EduState),
         .instance_init = edu_instance_init,
         .class_init    = edu_class_init,
-        .interfaces    = (InterfaceInfo[]) {
+        .interfaces    = (const InterfaceInfo[]) {
             { INTERFACE_CONVENTIONAL_PCI_DEVICE },
             { },
         },
hw/misc/ivshmem-pci.c +1 -1
index 2844b6f9099..5a10bca633d 100644
@@ -1002,7 +1002,7 @@ static const TypeInfo ivshmem_common_info = {
     .instance_size = sizeof(IVShmemState),
     .abstract      = true,
     .class_init    = ivshmem_common_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/misc/macio/gpio.c +1 -1
index e5d1e1168e2..990551f91f4 100644
@@ -210,7 +210,7 @@ static const TypeInfo macio_gpio_init_info = {
     .instance_size = sizeof(MacIOGPIOState),
     .instance_init = macio_gpio_init,
     .class_init    = macio_gpio_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_NMI },
         { }
     },
hw/misc/macio/macio.c +1 -1
index b0418db49ea..6710485d728 100644
@@ -465,7 +465,7 @@ static const TypeInfo macio_type_info = {
     .instance_init = macio_instance_init,
     .abstract      = true,
     .class_init    = macio_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/misc/pci-testdev.c +1 -1
index 0ea26451f1f..3f6a8bba84f 100644
@@ -345,7 +345,7 @@ static const TypeInfo pci_testdev_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCITestDevState),
     .class_init    = pci_testdev_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/misc/pvpanic-isa.c +1 -1
index 55522ee56cb..f7b421c713b 100644
@@ -121,7 +121,7 @@ static const TypeInfo pvpanic_isa_info = {
     .instance_size = sizeof(PVPanicISAState),
     .instance_init = pvpanic_isa_initfn,
     .class_init    = pvpanic_isa_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_ACPI_DEV_AML_IF },
         { },
     },
hw/misc/pvpanic-pci.c +1 -1
index 51ebf661076..2869b6a7ff8 100644
@@ -80,7 +80,7 @@ static const TypeInfo pvpanic_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PVPanicPCIState),
     .class_init    = pvpanic_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     }
hw/misc/xlnx-versal-cframe-reg.c +1 -1
index e28d569ebef..1ce083e2409 100644
@@ -833,7 +833,7 @@ static const TypeInfo cframe_reg_info = {
     .instance_size = sizeof(XlnxVersalCFrameReg),
     .class_init    = cframe_reg_class_init,
     .instance_init = cframe_reg_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_XLNX_CFI_IF },
         { }
     }
hw/misc/xlnx-versal-cfu.c +2 -2
index 02e4fed05b9..b920fc77c3f 100644
@@ -532,7 +532,7 @@ static const TypeInfo cfu_apb_info = {
     .instance_size = sizeof(XlnxVersalCFUAPB),
     .class_init    = cfu_apb_class_init,
     .instance_init = cfu_apb_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_XLNX_CFI_IF },
         { }
     }
@@ -545,7 +545,7 @@ static const TypeInfo cfu_fdro_info = {
     .class_init    = cfu_fdro_class_init,
     .instance_init = cfu_fdro_init,
     .instance_finalize = cfu_fdro_finalize,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_XLNX_CFI_IF },
         { }
     }
hw/net/can/can_kvaser_pci.c +1 -1
index c0bb598baef..be16769de29 100644
@@ -305,7 +305,7 @@ static const TypeInfo kvaser_pci_info = {
     .instance_size = sizeof(KvaserPCIState),
     .class_init    = kvaser_pci_class_init,
     .instance_init = kvaser_pci_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/net/can/can_mioe3680_pci.c +1 -1
index 9aac70dccd3..44f3ba370dc 100644
@@ -248,7 +248,7 @@ static const TypeInfo mioe3680_pci_info = {
     .instance_size = sizeof(Mioe3680PCIState),
     .class_init    = mioe3680_pci_class_init,
     .instance_init = mioe3680_pci_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/net/can/can_pcm3680_pci.c +1 -1
index b305f7e9b7d..7296d63be79 100644
@@ -249,7 +249,7 @@ static const TypeInfo pcm3680i_pci_info = {
     .instance_size = sizeof(Pcm3680iPCIState),
     .class_init    = pcm3680i_pci_class_init,
     .instance_init = pcm3680i_pci_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/net/can/ctucan_pci.c +1 -1
index 0dee9b59d10..bed6785433e 100644
@@ -262,7 +262,7 @@ static const TypeInfo ctucan_pci_info = {
     .instance_size = sizeof(CtuCanPCIState),
     .class_init    = ctucan_pci_class_init,
     .instance_init = ctucan_pci_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/net/e1000.c +1 -1
index 13814e84d18..cba4999e6d0 100644
@@ -1732,7 +1732,7 @@ static const TypeInfo e1000_base_info = {
     .instance_init = e1000_instance_init,
     .class_size    = sizeof(E1000BaseClass),
     .abstract      = true,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/net/e1000e.c +1 -1
index f38249a6a97..89e6d52ba0f 100644
@@ -721,7 +721,7 @@ static const TypeInfo e1000e_info = {
     .instance_size = sizeof(E1000EState),
     .class_init = e1000e_class_init,
     .instance_init = e1000e_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_PCIE_DEVICE },
         { }
     },
hw/net/eepro100.c +1 -1
index ef0f9337a0b..d47df5a97fd 100644
@@ -2094,7 +2094,7 @@ static void eepro100_register_types(void)
         type_info.class_init = eepro100_class_init;
         type_info.instance_size = sizeof(EEPRO100State);
         type_info.instance_init = eepro100_instance_init;
-        type_info.interfaces = (InterfaceInfo[]) {
+        type_info.interfaces = (const InterfaceInfo[]) {
             { INTERFACE_CONVENTIONAL_PCI_DEVICE },
             { },
         };
hw/net/igb.c +1 -1
index ba30433a500..e4c02365d67 100644
@@ -635,7 +635,7 @@ static const TypeInfo igb_info = {
     .instance_size = sizeof(IGBState),
     .class_init = igb_class_init,
     .instance_init = igb_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_PCIE_DEVICE },
         { }
     },
hw/net/igbvf.c +1 -1
index 91e7ccf931b..31d72c4977d 100644
@@ -325,7 +325,7 @@ static const TypeInfo igbvf_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(IgbVfState),
     .class_init = igbvf_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_PCIE_DEVICE },
         { }
     },
hw/net/ne2000-pci.c +1 -1
index 2153973af43..ce937e1b618 100644
@@ -122,7 +122,7 @@ static const TypeInfo ne2000_info = {
     .instance_size = sizeof(PCINE2000State),
     .class_init    = ne2000_class_init,
     .instance_init = ne2000_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/net/pcnet-pci.c +1 -1
index 429c2171803..0ca5bc21938 100644
@@ -280,7 +280,7 @@ static const TypeInfo pcnet_info = {
     .instance_size = sizeof(PCIPCNetState),
     .class_init    = pcnet_class_init,
     .instance_init = pcnet_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/net/rocker/rocker.c +1 -1
index 3d307f4ab15..cc49701dd3c 100644
@@ -1498,7 +1498,7 @@ static const TypeInfo rocker_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(Rocker),
     .class_init    = rocker_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/net/rtl8139.c +1 -1
index ad812954cf8..15b8f7501ae 100644
@@ -3438,7 +3438,7 @@ static const TypeInfo rtl8139_info = {
     .instance_size = sizeof(RTL8139State),
     .class_init    = rtl8139_class_init,
     .instance_init = rtl8139_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/net/sungem.c +1 -1
index 123d08ee8e3..b405eb89fa5 100644
@@ -1477,7 +1477,7 @@ static const TypeInfo sungem_info = {
     .instance_size = sizeof(SunGEMState),
     .class_init    = sungem_class_init,
     .instance_init = sungem_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     }
hw/net/sunhme.c +1 -1
index 46c9f5020b1..c2f7a8483da 100644
@@ -958,7 +958,7 @@ static const TypeInfo sunhme_info = {
     .class_init    = sunhme_class_init,
     .instance_size = sizeof(SunHMEState),
     .instance_init = sunhme_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     }
hw/net/tulip.c +1 -1
index fb3366d8ee3..63fe5134586 100644
@@ -1035,7 +1035,7 @@ static const TypeInfo tulip_info = {
     .instance_size = sizeof(TULIPState),
     .class_init    = tulip_class_init,
     .instance_init = tulip_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/net/vmxnet3.c +1 -1
index 4bcf1f902f5..83d942af179 100644
@@ -2522,7 +2522,7 @@ static const TypeInfo vmxnet3_info = {
     .instance_size = sizeof(VMXNET3State),
     .class_init    = vmxnet3_class_init,
     .instance_init = vmxnet3_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_PCIE_DEVICE },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
hw/net/xilinx_axienet.c +2 -2
index e45bc048e05..1f5c7480476 100644
@@ -1045,7 +1045,7 @@ static const TypeInfo xilinx_enet_data_stream_info = {
     .parent        = TYPE_OBJECT,
     .instance_size = sizeof(XilinxAXIEnetStreamSink),
     .class_init    = xilinx_enet_data_stream_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
             { TYPE_STREAM_SINK },
             { }
     }
@@ -1056,7 +1056,7 @@ static const TypeInfo xilinx_enet_control_stream_info = {
     .parent        = TYPE_OBJECT,
     .instance_size = sizeof(XilinxAXIEnetStreamSink),
     .class_init    = xilinx_enet_control_stream_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
             { TYPE_STREAM_SINK },
             { }
     }
hw/nvme/ctrl.c +1 -1
index e87295f5f84..fd935507bc0 100644
@@ -9221,7 +9221,7 @@ static const TypeInfo nvme_info = {
     .instance_size = sizeof(NvmeCtrl),
     .instance_init = nvme_instance_init,
     .class_init    = nvme_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_PCIE_DEVICE },
         { }
     },
hw/pci-bridge/cxl_downstream.c +1 -1
index ab3b550a889..1065245a8b8 100644
@@ -241,7 +241,7 @@ static const TypeInfo cxl_dsp_info = {
     .instance_size = sizeof(CXLDownstreamPort),
     .parent = TYPE_PCIE_SLOT,
     .class_init = cxl_dsp_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_PCIE_DEVICE },
         { INTERFACE_CXL_DEVICE },
         { }
hw/pci-bridge/cxl_root_port.c +1 -1
index 8b1e149e9ba..e6a4035d26c 100644
@@ -294,7 +294,7 @@ static const TypeInfo cxl_root_port_info = {
     .parent = TYPE_PCIE_ROOT_PORT,
     .instance_size = sizeof(CXLRootPort),
     .class_init = cxl_root_port_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CXL_DEVICE },
         { }
     },
hw/pci-bridge/cxl_upstream.c +1 -1
index 822a8285554..208e0c6172e 100644
@@ -394,7 +394,7 @@ static const TypeInfo cxl_usp_info = {
     .parent = TYPE_PCIE_PORT,
     .instance_size = sizeof(CXLUpstreamPort),
     .class_init = cxl_upstream_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_PCIE_DEVICE },
         { INTERFACE_CXL_DEVICE },
         { }
hw/pci-bridge/i82801b11.c +1 -1
index f2b294aee27..1d73c14c1f8 100644
@@ -107,7 +107,7 @@ static const TypeInfo i82801b11_bridge_info = {
     .parent        = TYPE_PCI_BRIDGE,
     .instance_size = sizeof(I82801b11Bridge),
     .class_init    = i82801b11_bridge_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/pci-bridge/pci_bridge_dev.c +1 -1
index 3b57583199d..b328e50ab31 100644
@@ -268,7 +268,7 @@ static const TypeInfo pci_bridge_dev_info = {
     .instance_size     = sizeof(PCIBridgeDev),
     .class_init        = pci_bridge_dev_class_init,
     .instance_finalize = pci_bridge_dev_instance_finalize,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
hw/pci-bridge/pci_expander_bridge.c +3 -3
index 1e2e394ee8a..3a29dfefc2c 100644
@@ -449,7 +449,7 @@ static const TypeInfo pxb_dev_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PXBDev),
     .class_init    = pxb_dev_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
@@ -486,7 +486,7 @@ static const TypeInfo pxb_pcie_dev_info = {
     .parent        = TYPE_PXB_DEV,
     .instance_size = sizeof(PXBPCIEDev),
     .class_init    = pxb_pcie_dev_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
@@ -537,7 +537,7 @@ static const TypeInfo pxb_cxl_dev_info = {
     .instance_size = sizeof(PXBCXLDev),
     .class_init    = pxb_cxl_dev_class_init,
     .interfaces =
-        (InterfaceInfo[]){
+        (const InterfaceInfo[]){
             { INTERFACE_CONVENTIONAL_PCI_DEVICE },
             {},
         },
hw/pci-bridge/pcie_pci_bridge.c +1 -1
index 833fe35cd5a..fce292a519b 100644
@@ -162,7 +162,7 @@ static const TypeInfo pcie_pci_bridge_info = {
         .parent = TYPE_PCI_BRIDGE,
         .instance_size = sizeof(PCIEPCIBridge),
         .class_init = pcie_pci_bridge_class_init,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
             { TYPE_HOTPLUG_HANDLER },
             { INTERFACE_PCIE_DEVICE },
             { },
hw/pci-bridge/pcie_root_port.c +1 -1
index 512c2ab305c..22c2fdb71e7 100644
@@ -188,7 +188,7 @@ static const TypeInfo rp_info = {
     .class_init    = rp_class_init,
     .abstract      = true,
     .class_size = sizeof(PCIERootPortClass),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_PCIE_DEVICE },
         { }
     },
hw/pci-bridge/simba.c +1 -1
index c7565d9e946..bbae594e119 100644
@@ -87,7 +87,7 @@ static const TypeInfo simba_pci_bridge_info = {
     .parent        = TYPE_PCI_BRIDGE,
     .class_init    = simba_pci_bridge_class_init,
     .instance_size = sizeof(SimbaPCIBridge),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/pci-bridge/xio3130_downstream.c +1 -1
index d85c23fe4a8..dc7d1aa7d77 100644
@@ -175,7 +175,7 @@ static const TypeInfo xio3130_downstream_info = {
     .name          = TYPE_XIO3130_DOWNSTREAM,
     .parent        = TYPE_PCIE_SLOT,
     .class_init    = xio3130_downstream_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_PCIE_DEVICE },
         { }
     },
hw/pci-bridge/xio3130_upstream.c +1 -1
index d7a27158124..40057b749bf 100644
@@ -144,7 +144,7 @@ static const TypeInfo xio3130_upstream_info = {
     .name          = "x3130-upstream",
     .parent        = TYPE_PCIE_PORT,
     .class_init    = xio3130_upstream_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_PCIE_DEVICE },
         { }
     },
hw/pci-host/articia.c +2 -2
index 043fb85e840..cc65aac2a87 100644
@@ -273,7 +273,7 @@ static const TypeInfo articia_types[] = {
         .parent        = TYPE_PCI_DEVICE,
         .instance_size = sizeof(ArticiaHostState),
         .class_init    = articia_pci_host_class_init,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
               { INTERFACE_CONVENTIONAL_PCI_DEVICE },
               { },
         },
@@ -283,7 +283,7 @@ static const TypeInfo articia_types[] = {
         .parent        = TYPE_PCI_DEVICE,
         .instance_size = sizeof(PCIDevice),
         .class_init    = articia_pci_bridge_class_init,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
               { INTERFACE_CONVENTIONAL_PCI_DEVICE },
               { },
         },
hw/pci-host/bonito.c +1 -1
index 4508cdd21ae..7d6251a78d7 100644
@@ -783,7 +783,7 @@ static const TypeInfo bonito_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIBonitoState),
     .class_init    = bonito_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/pci-host/designware.c +1 -1
index d03c998e3ad..183f838392c 100644
@@ -769,7 +769,7 @@ static const TypeInfo designware_pcie_types[] = {
         .parent         = TYPE_PCI_BRIDGE,
         .instance_size  = sizeof(DesignwarePCIERoot),
         .class_init     = designware_pcie_root_class_init,
-        .interfaces     = (InterfaceInfo[]) {
+        .interfaces     = (const InterfaceInfo[]) {
             { INTERFACE_PCIE_DEVICE },
             { }
         },
hw/pci-host/gpex.c +1 -1
index 7dcac4ee3c4..b806a2286f7 100644
@@ -261,7 +261,7 @@ static const TypeInfo gpex_root_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(GPEXRootState),
     .class_init = gpex_root_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/pci-host/grackle.c +1 -1
index b48d44623dd..f9da5a908c1 100644
@@ -116,7 +116,7 @@ static const TypeInfo grackle_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = grackle_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/pci-host/gt64120.c +1 -1
index bd74b6e8714..56a6ef93b7a 100644
@@ -1268,7 +1268,7 @@ static const TypeInfo gt64120_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = gt64120_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/pci-host/i440fx.c +1 -1
index fcc9f3818a4..e13bb1b53e4 100644
@@ -341,7 +341,7 @@ static const TypeInfo i440fx_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCII440FXState),
     .class_init    = i440fx_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/pci-host/mv64361.c +1 -1
index f51f385b226..e05b6770102 100644
@@ -46,7 +46,7 @@ static const TypeInfo mv64361_pcibridge_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = mv64361_pcibridge_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/pci-host/pnv_phb3_pbcq.c +1 -1
index 4e24b1449d0..1f7a149580d 100644
@@ -354,7 +354,7 @@ static const TypeInfo pnv_pbcq_type_info = {
     .instance_size = sizeof(PnvPBCQState),
     .instance_init = phb3_pbcq_instance_init,
     .class_init    = pnv_pbcq_class_init,
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { TYPE_PNV_XSCOM_INTERFACE },
         { }
     }
hw/pci-host/pnv_phb4.c +1 -1
index feb812dc1a9..77ea35299d3 100644
@@ -1714,7 +1714,7 @@ static const TypeInfo pnv_phb4_type_info = {
     .instance_init = pnv_phb4_instance_init,
     .instance_size = sizeof(PnvPHB4),
     .class_init    = pnv_phb4_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
             { TYPE_XIVE_NOTIFIER },
             { },
     }
hw/pci-host/pnv_phb4_pec.c +2 -2
index cc46641cdf8..5bac1c42ed0 100644
@@ -388,7 +388,7 @@ static const TypeInfo pnv_pec_type_info = {
     .instance_size = sizeof(PnvPhb4PecState),
     .class_init    = pnv_pec_class_init,
     .class_size    = sizeof(PnvPhb4PecClass),
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { TYPE_PNV_XSCOM_INTERFACE },
         { }
     }
@@ -445,7 +445,7 @@ static const TypeInfo pnv_phb5_pec_type_info = {
     .instance_size = sizeof(PnvPhb4PecState),
     .class_init    = pnv_phb5_pec_class_init,
     .class_size    = sizeof(PnvPhb4PecClass),
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { TYPE_PNV_XSCOM_INTERFACE },
         { }
     }
hw/pci-host/ppc4xx_pci.c +1 -1
index dcc4b78660c..25478176881 100644
@@ -370,7 +370,7 @@ static const TypeInfo ppc4xx_host_bridge_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = ppc4xx_host_bridge_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/pci-host/ppce500.c +1 -1
index 2f6354c931e..e97a515d5fe 100644
@@ -528,7 +528,7 @@ static const TypeInfo e500_pci_types[] = {
         .parent        = TYPE_PCI_DEVICE,
         .instance_size = sizeof(PPCE500PCIBridgeState),
         .class_init    = e500_host_bridge_class_init,
-        .interfaces    = (InterfaceInfo[]) {
+        .interfaces    = (const InterfaceInfo[]) {
             { INTERFACE_CONVENTIONAL_PCI_DEVICE },
             { },
         },
hw/pci-host/q35.c +1 -1
index c2a71108f2e..1951ae440cc 100644
@@ -703,7 +703,7 @@ static const TypeInfo mch_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(MCHPCIState),
     .class_init = mch_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/pci-host/raven.c +1 -1
index 3f158838a0a..21f7ca65e06 100644
@@ -416,7 +416,7 @@ static const TypeInfo raven_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(RavenPCIState),
     .class_init = raven_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/pci-host/sabre.c +1 -1
index f7086086f9a..538624c5079 100644
@@ -477,7 +477,7 @@ static const TypeInfo sabre_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(SabrePCIState),
     .class_init    = sabre_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/pci-host/sh_pci.c +1 -1
index 52bff66d6a1..de8f6a84aab 100644
@@ -186,7 +186,7 @@ static const TypeInfo sh_pcic_types[] = {
         .parent         = TYPE_PCI_DEVICE,
         .instance_size  = sizeof(PCIDevice),
         .class_init     = sh_pcic_pci_class_init,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
             { INTERFACE_CONVENTIONAL_PCI_DEVICE },
             { },
         },
hw/pci-host/uninorth.c +4 -4
index 7cb37e01d8f..194037d6e75 100644
@@ -333,7 +333,7 @@ static const TypeInfo unin_main_pci_host_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = unin_main_pci_host_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
@@ -361,7 +361,7 @@ static const TypeInfo u3_agp_pci_host_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = u3_agp_pci_host_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
@@ -389,7 +389,7 @@ static const TypeInfo unin_agp_pci_host_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = unin_agp_pci_host_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
@@ -418,7 +418,7 @@ static const TypeInfo unin_internal_pci_host_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = unin_internal_pci_host_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/pci-host/versatile.c +1 -1
index b333158e102..8ea26e3ff00 100644
@@ -492,7 +492,7 @@ static const TypeInfo versatile_pci_host_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = versatile_pci_host_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/pci-host/xilinx-pcie.c +1 -1
index 70e9b2b9810..c71492de9e7 100644
@@ -314,7 +314,7 @@ static const TypeInfo xilinx_pcie_root_info = {
     .parent = TYPE_PCI_BRIDGE,
     .instance_size = sizeof(XilinxPCIERoot),
     .class_init = xilinx_pcie_root_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_PCIE_DEVICE },
         { }
     },
hw/pci/pci.c +1 -1
index c60991def8f..fe38c4c0287 100644
@@ -288,7 +288,7 @@ static const TypeInfo pci_bus_info = {
     .instance_size = sizeof(PCIBus),
     .class_size = sizeof(PCIBusClass),
     .class_init = pci_bus_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_FW_CFG_DATA_GENERATOR_INTERFACE },
         { }
     }
hw/pci/pci_bridge.c +1 -1
index 0fe66e8b12d..76255c4cd89 100644
@@ -497,7 +497,7 @@ static const TypeInfo pci_bridge_type_info = {
     .instance_size = sizeof(PCIBridge),
     .class_init = pci_bridge_class_init,
     .abstract = true,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_ACPI_DEV_AML_IF },
         { },
     },
hw/pci/pcie_port.c +1 -1
index 8629b3aafd6..54f639e3d4f 100644
@@ -230,7 +230,7 @@ static const TypeInfo pcie_slot_type_info = {
     .instance_size = sizeof(PCIESlot),
     .abstract = true,
     .class_init = pcie_slot_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { }
     }
hw/ppc/e500plat.c +1 -1
index cd594eeb3ed..775b9d8da00 100644
@@ -107,7 +107,7 @@ static const TypeInfo e500plat_info = {
     .name          = TYPE_E500PLAT_MACHINE,
     .parent        = TYPE_PPCE500_MACHINE,
     .class_init    = e500plat_machine_class_init,
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
          { TYPE_HOTPLUG_HANDLER },
          { }
     }
hw/ppc/mac_newworld.c +1 -1
index 92fe60b2a2c..0b6e096116a 100644
@@ -639,7 +639,7 @@ static const TypeInfo core99_machine_info = {
     .class_init    = core99_machine_class_init,
     .instance_init = core99_instance_init,
     .instance_size = sizeof(Core99MachineState),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_FW_PATH_PROVIDER },
         { }
     },
hw/ppc/mac_oldworld.c +1 -1
index 5c5bf99b4d6..40ae936ad8a 100644
@@ -430,7 +430,7 @@ static const TypeInfo ppc_heathrow_machine_info = {
     .name          = MACHINE_TYPE_NAME("g3beige"),
     .parent        = TYPE_MACHINE,
     .class_init    = heathrow_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_FW_PATH_PROVIDER },
         { }
     },
hw/ppc/pegasos2.c +1 -1
index bb6f94f502c..e15cf964278 100644
@@ -619,7 +619,7 @@ static const TypeInfo pegasos2_machine_info = {
     .parent        = TYPE_MACHINE,
     .class_init    = pegasos2_machine_class_init,
     .instance_size = sizeof(Pegasos2MachineState),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_PPC_VIRTUAL_HYPERVISOR },
         { TYPE_VOF_MACHINE_IF },
         { }
hw/ppc/pnv.c +4 -4
index 4590231f888..4a49e9d1a86 100644
@@ -2973,7 +2973,7 @@ static const TypeInfo types[] = {
         .name          = MACHINE_TYPE_NAME("powernv10"),
         .parent        = TYPE_PNV_MACHINE,
         .class_init    = pnv_machine_power10_class_init,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
             { TYPE_XIVE_FABRIC },
             { },
         },
@@ -2982,7 +2982,7 @@ static const TypeInfo types[] = {
         .name          = MACHINE_TYPE_NAME("powernv9"),
         .parent        = TYPE_PNV_MACHINE,
         .class_init    = pnv_machine_power9_class_init,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
             { TYPE_XIVE_FABRIC },
             { },
         },
@@ -2991,7 +2991,7 @@ static const TypeInfo types[] = {
         .name          = MACHINE_TYPE_NAME("powernv8"),
         .parent        = TYPE_PNV_MACHINE,
         .class_init    = pnv_machine_power8_class_init,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
             { TYPE_XICS_FABRIC },
             { },
         },
@@ -3003,7 +3003,7 @@ static const TypeInfo types[] = {
         .instance_size = sizeof(PnvMachineState),
         .class_init    = pnv_machine_class_init,
         .class_size    = sizeof(PnvMachineClass),
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
             { TYPE_INTERRUPT_STATS_PROVIDER },
             { TYPE_NMI },
             { },
hw/ppc/pnv_adu.c +1 -1
index f9620806ec7..005fbda4750 100644
@@ -204,7 +204,7 @@ static const TypeInfo pnv_adu_type_info = {
     .parent        = TYPE_DEVICE,
     .instance_size = sizeof(PnvADU),
     .class_init    = pnv_adu_class_init,
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { TYPE_PNV_XSCOM_INTERFACE },
         { } },
 };
hw/ppc/pnv_chiptod.c +2 -2
index 4ca511a4dee..b9e9c7ba3db 100644
@@ -478,7 +478,7 @@ static const TypeInfo pnv_chiptod_power9_type_info = {
     .parent        = TYPE_PNV_CHIPTOD,
     .instance_size = sizeof(PnvChipTOD),
     .class_init    = pnv_chiptod_power9_class_init,
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { TYPE_PNV_XSCOM_INTERFACE },
         { }
     }
@@ -514,7 +514,7 @@ static const TypeInfo pnv_chiptod_power10_type_info = {
     .parent        = TYPE_PNV_CHIPTOD,
     .instance_size = sizeof(PnvChipTOD),
     .class_init    = pnv_chiptod_power10_class_init,
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { TYPE_PNV_XSCOM_INTERFACE },
         { }
     }
hw/ppc/pnv_i2c.c +1 -1
index b2f372c8743..60de4794917 100644
@@ -569,7 +569,7 @@ static const TypeInfo pnv_i2c_info = {
     .parent        = TYPE_DEVICE,
     .instance_size = sizeof(PnvI2C),
     .class_init    = pnv_i2c_class_init,
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { TYPE_PNV_XSCOM_INTERFACE },
         { }
     }
hw/ppc/pnv_lpc.c +1 -1
index d92347bcd2c..f6beba0917d 100644
@@ -732,7 +732,7 @@ static const TypeInfo pnv_lpc_power8_info = {
     .name          = TYPE_PNV8_LPC,
     .parent        = TYPE_PNV_LPC,
     .class_init    = pnv_lpc_power8_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_PNV_XSCOM_INTERFACE },
         { }
     }
hw/ppc/pnv_n1_chiplet.c +1 -1
index 05e3fd6f731..053f6473f22 100644
@@ -159,7 +159,7 @@ static const TypeInfo pnv_n1_chiplet_info = {
     .instance_init = pnv_n1_chiplet_instance_init,
     .instance_size = sizeof(PnvN1Chiplet),
     .class_init    = pnv_n1_chiplet_class_init,
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { TYPE_PNV_XSCOM_INTERFACE },
         { }
     }
hw/ppc/pnv_nest_pervasive.c +1 -1
index b5182d54fa1..1b1b14fed95 100644
@@ -194,7 +194,7 @@ static const TypeInfo pnv_nest_pervasive_info = {
     .parent        = TYPE_DEVICE,
     .instance_size = sizeof(PnvNestChipletPervasive),
     .class_init    = pnv_nest_pervasive_class_init,
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { TYPE_PNV_XSCOM_INTERFACE },
         { }
     }
hw/ppc/pnv_psi.c +2 -2
index 0fd247e6ade..5d947d8b520 100644
@@ -913,7 +913,7 @@ static const TypeInfo pnv_psi_power9_info = {
     .instance_size = sizeof(Pnv9Psi),
     .instance_init = pnv_psi_power9_instance_init,
     .class_init    = pnv_psi_power9_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
             { TYPE_XIVE_NOTIFIER },
             { },
     },
@@ -959,7 +959,7 @@ static const TypeInfo pnv_psi_info = {
     .class_init    = pnv_psi_class_init,
     .class_size    = sizeof(PnvPsiClass),
     .abstract      = true,
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { TYPE_PNV_XSCOM_INTERFACE },
         { }
     }
hw/ppc/spapr.c +1 -1
index 02663851ae9..702f774cda9 100644
@@ -4717,7 +4717,7 @@ static const TypeInfo spapr_machine_info = {
     .instance_finalize = spapr_machine_finalizefn,
     .class_size    = sizeof(SpaprMachineClass),
     .class_init    = spapr_machine_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_FW_PATH_PROVIDER },
         { TYPE_NMI },
         { TYPE_HOTPLUG_HANDLER },
hw/ppc/spapr_pci.c +1 -1
index d0468e3fe64..1ac1185825e 100644
@@ -2200,7 +2200,7 @@ static const TypeInfo spapr_phb_info = {
     .instance_size = sizeof(SpaprPhbState),
     .instance_finalize = spapr_phb_finalizefn,
     .class_init    = spapr_phb_class_init,
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { }
     }
hw/remote/machine.c +1 -1
index 9fb92ec6f13..e4b47838bad 100644
@@ -146,7 +146,7 @@ static const TypeInfo remote_machine = {
     .instance_size = sizeof(RemoteMachineState),
     .instance_init = remote_machine_instance_init,
     .class_init = remote_machine_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { }
     }
hw/remote/proxy.c +1 -1
index d2de48c9e37..b0165aa2a1d 100644
@@ -215,7 +215,7 @@ static const TypeInfo pci_proxy_dev_type_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIProxyDev),
     .class_init    = pci_proxy_dev_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/remote/remote-obj.c +1 -1
index 75f8d6df8a1..85882902d7f 100644
@@ -188,7 +188,7 @@ static const TypeInfo remote_object_info = {
     .instance_finalize = remote_object_finalize,
     .class_size = sizeof(RemoteObjectClass),
     .class_init = remote_object_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
hw/remote/vfio-user-obj.c +1 -1
index b0ae403f060..ea6165ebdce 100644
@@ -944,7 +944,7 @@ static const TypeInfo vfu_object_info = {
     .instance_finalize = vfu_object_finalize,
     .class_size = sizeof(VfuObjectClass),
     .class_init = vfu_object_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
hw/riscv/riscv-iommu-pci.c +1 -1
index d93cf7521bd..1f44eef74ea 100644
@@ -209,7 +209,7 @@ static const TypeInfo riscv_iommu_pci = {
     .class_init = riscv_iommu_pci_class_init,
     .instance_init = riscv_iommu_pci_init,
     .instance_size = sizeof(RISCVIOMMUStatePci),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_PCIE_DEVICE },
         { },
     },
hw/riscv/virt.c +1 -1
index 557efd15a13..be1bf0f6468 100644
@@ -1980,7 +1980,7 @@ static const TypeInfo virt_machine_typeinfo = {
     .class_init = virt_machine_class_init,
     .instance_init = virt_machine_instance_init,
     .instance_size = sizeof(RISCVVirtState),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
          { TYPE_HOTPLUG_HANDLER },
          { }
     },
hw/rtc/m48t59-isa.c +1 -1
index 4a7c0af9f04..9e2f6563a0a 100644
@@ -140,7 +140,7 @@ static const TypeInfo m48txx_isa_type_info = {
     .instance_size = sizeof(M48txxISAState),
     .abstract = true,
     .class_init = m48txx_isa_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_NVRAM },
         { }
     }
hw/rtc/m48t59.c +1 -1
index 821472a680e..68be2dad6f3 100644
@@ -658,7 +658,7 @@ static const TypeInfo m48txx_sysbus_type_info = {
     .instance_init = m48t59_init1,
     .abstract = true,
     .class_init = m48txx_sysbus_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_NVRAM },
         { }
     }
hw/rtc/mc146818rtc.c +1 -1
index 93b632bdf4a..6f787be7af8 100644
@@ -1038,7 +1038,7 @@ static const TypeInfo mc146818rtc_info = {
     .parent        = TYPE_ISA_DEVICE,
     .instance_size = sizeof(MC146818RtcState),
     .class_init    = rtc_class_initfn,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_ACPI_DEV_AML_IF },
         { },
     },
hw/s390x/ap-bridge.c +1 -1
index 4aa7d5a90db..edeb3dbef34 100644
@@ -75,7 +75,7 @@ static const TypeInfo ap_bridge_info = {
     .parent        = TYPE_SYS_BUS_DEVICE,
     .instance_size = 0,
     .class_init    = ap_bridge_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { }
     }
hw/s390x/css-bridge.c +1 -1
index 9d91e5a5fec..0f87b8c5c44 100644
@@ -136,7 +136,7 @@ static const TypeInfo virtual_css_bridge_info = {
     .parent        = TYPE_SYS_BUS_DEVICE,
     .instance_size = sizeof(VirtualCssBridge),
     .class_init    = virtual_css_bridge_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { }
     }
hw/s390x/s390-pci-bus.c +1 -1
index 838b7e6484f..e6aa44531f6 100644
@@ -1393,7 +1393,7 @@ static const TypeInfo s390_pcihost_info = {
     .parent        = TYPE_PCI_HOST_BRIDGE,
     .instance_size = sizeof(S390pciState),
     .class_init    = s390_pcihost_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { }
     }
hw/s390x/s390-virtio-ccw.c +1 -1
index 00e9e46aef0..94edd42dd25 100644
@@ -875,7 +875,7 @@ static const TypeInfo ccw_machine_info = {
     .instance_init = s390_machine_initfn,
     .class_size = sizeof(S390CcwMachineClass),
     .class_init    = ccw_machine_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_NMI },
         { TYPE_HOTPLUG_HANDLER},
         { TYPE_DUMP_SKEYS_INTERFACE},
hw/s390x/virtio-ccw-md.c +1 -1
index de333282df4..0370f584505 100644
@@ -140,7 +140,7 @@ static const TypeInfo virtio_ccw_md_info = {
     .instance_size = sizeof(VirtIOMDCcw),
     .class_size = sizeof(VirtIOMDCcwClass),
     .abstract = true,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_MEMORY_DEVICE },
         { }
     },
hw/scsi/esp-pci.c +1 -1
index 74e9af0b5d8..12c86eb7aaa 100644
@@ -450,7 +450,7 @@ static const TypeInfo esp_pci_info = {
     .instance_init = esp_pci_init,
     .instance_size = sizeof(PCIESPState),
     .class_init = esp_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/scsi/lsi53c895a.c +1 -1
index 0ad61565bf9..f4f2ef321e1 100644
@@ -2396,7 +2396,7 @@ static const TypeInfo lsi_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(LSIState),
     .class_init    = lsi_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/scsi/megasas.c +2 -2
index a39e3e0e4fa..55cd188bd57 100644
@@ -2503,7 +2503,7 @@ static struct MegasasInfo megasas_devices[] = {
         .vmsd = &vmstate_megasas_gen1,
         .props = megasas_properties_gen1,
         .props_count = ARRAY_SIZE(megasas_properties_gen1),
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
             { INTERFACE_CONVENTIONAL_PCI_DEVICE },
             { },
         },
@@ -2520,7 +2520,7 @@ static struct MegasasInfo megasas_devices[] = {
         .vmsd = &vmstate_megasas_gen2,
         .props = megasas_properties_gen2,
         .props_count = ARRAY_SIZE(megasas_properties_gen2),
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
             { INTERFACE_PCIE_DEVICE },
             { }
         },
hw/scsi/mptsas.c +1 -1
index 17f73ce3816..1ebe0b82a79 100644
@@ -1441,7 +1441,7 @@ static const TypeInfo mptsas_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(MPTSASState),
     .class_init = mptsas1068_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/scsi/scsi-bus.c +1 -1
index 0456b4de0ad..70be4a7367b 100644
@@ -2046,7 +2046,7 @@ static const TypeInfo scsi_bus_info = {
     .parent = TYPE_BUS,
     .instance_size = sizeof(SCSIBus),
     .class_init = scsi_bus_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { }
     }
hw/scsi/vhost-scsi.c +1 -1
index be5a416c1d6..10fde8eee03 100644
@@ -397,7 +397,7 @@ static const TypeInfo vhost_scsi_info = {
     .instance_size = sizeof(VHostSCSI),
     .class_init = vhost_scsi_class_init,
     .instance_init = vhost_scsi_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_FW_PATH_PROVIDER },
         { }
     },
hw/scsi/vhost-user-scsi.c +1 -1
index 807a58ecf4c..8298e8cc6d8 100644
@@ -422,7 +422,7 @@ static const TypeInfo vhost_user_scsi_info = {
     .instance_size = sizeof(VHostUserSCSI),
     .class_init = vhost_user_scsi_class_init,
     .instance_init = vhost_user_scsi_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_FW_PATH_PROVIDER },
         { }
     },
hw/scsi/virtio-scsi.c +1 -1
index ae67a7682ae..34ae14f7bf9 100644
@@ -1438,7 +1438,7 @@ static const TypeInfo virtio_scsi_info = {
     .parent = TYPE_VIRTIO_SCSI_COMMON,
     .instance_size = sizeof(VirtIOSCSI),
     .class_init = virtio_scsi_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { }
     }
hw/scsi/vmw_pvscsi.c +1 -1
index a8ea57ffad3..d5825b67868 100644
@@ -1346,7 +1346,7 @@ static const TypeInfo pvscsi_info = {
     .class_size    = sizeof(PVSCSIClass),
     .instance_size = sizeof(PVSCSIState),
     .class_init    = pvscsi_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { INTERFACE_PCIE_DEVICE },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
hw/sd/sdhci-pci.c +1 -1
index 2a56fbf2cda..c18b91fe63c 100644
@@ -75,7 +75,7 @@ static const TypeInfo sdhci_pci_types[] = {
         .parent         = TYPE_PCI_DEVICE,
         .instance_size  = sizeof(SDHCIState),
         .class_init     = sdhci_pci_class_init,
-        .interfaces     = (InterfaceInfo[]) {
+        .interfaces     = (const InterfaceInfo[]) {
             { INTERFACE_CONVENTIONAL_PCI_DEVICE },
             { },
         },
hw/sparc64/sun4u.c +2 -2
index 0e5fb4e1b58..e9f9b0a4cb9 100644
@@ -391,7 +391,7 @@ static const TypeInfo ebus_info = {
     .parent        = TYPE_PCI_DEVICE,
     .class_init    = ebus_class_init,
     .instance_size = sizeof(EbusState),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
@@ -811,7 +811,7 @@ static const TypeInfo sun4u_type = {
     .name = MACHINE_TYPE_NAME("sun4u"),
     .parent = TYPE_MACHINE,
     .class_init = sun4u_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_FW_PATH_PROVIDER },
         { }
     },
hw/ssi/pnv_spi.c +1 -1
index 0bb6b0d935e..f40e8836b9c 100644
@@ -1217,7 +1217,7 @@ static const TypeInfo pnv_spi_info = {
     .parent        = TYPE_SYS_BUS_DEVICE,
     .instance_size = sizeof(PnvSpi),
     .class_init    = pnv_spi_class_init,
-    .interfaces    = (InterfaceInfo[]) {
+    .interfaces    = (const InterfaceInfo[]) {
         { TYPE_PNV_XSCOM_INTERFACE },
         { }
     }
hw/tpm/tpm_crb.c +1 -1
index 9aff4d1a6ff..bc7a78f898c 100644
@@ -337,7 +337,7 @@ static const TypeInfo tpm_crb_info = {
     .parent = TYPE_DEVICE,
     .instance_size = sizeof(CRBState),
     .class_init  = tpm_crb_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_TPM_IF },
         { }
     }
hw/tpm/tpm_spapr.c +1 -1
index 1cad9a88ead..ea608ba4c80 100644
@@ -414,7 +414,7 @@ static const TypeInfo tpm_spapr_info = {
     .parent        = TYPE_VIO_SPAPR_DEVICE,
     .instance_size = sizeof(SpaprTpmState),
     .class_init    = tpm_spapr_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_TPM_IF },
         { }
     }
hw/tpm/tpm_tis_i2c.c +1 -1
index b97d768a5b5..5ce84dc7a45 100644
@@ -552,7 +552,7 @@ static const TypeInfo tpm_tis_i2c_info = {
     .parent        = TYPE_I2C_SLAVE,
     .instance_size = sizeof(TPMStateI2C),
     .class_init    = tpm_tis_i2c_class_init,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
         { TYPE_TPM_IF },
         { }
     }
hw/tpm/tpm_tis_isa.c +1 -1
index c0098a26e80..dce83057a94 100644
@@ -189,7 +189,7 @@ static const TypeInfo tpm_tis_isa_info = {
     .instance_size = sizeof(TPMStateISA),
     .instance_init = tpm_tis_isa_initfn,
     .class_init  = tpm_tis_isa_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_TPM_IF },
         { TYPE_ACPI_DEV_AML_IF },
         { }
hw/tpm/tpm_tis_sysbus.c +1 -1
index 19abf0b9486..2ffa85852ac 100644
@@ -145,7 +145,7 @@ static const TypeInfo tpm_tis_sysbus_info = {
     .instance_size = sizeof(TPMStateSysBus),
     .instance_init = tpm_tis_sysbus_initfn,
     .class_init  = tpm_tis_sysbus_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_TPM_IF },
         { }
     }
hw/ufs/ufs.c +1 -1
index 749519760ff..0577747f469 100644
@@ -1892,7 +1892,7 @@ static const TypeInfo ufs_info = {
     .parent = TYPE_PCI_DEVICE,
     .class_init = ufs_class_init,
     .instance_size = sizeof(UfsHc),
-    .interfaces = (InterfaceInfo[]){ { INTERFACE_PCIE_DEVICE }, {} },
+    .interfaces = (const InterfaceInfo[]){ { INTERFACE_PCIE_DEVICE }, {} },
 };
 
 static const TypeInfo ufs_bus_info = {
hw/usb/bus.c +1 -1
index d8446cf50e6..8dd2ce415eb 100644
@@ -42,7 +42,7 @@ static const TypeInfo usb_bus_info = {
     .parent = TYPE_BUS,
     .instance_size = sizeof(USBBus),
     .class_init = usb_bus_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { }
     }
hw/usb/dev-smartcard-reader.c +1 -1
index 87018a3f01a..6ce7154feed 100644
@@ -1458,7 +1458,7 @@ static const TypeInfo ccid_info = {
     .parent        = TYPE_USB_DEVICE,
     .instance_size = sizeof(USBCCIDState),
     .class_init    = ccid_class_initfn,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { }
     }
hw/usb/hcd-ehci-pci.c +1 -1
index 73122aa7971..38ad3406b32 100644
@@ -172,7 +172,7 @@ static const TypeInfo ehci_pci_type_info = {
     .instance_finalize = usb_ehci_pci_finalize,
     .abstract = true,
     .class_init = ehci_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/usb/hcd-ohci-pci.c +1 -1
index 3c82525a1e4..94d1077eb9e 100644
@@ -149,7 +149,7 @@ static const TypeInfo ohci_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(OHCIPCIState),
     .class_init    = ohci_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/usb/hcd-uhci.c +1 -1
index 2b1aee1f21f..4822c704f69 100644
@@ -1278,7 +1278,7 @@ static const TypeInfo uhci_pci_type_info = {
     .class_size    = sizeof(UHCIPCIDeviceClass),
     .abstract = true,
     .class_init = uhci_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/usb/hcd-xhci-pci.c +1 -1
index 6167bb91000..b93c80b09d8 100644
@@ -248,7 +248,7 @@ static const TypeInfo xhci_pci_info = {
     .class_init    = xhci_class_init,
     .instance_init = xhci_instance_init,
     .abstract      = true,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_PCIE_DEVICE },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
hw/vfio/igd.c +1 -1
index fd55b8d8840..0a13b185fe3 100644
@@ -318,7 +318,7 @@ static const TypeInfo vfio_pci_igd_lpc_bridge_info = {
     .name = "vfio-pci-igd-lpc-bridge",
     .parent = TYPE_PCI_DEVICE,
     .class_init = vfio_pci_igd_lpc_bridge_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/vfio/pci.c +1 -1
index 0db9f038464..c3d93607104 100644
@@ -3554,7 +3554,7 @@ static const TypeInfo vfio_pci_dev_info = {
     .class_init = vfio_pci_dev_class_init,
     .instance_init = vfio_instance_init,
     .instance_finalize = vfio_instance_finalize,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_PCIE_DEVICE },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
hw/virtio/virtio-md-pci.c +1 -1
index 9ec50676626..9278b32cf84 100644
@@ -138,7 +138,7 @@ static const TypeInfo virtio_md_pci_info = {
     .instance_size = sizeof(VirtIOMDPCI),
     .class_size = sizeof(VirtIOMDPCIClass),
     .abstract = true,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_MEMORY_DEVICE },
         { }
     },
hw/virtio/virtio-mem.c +1 -1
index 0e14dd37d6e..a3d1a676e71 100644
@@ -1907,7 +1907,7 @@ static const TypeInfo virtio_mem_info = {
     .instance_finalize = virtio_mem_instance_finalize,
     .class_init = virtio_mem_class_init,
     .class_size = sizeof(VirtIOMEMClass),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_RAM_DISCARD_MANAGER },
         { }
     },
hw/virtio/virtio-pci.c +3 -3
index 95bf7ddd972..0fa8fe49556 100644
@@ -2481,7 +2481,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t)
         .name = t->generic_name,
         .parent = base_type_info.name,
         .class_init = virtio_pci_generic_class_init,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
             { INTERFACE_PCIE_DEVICE },
             { INTERFACE_CONVENTIONAL_PCI_DEVICE },
             { }
@@ -2516,7 +2516,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t)
             .name          = t->non_transitional_name,
             .parent        = base_type_info.name,
             .instance_init = virtio_pci_non_transitional_instance_init,
-            .interfaces = (InterfaceInfo[]) {
+            .interfaces = (const InterfaceInfo[]) {
                 { INTERFACE_PCIE_DEVICE },
                 { INTERFACE_CONVENTIONAL_PCI_DEVICE },
                 { }
@@ -2530,7 +2530,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t)
             .name          = t->transitional_name,
             .parent        = base_type_info.name,
             .instance_init = virtio_pci_transitional_instance_init,
-            .interfaces = (InterfaceInfo[]) {
+            .interfaces = (const InterfaceInfo[]) {
                 /*
                  * Transitional virtio devices work only as Conventional PCI
                  * devices because they require PIO ports.
hw/watchdog/wdt_i6300esb.c +1 -1
index 1536e1fe032..bb8a2766b69 100644
@@ -480,7 +480,7 @@ static const TypeInfo i6300esb_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(I6300State),
     .class_init    = i6300esb_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
hw/xen/xen-bus.c +1 -1
index e6272282cdd..6bd2e546f6b 100644
@@ -399,7 +399,7 @@ static const TypeInfo xen_bus_type_info = {
     .instance_size = sizeof(XenBus),
     .class_size = sizeof(XenBusClass),
     .class_init = xen_bus_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { }
     },
hw/xen/xen-legacy-backend.c +1 -1
index d6fe7d4f3e6..5ed53f8943e 100644
@@ -661,7 +661,7 @@ static const TypeInfo xensysbus_info = {
     .name       = TYPE_XENSYSBUS,
     .parent     = TYPE_BUS,
     .class_init = xen_sysbus_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { }
     }
hw/xen/xen_pt.c +1 -1
index 7f9c351d967..9d16644d82e 100644
@@ -1079,7 +1079,7 @@ static const TypeInfo xen_pci_passthrough_info = {
     .class_init = xen_pci_passthrough_class_init,
     .class_size = sizeof(XenPTDeviceClass),
     .instance_init = xen_pci_passthrough_instance_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { INTERFACE_PCIE_DEVICE },
         { },
hw/xen/xen_pt_graphics.c +1 -1
index 264851ece36..2c0cec97234 100644
@@ -363,7 +363,7 @@ static const TypeInfo isa_bridge_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = isa_bridge_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { },
     },
net/can/can_core.c +1 -1
index e16e15c036e..77fe2b8ba48 100644
@@ -162,7 +162,7 @@ static const TypeInfo can_bus_info = {
     .instance_size = sizeof(CanBusState),
     .instance_init = can_bus_instance_init,
     .class_init = can_bus_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
net/can/can_host.c +1 -1
index ca5fcf1ea12..3f9bb33e474 100644
@@ -92,7 +92,7 @@ static const TypeInfo can_host_info = {
     .class_size = sizeof(CanHostClass),
     .abstract = true,
     .class_init = can_host_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
net/colo-compare.c +1 -1
index 425eb6e9718..0e1844ee4cb 100644
@@ -1476,7 +1476,7 @@ static const TypeInfo colo_compare_info = {
     .instance_finalize = colo_compare_finalize,
     .class_size = sizeof(CompareClass),
     .class_init = colo_compare_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
net/filter.c +1 -1
index 03b3c793f76..c7cc6615dc9 100644
@@ -363,7 +363,7 @@ static const TypeInfo netfilter_info = {
     .instance_size = sizeof(NetFilterState),
     .instance_init = netfilter_init,
     .instance_finalize = netfilter_finalize,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
scsi/pr-manager.c +1 -1
index 1977d99ce0d..40e1210eb21 100644
@@ -77,7 +77,7 @@ static const TypeInfo pr_manager_info = {
     .name = TYPE_PR_MANAGER,
     .class_size = sizeof(PRManagerClass),
     .abstract = true,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
system/qtest.c +1 -1
index b7689088a49..ade3eb32212 100644
@@ -1012,7 +1012,7 @@ static const TypeInfo qtest_info = {
     .parent = TYPE_OBJECT,
     .class_init = qtest_class_init,
     .instance_size = sizeof(QTest),
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
target/i386/sev.c +1 -1
index 7ef4801d5fb..7ee700d6a35 100644
@@ -2089,7 +2089,7 @@ static const TypeInfo sev_common_info = {
     .class_size = sizeof(SevCommonStateClass),
     .class_init = sev_common_class_init,
     .abstract = true,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
target/ppc/cpu_init.c +1 -1
index 90b21b9c930..aed9e265992 100644
@@ -7570,7 +7570,7 @@ static const TypeInfo ppc_cpu_type_info = {
     .class_size = sizeof(PowerPCCPUClass),
     .class_init = ppc_cpu_class_init,
 #ifndef CONFIG_USER_ONLY
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
           { TYPE_INTERRUPT_STATS_PROVIDER },
           { }
     },
tests/unit/check-qom-interface.c +1 -1
index 4e1c4d67297..86ae5f6c3b1 100644
@@ -52,7 +52,7 @@ static const TypeInfo direct_impl_info = {
     .name = TYPE_DIRECT_IMPL,
     .parent = TYPE_OBJECT,
     .class_init = test_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_TEST_IF },
         { }
     }
tests/unit/check-qom-proplist.c +1 -1
index f1de1618f60..ee3c6fb32b1 100644
@@ -164,7 +164,7 @@ static const TypeInfo dummy_info = {
     .instance_finalize = dummy_finalize,
     .class_size = sizeof(DummyObjectClass),
     .class_init = dummy_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
ui/dbus.c +1 -1
index 0c0f86eaa6f..dd0336702de 100644
@@ -514,7 +514,7 @@ static const TypeInfo dbus_display_info = {
     .instance_init = dbus_display_init,
     .instance_finalize = dbus_display_finalize,
     .class_init = dbus_display_class_init,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
ui/input-barrier.c +1 -1
index 9dce31ea9a7..9793258aac1 100644
@@ -732,7 +732,7 @@ static const TypeInfo input_barrier_info = {
     .instance_size = sizeof(InputBarrier),
     .instance_init = input_barrier_instance_init,
     .instance_finalize = input_barrier_instance_finalize,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
ui/input-linux.c +1 -1
index 2f5adb82d24..92e1a1aa64a 100644
@@ -522,7 +522,7 @@ static const TypeInfo input_linux_info = {
     .instance_size = sizeof(InputLinux),
     .instance_init = input_linux_instance_init,
     .instance_finalize = input_linux_instance_finalize,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
util/thread-context.c +1 -1
index 95228a3d4f6..0146154fa56 100644
@@ -319,7 +319,7 @@ static const TypeInfo thread_context_info = {
     .instance_size = sizeof(ThreadContext),
     .instance_init = thread_context_instance_init,
     .instance_finalize = thread_context_instance_finalize,
-    .interfaces = (InterfaceInfo[]) {
+    .interfaces = (const InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
         { }
     }
hw/display/apple-gfx-pci.m +1 -1
index 2f0d24f7fee..b0694f4cb85 100644
@@ -147,7 +147,7 @@ static void apple_gfx_pci_class_init(ObjectClass *klass, const void *data)
         .instance_size = sizeof(AppleGFXPCIState),
         .class_init    = apple_gfx_pci_class_init,
         .instance_init = apple_gfx_pci_init,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
             { INTERFACE_PCIE_DEVICE },
             { },
         },
scripts/codeconverter/codeconverter/test_regexps.py +5 -5
index 08857c5008d..4526268ae80 100644
@@ -77,8 +77,8 @@ def fullmatch(regexp, s):
     assert fullmatch(RE_ARRAY_ITEM, '{ TYPE_HOTPLUG_HANDLER },')
     assert fullmatch(RE_ARRAY_ITEM, '{ TYPE_ACPI_DEVICE_IF },')
     assert fullmatch(RE_ARRAY_ITEM, '{ }')
-    assert fullmatch(RE_ARRAY_CAST, '(InterfaceInfo[])')
-    assert fullmatch(RE_ARRAY, '''(InterfaceInfo[]) {
+    assert fullmatch(RE_ARRAY_CAST, '(const InterfaceInfo[])')
+    assert fullmatch(RE_ARRAY, '''(const InterfaceInfo[]) {
             { TYPE_HOTPLUG_HANDLER },
             { TYPE_ACPI_DEVICE_IF },
             { }
@@ -98,7 +98,7 @@ def fullmatch(regexp, s):
         .parent = TYPE_DEVICE,
         .instance_size = sizeof(CRBState),
         .class_init  = tpm_crb_class_init,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
             { TYPE_TPM_IF },
             { }
         }
@@ -134,7 +134,7 @@ def fullmatch(regexp, s):
         .instance_size = sizeof(AcpiGedState),
         .instance_init  = acpi_ged_initfn,
         .class_init    = acpi_ged_class_init,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
             { TYPE_HOTPLUG_HANDLER },
             { TYPE_ACPI_DEVICE_IF },
             { }
@@ -164,7 +164,7 @@ def fullmatch(regexp, s):
         .parent = TYPE_DEVICE,
         .instance_size = sizeof(CRBState),
         .class_init  = tpm_crb_class_init,
-        .interfaces = (InterfaceInfo[]) {
+        .interfaces = (const InterfaceInfo[]) {
             { TYPE_TPM_IF },
             { }
         }
Signature · 1 line
2.47.1
#14 lore raw

[PULL 34/58] system/memory: Remove DEVICE_HOST_ENDIAN definition

In reply to Philippe Mathieu-Daudé

Since the previous commit ("exec/memory.h: make devend_memop "target defines" agnostic") there is a single use of the DEVICE_HOST_ENDIAN definition in ram_device_mem_ops: inline it and remove its definition altogether.

Message-Id: <[email protected]>

---
 include/exec/cpu-common.h | 6 ------
 system/memory-internal.h  | 3 ---
 system/memory.c           | 2 +-
 3 files changed, 1 insertion(+), 10 deletions(-)
include/exec/cpu-common.h +0 -6
index 9b83fd7ac88..dab1e7e5809 100644
@@ -44,12 +44,6 @@ enum device_endian {
     DEVICE_LITTLE_ENDIAN,
 };
 
-#if HOST_BIG_ENDIAN
-#define DEVICE_HOST_ENDIAN DEVICE_BIG_ENDIAN
-#else
-#define DEVICE_HOST_ENDIAN DEVICE_LITTLE_ENDIAN
-#endif
-
 /* address in the RAM (different from a physical address) */
 #if defined(CONFIG_XEN_BACKEND)
 typedef uint64_t ram_addr_t;
system/memory-internal.h +0 -3
index 29717b3c58f..46f758fa7e4 100644
@@ -41,9 +41,6 @@ void mtree_print_dispatch(struct AddressSpaceDispatch *d,
 /* returns true if end is big endian. */
 static inline bool devend_big_endian(enum device_endian end)
 {
-    QEMU_BUILD_BUG_ON(DEVICE_HOST_ENDIAN != DEVICE_LITTLE_ENDIAN &&
-                      DEVICE_HOST_ENDIAN != DEVICE_BIG_ENDIAN);
-
     if (end == DEVICE_NATIVE_ENDIAN) {
         return target_big_endian();
     }
system/memory.c +1 -1
index 67e433095b4..71434e7ad02 100644
@@ -1382,7 +1382,7 @@ static void memory_region_ram_device_write(void *opaque, hwaddr addr,
 static const MemoryRegionOps ram_device_mem_ops = {
     .read = memory_region_ram_device_read,
     .write = memory_region_ram_device_write,
-    .endianness = DEVICE_HOST_ENDIAN,
+    .endianness = HOST_BIG_ENDIAN ? DEVICE_BIG_ENDIAN : DEVICE_LITTLE_ENDIAN,
     .valid = {
         .min_access_size = 1,
         .max_access_size = 8,
Signature · 1 line
2.47.1
#15 lore raw

[PULL 04/58] cpus: Introduce CPUClass::list_cpus() callback

In reply to Philippe Mathieu-Daudé

Some targets define cpu_list to a method listing their CPUs on stdout. In order to make list_cpus() generic, introduce the CPUClass::list_cpus() callback. When no callback is registered, list_cpus() defaults to the cpu_list definition.

Message-Id: <[email protected]>

---
 include/hw/core/cpu.h | 2 ++
 cpu-target.c          | 8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
include/hw/core/cpu.h +2 -0
index c8d6abff19a..5b645df59f5 100644
@@ -102,6 +102,7 @@ struct SysemuCPUOps;
  * CPUClass:
  * @class_by_name: Callback to map -cpu command line model name to an
  *                 instantiatable CPU type.
+ * @list_cpus: list available CPU models and flags.
  * @parse_features: Callback to parse command line arguments.
  * @reset_dump_flags: #CPUDumpFlags to use for reset logging.
  * @memory_rw_debug: Callback for GDB memory access.
@@ -148,6 +149,7 @@ struct CPUClass {
     /*< public >*/
 
     ObjectClass *(*class_by_name)(const char *cpu_model);
+    void (*list_cpus)(void);
     void (*parse_features)(const char *typename, char *str, Error **errp);
 
     int (*memory_rw_debug)(CPUState *cpu, vaddr addr,
cpu-target.c +7 -1
index 14cd623bffe..d139a18f5b1 100644
@@ -104,7 +104,13 @@ static void cpu_list(void)
 
 void list_cpus(void)
 {
-    cpu_list();
+    CPUClass *cc = CPU_CLASS(object_class_by_name(CPU_RESOLVING_TYPE));
+
+    if (cc->list_cpus) {
+        cc->list_cpus();
+    } else {
+        cpu_list();
+    }
 }
 
 /* enable or disable single step mode. EXCP_DEBUG is returned by the
Signature · 1 line
2.47.1
#16 lore raw

[PULL 29/58] hw/intc/i8259: Remove unused DEBUG_PIC define

In reply to Philippe Mathieu-Daudé

From: BALATON Zoltan <[email protected]>

The debug printfs were converted to traces so this define is now unused.

Fixes 0880a87300 (i8259: convert DPRINTFs into trace)

Message-ID: <[email protected]>

---
 hw/intc/i8259.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
hw/intc/i8259.c +1 -4
index 2359dd82534..b6f96bf208c 100644
@@ -32,10 +32,7 @@
 #include "trace.h"
 #include "qom/object.h"
 
-/* debug PIC */
-//#define DEBUG_PIC
-
-//#define DEBUG_IRQ_LATENCY
+/*#define DEBUG_IRQ_LATENCY*/
 
 #define TYPE_I8259 "isa-i8259"
 typedef struct PICClass PICClass;
Signature · 1 line
2.47.1
#17 lore raw

[PULL 35/58] system/datadir: Add new type constant for DTB files

In reply to Philippe Mathieu-Daudé

From: BALATON Zoltan <[email protected]>

Currently DTB files are mixed with ROMs under BIOS type. Separate them under a new type constant and turn defines into an enum while at it.

Message-ID: <ae793d1f81e3577605759c43871722324a1ef2cb.1745402140.git.balaton@eik.bme.hu>

---
 include/qemu/datadir.h | 11 ++++++++---
 hw/microblaze/boot.c   |  2 +-
 hw/ppc/ppc440_bamboo.c |  2 +-
 hw/ppc/sam460ex.c      |  2 +-
 hw/ppc/virtex_ml507.c  |  2 +-
 system/datadir.c       |  3 ++-
 6 files changed, 14 insertions(+), 8 deletions(-)
include/qemu/datadir.h +8 -3
index 21f9097f582..cca32af3008 100644
@@ -1,11 +1,16 @@
 #ifndef QEMU_DATADIR_H
 #define QEMU_DATADIR_H
 
-#define QEMU_FILE_TYPE_BIOS   0
-#define QEMU_FILE_TYPE_KEYMAP 1
+typedef enum {
+    QEMU_FILE_TYPE_BIOS,
+    QEMU_FILE_TYPE_DTB,
+    QEMU_FILE_TYPE_KEYMAP,
+} QemuFileType;
+
 /**
  * qemu_find_file:
  * @type: QEMU_FILE_TYPE_BIOS (for BIOS, VGA BIOS)
+ *        QEMU_FILE_TYPE_DTB (for device tree blobs)
  *        or QEMU_FILE_TYPE_KEYMAP (for keymaps).
  * @name: Relative or absolute file name
  *
@@ -20,7 +25,7 @@
  *
  * Returns: a path that can access @name, or NULL if no matching file exists.
  */
-char *qemu_find_file(int type, const char *name);
+char *qemu_find_file(QemuFileType type, const char *name);
 void qemu_add_default_firmwarepath(void);
 void qemu_add_data_dir(char *path);
 void qemu_list_data_dirs(void);
hw/microblaze/boot.c +1 -1
index 60b4ef0abe7..4a9c9df3181 100644
@@ -130,7 +130,7 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, bool is_little_endian,
     dtb_arg = current_machine->dtb;
     /* default to pcbios dtb as passed by machine_init */
     if (!dtb_arg && dtb_filename) {
-        filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, dtb_filename);
+        filename = qemu_find_file(QEMU_FILE_TYPE_DTB, dtb_filename);
     }
 
     boot_info.machine_cpu_reset = machine_cpu_reset;
hw/ppc/ppc440_bamboo.c +1 -1
index 099fda39092..6fff0d8afbc 100644
@@ -64,7 +64,7 @@ static int bamboo_load_device_tree(MachineState *machine,
     uint32_t tb_freq = 400000000;
     uint32_t clock_freq = 400000000;
 
-    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
+    filename = qemu_find_file(QEMU_FILE_TYPE_DTB, BINARY_DEVICE_TREE_FILE);
     if (!filename) {
         return -1;
     }
hw/ppc/sam460ex.c +1 -1
index a070de23cf2..ee31bd8f349 100644
@@ -142,7 +142,7 @@ static int sam460ex_load_device_tree(MachineState *machine,
     uint32_t clock_freq = CPU_FREQ;
     int offset;
 
-    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
+    filename = qemu_find_file(QEMU_FILE_TYPE_DTB, BINARY_DEVICE_TREE_FILE);
     if (!filename) {
         error_report("Couldn't find dtb file `%s'", BINARY_DEVICE_TREE_FILE);
         exit(1);
hw/ppc/virtex_ml507.c +1 -1
index 17115be74d5..c9969ae48a8 100644
@@ -146,7 +146,7 @@ static int xilinx_load_device_tree(MachineState *machine,
         /* Try the local "ppc.dtb" override.  */
         fdt = load_device_tree("ppc.dtb", &fdt_size);
         if (!fdt) {
-            path = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
+            path = qemu_find_file(QEMU_FILE_TYPE_DTB, BINARY_DEVICE_TREE_FILE);
             if (path) {
                 fdt = load_device_tree(path, &fdt_size);
                 g_free(path);
system/datadir.c +2 -1
index c9237cb5d4a..e450b84ce91 100644
@@ -30,7 +30,7 @@
 static const char *data_dir[16];
 static int data_dir_idx;
 
-char *qemu_find_file(int type, const char *name)
+char *qemu_find_file(QemuFileType type, const char *name)
 {
     int i;
     const char *subdir;
@@ -44,6 +44,7 @@ char *qemu_find_file(int type, const char *name)
 
     switch (type) {
     case QEMU_FILE_TYPE_BIOS:
+    case QEMU_FILE_TYPE_DTB:
         subdir = "";
         break;
     case QEMU_FILE_TYPE_KEYMAP:
Signature · 1 line
2.47.1
#18 lore raw

[PULL 23/58] target/arm: Handle AArch64 gdb read/write regs in TYPE_ARM_CPU

In reply to Philippe Mathieu-Daudé

From: Peter Maydell <[email protected]>

Instead of having the TYPE_AARCH64_CPU subclass set CPUClass::gdb_read_register and ::gdb_write_register to different methods from those of the TYPE_ARM_CPU parent class, have the TYPE_ARM_CPU methods handle either AArch32 or AArch64 at runtime.

Message-ID: <[email protected]>

---
 target/arm/cpu64.c   |  5 -----
 target/arm/gdbstub.c | 12 ++++++++++++
 2 files changed, 12 insertions(+), 5 deletions(-)
target/arm/cpu64.c +0 -5
index 5135ef63cb2..00629a5d1d1 100644
@@ -815,11 +815,6 @@ static void aarch64_cpu_finalizefn(Object *obj)
 
 static void aarch64_cpu_class_init(ObjectClass *oc, const void *data)
 {
-    CPUClass *cc = CPU_CLASS(oc);
-
-    cc->gdb_read_register = aarch64_cpu_gdb_read_register;
-    cc->gdb_write_register = aarch64_cpu_gdb_write_register;
-
     object_class_property_add_bool(oc, "aarch64", aarch64_cpu_get_aarch64,
                                    aarch64_cpu_set_aarch64);
     object_class_property_set_description(oc, "aarch64",
target/arm/gdbstub.c +12 -0
index 30068c22627..ce4497ad7c3 100644
@@ -44,6 +44,12 @@ int arm_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
     ARMCPU *cpu = ARM_CPU(cs);
     CPUARMState *env = &cpu->env;
 
+#ifdef TARGET_AARCH64
+    if (arm_gdbstub_is_aarch64(cpu)) {
+        return aarch64_cpu_gdb_read_register(cs, mem_buf, n);
+    }
+#endif
+
     if (n < 16) {
         /* Core integer register.  */
         return gdb_get_reg32(mem_buf, env->regs[n]);
@@ -66,6 +72,12 @@ int arm_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
     CPUARMState *env = &cpu->env;
     uint32_t tmp;
 
+#ifdef TARGET_AARCH64
+    if (arm_gdbstub_is_aarch64(cpu)) {
+        return aarch64_cpu_gdb_write_register(cs, mem_buf, n);
+    }
+#endif
+
     tmp = ldl_p(mem_buf);
 
     /*
Signature · 1 line
2.47.1
#19 lore raw

[PULL 30/58] hw/core/loader: Fix type conflict of GLib function pointers

In reply to Philippe Mathieu-Daudé

From: Kohei Tokunaga <[email protected]>

On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_list_sort_with_data and g_slist_sort_with_data should be used instead, as they do not rely on function pointer casting.

Message-ID: <26dfe9191154ca65dca6ef51ce768ad2a0c30d5f.1745295397.git.ktokunaga.mail@gmail.com>

---
 hw/core/loader.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/core/loader.c +2 -2
index a3aa62d132e..b792a54bb02 100644
@@ -1410,7 +1410,7 @@ typedef struct RomSec {
  * work, but this way saves a little work later by avoiding
  * dealing with "gaps" of 0 length.
  */
-static gint sort_secs(gconstpointer a, gconstpointer b)
+static gint sort_secs(gconstpointer a, gconstpointer b, gpointer d)
 {
     RomSec *ra = (RomSec *) a;
     RomSec *rb = (RomSec *) b;
@@ -1463,7 +1463,7 @@ RomGap rom_find_largest_gap_between(hwaddr base, size_t size)
     /* sentinel */
     secs = add_romsec_to_list(secs, base + size, 1);
 
-    secs = g_list_sort(secs, sort_secs);
+    secs = g_list_sort_with_data(secs, sort_secs, NULL);
 
     for (it = g_list_first(secs); it; it = g_list_next(it)) {
         cand = (RomSec *) it->data;
Signature · 1 line
2.47.1
#20 lore raw

[PULL 33/58] system/vl: Fix type conflict of GLib function pointers

In reply to Philippe Mathieu-Daudé

From: Kohei Tokunaga <[email protected]>

On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_list_sort_with_data and g_slist_sort_with_data should be used instead, as they do not rely on function pointer casting.

Message-ID: <e9a50b76c54cc64fc9985186f0aef3fcc2024da6.1745295397.git.ktokunaga.mail@gmail.com>

---
 system/vl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
system/vl.c +2 -2
index c17945c4939..4ab2001df75 100644
@@ -1524,7 +1524,7 @@ static bool debugcon_parse(const char *devname, Error **errp)
     return true;
 }
 
-static gint machine_class_cmp(gconstpointer a, gconstpointer b)
+static gint machine_class_cmp(gconstpointer a, gconstpointer b, gpointer d)
 {
     const MachineClass *mc1 = a, *mc2 = b;
     int res;
@@ -1574,7 +1574,7 @@ static void machine_help_func(const QDict *qdict)
     }
 
     printf("Supported machines are:\n");
-    machines = g_slist_sort(machines, machine_class_cmp);
+    machines = g_slist_sort_with_data(machines, machine_class_cmp, NULL);
     for (el = machines; el; el = el->next) {
         MachineClass *mc = el->data;
         if (mc->alias) {
Signature · 1 line
2.47.1
#21 lore raw

[PULL 38/58] meson: Remove CONFIG_STATX and CONFIG_STATX_MNT_ID

In reply to Philippe Mathieu-Daudé

From: Akihiko Odaki <[email protected]>

CONFIG_STATX and CONFIG_STATX_MNT_ID are not used since commit e0dc2631ec4 ("virtiofsd: Remove source").

Message-ID: <[email protected]>

---
 meson.build | 10 ----------
 1 file changed, 10 deletions(-)
meson.build +0 -10
index f77a9ce569e..35dcec8ce5c 100644
@@ -2191,14 +2191,6 @@ gnu_source_prefix = '''
   #endif
 '''
 
-# Check whether the glibc provides STATX_BASIC_STATS
-
-has_statx = cc.has_header_symbol('sys/stat.h', 'STATX_BASIC_STATS', prefix: gnu_source_prefix)
-
-# Check whether statx() provides mount ID information
-
-has_statx_mnt_id = cc.has_header_symbol('sys/stat.h', 'STATX_MNT_ID', prefix: gnu_source_prefix)
-
 have_vhost_user_blk_server = get_option('vhost_user_blk_server') \
   .require(host_os == 'linux',
            error_message: 'vhost_user_blk_server requires linux') \
@@ -2560,8 +2552,6 @@ config_host_data.set('CONFIG_CRYPTO_SM3', crypto_sm3.found())
 config_host_data.set('CONFIG_HOGWEED', hogweed.found())
 config_host_data.set('CONFIG_QEMU_PRIVATE_XTS', xts == 'private')
 config_host_data.set('CONFIG_MALLOC_TRIM', has_malloc_trim)
-config_host_data.set('CONFIG_STATX', has_statx)
-config_host_data.set('CONFIG_STATX_MNT_ID', has_statx_mnt_id)
 config_host_data.set('CONFIG_ZSTD', zstd.found())
 config_host_data.set('CONFIG_QPL', qpl.found())
 config_host_data.set('CONFIG_UADK', uadk.found())
Signature · 1 line
2.47.1
#22 lore raw

[PULL 03/58] target/i386: Replace MO_TE* -> MO_LE*

In reply to Philippe Mathieu-Daudé

The x86 architecture is only implemented as little-endian. The MO_TE definition always expands to MO_LE.

Replace:
- MO_TEUQ -> MO_LEUQ
- MO_TE -> MO_LE

Message-Id: <[email protected]>

---
 target/i386/tcg/emit.c.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
target/i386/tcg/emit.c.inc +3 -3
index 4e09e96fc13..ca6bc2ea82f 100644
@@ -1813,7 +1813,7 @@ static void gen_CMPXCHG(DisasContext *s, X86DecodedInsn *decode)
 static void gen_CMPXCHG16B(DisasContext *s, X86DecodedInsn *decode)
 {
 #ifdef TARGET_X86_64
-    MemOp mop = MO_TE | MO_128 | MO_ALIGN;
+    MemOp mop = MO_LE | MO_128 | MO_ALIGN;
     TCGv_i64 t0, t1;
     TCGv_i128 cmp, val;
 
@@ -1870,10 +1870,10 @@ static void gen_CMPXCHG8B(DisasContext *s, X86DecodedInsn *decode)
 
     /* Only require atomic with LOCK; non-parallel handled in generator. */
     if (s->prefix & PREFIX_LOCK) {
-        tcg_gen_atomic_cmpxchg_i64(old, s->A0, cmp, val, s->mem_index, MO_TEUQ);
+        tcg_gen_atomic_cmpxchg_i64(old, s->A0, cmp, val, s->mem_index, MO_LEUQ);
     } else {
         tcg_gen_nonatomic_cmpxchg_i64(old, s->A0, cmp, val,
-                                      s->mem_index, MO_TEUQ);
+                                      s->mem_index, MO_LEUQ);
     }
 
     /* Compute the required value of Z. */
Signature · 1 line
2.47.1
#23 lore raw

[PULL 25/58] target/arm: Replace target_ulong -> vaddr for CPUWatchpoint

In reply to Philippe Mathieu-Daudé

CPUWatchpoint::vaddr/len are of type vaddr.

Message-Id: <[email protected]>

---
 target/arm/internals.h   | 9 +++++----
 target/arm/hyp_gdbstub.c | 8 ++++----
 2 files changed, 9 insertions(+), 8 deletions(-)
target/arm/internals.h +5 -4
index 0818de530b2..4d3d84ffebd 100644
@@ -26,6 +26,7 @@
 #define TARGET_ARM_INTERNALS_H
 
 #include "exec/hwaddr.h"
+#include "exec/vaddr.h"
 #include "exec/breakpoint.h"
 #include "hw/registerfields.h"
 #include "tcg/tcg-gvec-desc.h"
@@ -1952,10 +1953,10 @@ bool find_hw_breakpoint(CPUState *cpu, target_ulong pc);
 int insert_hw_breakpoint(target_ulong pc);
 int delete_hw_breakpoint(target_ulong pc);
 
-bool check_watchpoint_in_range(int i, target_ulong addr);
-CPUWatchpoint *find_hw_watchpoint(CPUState *cpu, target_ulong addr);
-int insert_hw_watchpoint(target_ulong addr, target_ulong len, int type);
-int delete_hw_watchpoint(target_ulong addr, target_ulong len, int type);
+bool check_watchpoint_in_range(int i, vaddr addr);
+CPUWatchpoint *find_hw_watchpoint(CPUState *cpu, vaddr addr);
+int insert_hw_watchpoint(vaddr addr, vaddr len, int type);
+int delete_hw_watchpoint(vaddr addr, vaddr len, int type);
 
 /* Return the current value of the system counter in ticks */
 uint64_t gt_get_countervalue(CPUARMState *env);
target/arm/hyp_gdbstub.c +4 -4
index 1e861263b3d..0512d67f8cf 100644
@@ -125,7 +125,7 @@ int delete_hw_breakpoint(target_ulong pc)
  * need to ensure you mask the address as required and set BAS=0xff
  */
 
-int insert_hw_watchpoint(target_ulong addr, target_ulong len, int type)
+int insert_hw_watchpoint(vaddr addr, vaddr len, int type)
 {
     HWWatchpoint wp = {
         .wcr = R_DBGWCR_E_MASK, /* E=1, enable */
@@ -182,7 +182,7 @@ int insert_hw_watchpoint(target_ulong addr, target_ulong len, int type)
     return 0;
 }
 
-bool check_watchpoint_in_range(int i, target_ulong addr)
+bool check_watchpoint_in_range(int i, vaddr addr)
 {
     HWWatchpoint *wp = get_hw_wp(i);
     uint64_t addr_top, addr_bottom = wp->wvr;
@@ -214,7 +214,7 @@ bool check_watchpoint_in_range(int i, target_ulong addr)
  * Delete a breakpoint and shuffle any above down
  */
 
-int delete_hw_watchpoint(target_ulong addr, target_ulong len, int type)
+int delete_hw_watchpoint(vaddr addr, vaddr len, int type)
 {
     int i;
     for (i = 0; i < cur_hw_wps; i++) {
@@ -239,7 +239,7 @@ bool find_hw_breakpoint(CPUState *cpu, target_ulong pc)
     return false;
 }
 
-CPUWatchpoint *find_hw_watchpoint(CPUState *cpu, target_ulong addr)
+CPUWatchpoint *find_hw_watchpoint(CPUState *cpu, vaddr addr)
 {
     int i;
 
Signature · 1 line
2.47.1
#24 lore raw

[PULL 43/58] target/hexagon: Include missing 'accel/tcg/getpc.h'

In reply to Philippe Mathieu-Daudé

Since the macros.h headers call GETPC(), they need to include "accel/tcg/getpc.h", which defines it.

Message-Id: <[email protected]>

---
 target/hexagon/macros.h       | 1 +
 target/hexagon/mmvec/macros.h | 1 +
 2 files changed, 2 insertions(+)
target/hexagon/macros.h +1 -0
index e5eb31e6711..9ba9be408db 100644
@@ -21,6 +21,7 @@
 #include "cpu.h"
 #include "hex_regs.h"
 #include "reg_fields.h"
+#include "accel/tcg/getpc.h"
 
 #define GET_FIELD(FIELD, REGIN) \
     fEXTRACTU_BITS(REGIN, reg_field_info[FIELD].width, \
target/hexagon/mmvec/macros.h +1 -0
index bcd4a1e8973..c1a88392c05 100644
@@ -21,6 +21,7 @@
 #include "qemu/host-utils.h"
 #include "arch.h"
 #include "mmvec/system_ext_mmvec.h"
+#include "accel/tcg/getpc.h"
 
 #ifndef QEMU_GENERATE
 #define VdV      (*(MMVector *restrict)(VdV_void))
Signature · 1 line
2.47.1
#25 lore raw

[PULL 07/58] target/sparc: Register CPUClass:list_cpus

In reply to Philippe Mathieu-Daudé

Register sparc_cpu_list() as CPUClass:list_cpus callback. Reduce its scope and remove the cpu_list definition.

Message-Id: <[email protected]>

---
 target/sparc/cpu.h | 3 ---
 target/sparc/cpu.c | 3 ++-
 2 files changed, 2 insertions(+), 4 deletions(-)
target/sparc/cpu.h +0 -3
index 83ac818933b..37fd1e066e9 100644
@@ -595,7 +595,6 @@ G_NORETURN void cpu_raise_exception_ra(CPUSPARCState *, int, uintptr_t);
 
 /* cpu_init.c */
 void cpu_sparc_set_id(CPUSPARCState *env, unsigned int cpu);
-void sparc_cpu_list(void);
 /* mmu_helper.c */
 bool sparc_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
                         MMUAccessType access_type, int mmu_idx,
@@ -666,8 +665,6 @@ hwaddr cpu_get_phys_page_nofault(CPUSPARCState *env, target_ulong addr,
 
 #define CPU_RESOLVING_TYPE TYPE_SPARC_CPU
 
-#define cpu_list sparc_cpu_list
-
 /* MMU modes definitions */
 #if defined (TARGET_SPARC64)
 #define MMU_USER_IDX   0
target/sparc/cpu.c +2 -1
index f7d231c6f8b..174b76f7624 100644
@@ -580,7 +580,7 @@ static void print_features(uint32_t features, const char *prefix)
     }
 }
 
-void sparc_cpu_list(void)
+static void sparc_cpu_list(void)
 {
     unsigned int i;
 
@@ -1057,6 +1057,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data)
                                        &scc->parent_phases);
 
     cc->class_by_name = sparc_cpu_class_by_name;
+    cc->list_cpus = sparc_cpu_list,
     cc->parse_features = sparc_cpu_parse_features;
     cc->dump_state = sparc_cpu_dump_state;
 #if !defined(TARGET_SPARC64) && !defined(CONFIG_USER_ONLY)
Signature · 1 line
2.47.1
#26 lore raw

[PULL 31/58] hw/net/can: Fix type conflict of GLib function pointers

In reply to Philippe Mathieu-Daudé

From: Kohei Tokunaga <[email protected]>

On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_list_sort_with_data and g_slist_sort_with_data should be used instead, as they do not rely on function pointer casting.

Message-ID: <4d47a75c5768c9a6dc5d8b3504e78837577ad70d.1745295397.git.ktokunaga.mail@gmail.com>

---
 hw/net/can/xlnx-versal-canfd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/net/can/xlnx-versal-canfd.c +2 -2
index 79ccc10098a..3eb111949f8 100644
@@ -1278,7 +1278,7 @@ static void tx_fifo_stamp(XlnxVersalCANFDState *s, uint32_t tb0_regid)
     }
 }
 
-static gint g_cmp_ids(gconstpointer data1, gconstpointer data2)
+static gint g_cmp_ids(gconstpointer data1, gconstpointer data2, gpointer d)
 {
     tx_ready_reg_info *tx_reg_1 = (tx_ready_reg_info *) data1;
     tx_ready_reg_info *tx_reg_2 = (tx_ready_reg_info *) data2;
@@ -1316,7 +1316,7 @@ static GSList *prepare_tx_data(XlnxVersalCANFDState *s)
             temp->can_id = s->regs[reg_num];
             temp->reg_num = reg_num;
             list = g_slist_prepend(list, temp);
-            list = g_slist_sort(list, g_cmp_ids);
+            list = g_slist_sort_with_data(list, g_cmp_ids, NULL);
         }
 
         reg_ready >>= 1;
Signature · 1 line
2.47.1
#27 lore raw

[PULL 28/58] hw/usb/hcd-xhci: Unmap canceled packet

In reply to Philippe Mathieu-Daudé

From: Akihiko Odaki <[email protected]>

When the Stop Endpoint Command is received, packets running asynchronously are canceled and then all packets are cleaned up. Packets running asynchronously hold the DMA mapping so cleaning the packets leak the mapping. Remove the mapping after canceling packets to fix the leak.

Fixes 62c6ae04cf43 ("xhci: Initial xHCI implementation")

Message-ID: <[email protected]>

---
 hw/usb/hcd-xhci.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
hw/usb/hcd-xhci.c +7 -6
index b3785b8ba6c..292c378bfc9 100644
@@ -1187,6 +1187,12 @@ static void xhci_ep_free_xfer(XHCITransfer *xfer)
     g_free(xfer);
 }
 
+static void xhci_xfer_unmap(XHCITransfer *xfer)
+{
+    usb_packet_unmap(&xfer->packet, &xfer->sgl);
+    qemu_sglist_destroy(&xfer->sgl);
+}
+
 static int xhci_ep_nuke_one_xfer(XHCITransfer *t, TRBCCode report)
 {
     int killed = 0;
@@ -1198,6 +1204,7 @@ static int xhci_ep_nuke_one_xfer(XHCITransfer *t, TRBCCode report)
 
     if (t->running_async) {
         usb_cancel_packet(&t->packet);
+        xhci_xfer_unmap(t);
         t->running_async = 0;
         killed = 1;
     }
@@ -1480,12 +1487,6 @@ err:
     return -1;
 }
 
-static void xhci_xfer_unmap(XHCITransfer *xfer)
-{
-    usb_packet_unmap(&xfer->packet, &xfer->sgl);
-    qemu_sglist_destroy(&xfer->sgl);
-}
-
 static void xhci_xfer_report(XHCITransfer *xfer)
 {
     uint32_t edtla = 0;
Signature · 1 line
2.47.1
#28 lore raw

[PULL 49/58] hw/microblaze: Evaluate TARGET_BIG_ENDIAN at compile time

In reply to Philippe Mathieu-Daudé

Rather than evaluating TARGET_BIG_ENDIAN at preprocessing time via #ifdef'ry, do it in C at compile time

Message-Id: <[email protected]>

---
 hw/microblaze/petalogix_ml605_mmu.c | 12 ++++++------
 hw/microblaze/xlnx-zynqmp-pmu.c     | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)
hw/microblaze/petalogix_ml605_mmu.c +6 -6
index c887c7a99ed..bea6b689fd1 100644
@@ -218,12 +218,12 @@ petalogix_ml605_init(MachineState *machine)
 
 static void petalogix_ml605_machine_init(MachineClass *mc)
 {
-#if TARGET_BIG_ENDIAN
-    mc->desc = "PetaLogix linux refdesign for xilinx ml605 (big endian)";
-    mc->deprecation_reason = "big endian support is not tested";
-#else
-    mc->desc = "PetaLogix linux refdesign for xilinx ml605 (little endian)";
-#endif
+    if (TARGET_BIG_ENDIAN) {
+        mc->desc = "PetaLogix linux refdesign for xilinx ml605 (big endian)";
+        mc->deprecation_reason = "big endian support is not tested";
+    } else {
+        mc->desc = "PetaLogix linux refdesign for xilinx ml605 (little endian)";
+    }
     mc->init = petalogix_ml605_init;
 }
 
hw/microblaze/xlnx-zynqmp-pmu.c +6 -6
index ea1430f4081..ed40b5f2e05 100644
@@ -181,12 +181,12 @@ static void xlnx_zynqmp_pmu_init(MachineState *machine)
 
 static void xlnx_zynqmp_pmu_machine_init(MachineClass *mc)
 {
-#if TARGET_BIG_ENDIAN
-    mc->desc = "Xilinx ZynqMP PMU machine (big endian)";
-    mc->deprecation_reason = "big endian support is not tested";
-#else
-    mc->desc = "Xilinx ZynqMP PMU machine (little endian)";
-#endif
+    if (TARGET_BIG_ENDIAN) {
+        mc->desc = "Xilinx ZynqMP PMU machine (big endian)";
+        mc->deprecation_reason = "big endian support is not tested";
+    } else {
+        mc->desc = "Xilinx ZynqMP PMU machine (little endian)";
+    }
     mc->init = xlnx_zynqmp_pmu_init;
 }
 
Signature · 1 line
2.47.1
#29 lore raw

[PULL 47/58] target/xtensa: Evaluate TARGET_BIG_ENDIAN at compile time

In reply to Philippe Mathieu-Daudé

Rather than evaluating TARGET_BIG_ENDIAN at preprocessing time via #ifdef'ry, do it in C at compile time

Message-Id: <[email protected]>

---
 target/xtensa/translate.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
target/xtensa/translate.c +5 -5
index 5ebd4a512c9..2af83c07c2e 100644
@@ -1395,11 +1395,11 @@ static void translate_bbi(DisasContext *dc, const OpcodeArg arg[],
                           const uint32_t par[])
 {
     TCGv_i32 tmp = tcg_temp_new_i32();
-#if TARGET_BIG_ENDIAN
-    tcg_gen_andi_i32(tmp, arg[0].in, 0x80000000u >> arg[1].imm);
-#else
-    tcg_gen_andi_i32(tmp, arg[0].in, 0x00000001u << arg[1].imm);
-#endif
+    if (TARGET_BIG_ENDIAN) {
+        tcg_gen_andi_i32(tmp, arg[0].in, 0x80000000u >> arg[1].imm);
+    } else {
+        tcg_gen_andi_i32(tmp, arg[0].in, 0x00000001u << arg[1].imm);
+    }
     gen_brcondi(dc, par[0], tmp, 0, arg[2].imm);
 }
 
Signature · 1 line
2.47.1
#30 lore raw

[PULL 32/58] contrib/plugins: Fix type conflict of GLib function pointers

In reply to Philippe Mathieu-Daudé

From: Kohei Tokunaga <[email protected]>

On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_list_sort_with_data and g_slist_sort_with_data should be used instead, as they do not rely on function pointer casting.

Message-ID: <0fcddfca16ca8da2bdaa7b2c114476f5b73d032b.1745295397.git.ktokunaga.mail@gmail.com>

---
 contrib/plugins/cache.c     | 12 ++++++------
 contrib/plugins/cflow.c     | 10 +++++-----
 contrib/plugins/hotblocks.c |  4 ++--
 contrib/plugins/hotpages.c  |  4 ++--
 contrib/plugins/howvec.c    |  4 ++--
 contrib/plugins/hwprofile.c |  8 ++++----
 tests/tcg/plugins/mem.c     |  4 ++--
 tests/tcg/plugins/syscall.c |  4 ++--
 8 files changed, 25 insertions(+), 25 deletions(-)
contrib/plugins/cache.c +6 -6
index 7cfd3df249e..56508587d3a 100644
@@ -576,7 +576,7 @@ static void sum_stats(void)
     }
 }
 
-static int dcmp(gconstpointer a, gconstpointer b)
+static int dcmp(gconstpointer a, gconstpointer b, gpointer d)
 {
     InsnData *insn_a = (InsnData *) a;
     InsnData *insn_b = (InsnData *) b;
@@ -584,7 +584,7 @@ static int dcmp(gconstpointer a, gconstpointer b)
     return insn_a->l1_dmisses < insn_b->l1_dmisses ? 1 : -1;
 }
 
-static int icmp(gconstpointer a, gconstpointer b)
+static int icmp(gconstpointer a, gconstpointer b, gpointer d)
 {
     InsnData *insn_a = (InsnData *) a;
     InsnData *insn_b = (InsnData *) b;
@@ -592,7 +592,7 @@ static int icmp(gconstpointer a, gconstpointer b)
     return insn_a->l1_imisses < insn_b->l1_imisses ? 1 : -1;
 }
 
-static int l2_cmp(gconstpointer a, gconstpointer b)
+static int l2_cmp(gconstpointer a, gconstpointer b, gpointer d)
 {
     InsnData *insn_a = (InsnData *) a;
     InsnData *insn_b = (InsnData *) b;
@@ -645,7 +645,7 @@ static void log_top_insns(void)
     InsnData *insn;
 
     miss_insns = g_hash_table_get_values(miss_ht);
-    miss_insns = g_list_sort(miss_insns, dcmp);
+    miss_insns = g_list_sort_with_data(miss_insns, dcmp, NULL);
     g_autoptr(GString) rep = g_string_new("");
     g_string_append_printf(rep, "%s", "address, data misses, instruction\n");
 
@@ -659,7 +659,7 @@ static void log_top_insns(void)
                                insn->l1_dmisses, insn->disas_str);
     }
 
-    miss_insns = g_list_sort(miss_insns, icmp);
+    miss_insns = g_list_sort_with_data(miss_insns, icmp, NULL);
     g_string_append_printf(rep, "%s", "\naddress, fetch misses, instruction\n");
 
     for (curr = miss_insns, i = 0; curr && i < limit; i++, curr = curr->next) {
@@ -676,7 +676,7 @@ static void log_top_insns(void)
         goto finish;
     }
 
-    miss_insns = g_list_sort(miss_insns, l2_cmp);
+    miss_insns = g_list_sort_with_data(miss_insns, l2_cmp, NULL);
     g_string_append_printf(rep, "%s", "\naddress, L2 misses, instruction\n");
 
     for (curr = miss_insns, i = 0; curr && i < limit; i++, curr = curr->next) {
contrib/plugins/cflow.c +5 -5
index 930ecb46fcd..b5e33f25f9b 100644
@@ -98,7 +98,7 @@ static GHashTable *nodes;
 struct qemu_plugin_scoreboard *state;
 
 /* SORT_HOTTEST */
-static gint hottest(gconstpointer a, gconstpointer b)
+static gint hottest(gconstpointer a, gconstpointer b, gpointer d)
 {
     NodeData *na = (NodeData *) a;
     NodeData *nb = (NodeData *) b;
@@ -107,7 +107,7 @@ static gint hottest(gconstpointer a, gconstpointer b)
         na->dest_count == nb->dest_count ? 0 : 1;
 }
 
-static gint exception(gconstpointer a, gconstpointer b)
+static gint exception(gconstpointer a, gconstpointer b, gpointer d)
 {
     NodeData *na = (NodeData *) a;
     NodeData *nb = (NodeData *) b;
@@ -116,7 +116,7 @@ static gint exception(gconstpointer a, gconstpointer b)
         na->early_exit == nb->early_exit ? 0 : 1;
 }
 
-static gint popular(gconstpointer a, gconstpointer b)
+static gint popular(gconstpointer a, gconstpointer b, gpointer d)
 {
     NodeData *na = (NodeData *) a;
     NodeData *nb = (NodeData *) b;
@@ -138,7 +138,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
 {
     g_autoptr(GString) result = g_string_new("collected ");
     GList *data;
-    GCompareFunc sort = &hottest;
+    GCompareDataFunc sort = &hottest;
     int i = 0;
 
     g_mutex_lock(&node_lock);
@@ -162,7 +162,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
         break;
     }
 
-    data = g_list_sort(data, sort);
+    data = g_list_sort_with_data(data, sort, NULL);
 
     for (GList *l = data;
          l != NULL && i < topn;
contrib/plugins/hotblocks.c +2 -2
index f12bfb7a267..98404b68852 100644
@@ -39,7 +39,7 @@ typedef struct {
     unsigned long insns;
 } ExecCount;
 
-static gint cmp_exec_count(gconstpointer a, gconstpointer b)
+static gint cmp_exec_count(gconstpointer a, gconstpointer b, gpointer d)
 {
     ExecCount *ea = (ExecCount *) a;
     ExecCount *eb = (ExecCount *) b;
@@ -79,7 +79,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
     g_string_append_printf(report, "%d entries in the hash table\n",
                            g_hash_table_size(hotblocks));
     counts = g_hash_table_get_values(hotblocks);
-    it = g_list_sort(counts, cmp_exec_count);
+    it = g_list_sort_with_data(counts, cmp_exec_count, NULL);
 
     if (it) {
         g_string_append_printf(report, "pc, tcount, icount, ecount\n");
contrib/plugins/hotpages.c +2 -2
index c6e64937194..9d48ac969eb 100644
@@ -48,7 +48,7 @@ typedef struct {
 static GMutex lock;
 static GHashTable *pages;
 
-static gint cmp_access_count(gconstpointer a, gconstpointer b)
+static gint cmp_access_count(gconstpointer a, gconstpointer b, gpointer d)
 {
     PageCounters *ea = (PageCounters *) a;
     PageCounters *eb = (PageCounters *) b;
@@ -83,7 +83,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
     if (counts && g_list_next(counts)) {
         GList *it;
 
-        it = g_list_sort(counts, cmp_access_count);
+        it = g_list_sort_with_data(counts, cmp_access_count, NULL);
 
         for (i = 0; i < limit && it->next; i++, it = it->next) {
             PageCounters *rec = (PageCounters *) it->data;
contrib/plugins/howvec.c +2 -2
index 2aa9029c3f0..42bddb6566d 100644
@@ -155,7 +155,7 @@ static ClassSelector class_tables[] = {
 static InsnClassExecCount *class_table;
 static int class_table_sz;
 
-static gint cmp_exec_count(gconstpointer a, gconstpointer b)
+static gint cmp_exec_count(gconstpointer a, gconstpointer b, gpointer d)
 {
     InsnExecCount *ea = (InsnExecCount *) a;
     InsnExecCount *eb = (InsnExecCount *) b;
@@ -208,7 +208,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
     counts = g_hash_table_get_values(insns);
     if (counts && g_list_next(counts)) {
         g_string_append_printf(report, "Individual Instructions:\n");
-        counts = g_list_sort(counts, cmp_exec_count);
+        counts = g_list_sort_with_data(counts, cmp_exec_count, NULL);
 
         for (i = 0; i < limit && g_list_next(counts);
              i++, counts = g_list_next(counts)) {
contrib/plugins/hwprofile.c +4 -4
index 2a4cbc47d40..a9838ccc879 100644
@@ -71,7 +71,7 @@ static void plugin_init(void)
     devices = g_hash_table_new(NULL, NULL);
 }
 
-static gint sort_cmp(gconstpointer a, gconstpointer b)
+static gint sort_cmp(gconstpointer a, gconstpointer b, gpointer d)
 {
     DeviceCounts *ea = (DeviceCounts *) a;
     DeviceCounts *eb = (DeviceCounts *) b;
@@ -79,7 +79,7 @@ static gint sort_cmp(gconstpointer a, gconstpointer b)
            eb->totals.reads + eb->totals.writes ? -1 : 1;
 }
 
-static gint sort_loc(gconstpointer a, gconstpointer b)
+static gint sort_loc(gconstpointer a, gconstpointer b, gpointer d)
 {
     IOLocationCounts *ea = (IOLocationCounts *) a;
     IOLocationCounts *eb = (IOLocationCounts *) b;
@@ -126,13 +126,13 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
     if (counts && g_list_next(counts)) {
         GList *it;
 
-        it = g_list_sort(counts, sort_cmp);
+        it = g_list_sort_with_data(counts, sort_cmp, NULL);
 
         while (it) {
             DeviceCounts *rec = (DeviceCounts *) it->data;
             if (rec->detail) {
                 GList *accesses = g_hash_table_get_values(rec->detail);
-                GList *io_it = g_list_sort(accesses, sort_loc);
+                GList *io_it = g_list_sort_with_data(accesses, sort_loc, NULL);
                 const char *prefix = pattern ? "off" : "pc";
                 g_string_append_printf(report, "%s @ 0x%"PRIx64"\n",
                                        rec->name, rec->base);
tests/tcg/plugins/mem.c +2 -2
index d87d6628e09..ca4e8883dd2 100644
@@ -67,7 +67,7 @@ static enum qemu_plugin_mem_rw rw = QEMU_PLUGIN_MEM_RW;
 static GMutex lock;
 static GHashTable *regions;
 
-static gint addr_order(gconstpointer a, gconstpointer b)
+static gint addr_order(gconstpointer a, gconstpointer b, gpointer d)
 {
     RegionInfo *na = (RegionInfo *) a;
     RegionInfo *nb = (RegionInfo *) b;
@@ -94,7 +94,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
     if (do_region_summary) {
         GList *counts = g_hash_table_get_values(regions);
 
-        counts = g_list_sort(counts, addr_order);
+        counts = g_list_sort_with_data(counts, addr_order, NULL);
 
         g_string_printf(out, "Region Base, Reads, Writes, Seen all\n");
 
tests/tcg/plugins/syscall.c +2 -2
index 47aad55fc1b..42801f5c863 100644
@@ -180,7 +180,7 @@ static void print_entry(gpointer val, gpointer user_data)
     qemu_plugin_outs(out);
 }
 
-static gint comp_func(gconstpointer ea, gconstpointer eb)
+static gint comp_func(gconstpointer ea, gconstpointer eb, gpointer d)
 {
     SyscallStats *ent_a = (SyscallStats *) ea;
     SyscallStats *ent_b = (SyscallStats *) eb;
@@ -197,7 +197,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
 
     g_mutex_lock(&lock);
     GList *entries = g_hash_table_get_values(statistics);
-    entries = g_list_sort(entries, comp_func);
+    entries = g_list_sort_with_data(entries, comp_func, NULL);
     qemu_plugin_outs("syscall no.  calls  errors\n");
 
     g_list_foreach(entries, print_entry, NULL);
Signature · 1 line
2.47.1
#31 lore raw

[PULL 19/58] hw/core/cpu: gdb_arch_name string should not be freed

In reply to Philippe Mathieu-Daudé

From: Peter Maydell <[email protected]>

The documentation for the CPUClass::gdb_arch_name method claims that the returned string should be freed with g_free(). This is not
correct: in commit a650683871ba728 we changed this method to instead return a simple constant string, but forgot to update the documentation.

Make the documentation match the new semantics.

Fixes a650683871ba728 ("hw/core/cpu: Return static value with gdb_arch_name()")

Message-ID: <[email protected]>

---
 include/hw/core/cpu.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/hw/core/cpu.h +2 -1
index 5b645df59f5..6ea246514ea 100644
@@ -134,7 +134,8 @@ struct SysemuCPUOps;
  * @gdb_stop_before_watchpoint: Indicates whether GDB expects the CPU to stop
  *           before the insn which triggers a watchpoint rather than after it.
  * @gdb_arch_name: Optional callback that returns the architecture name known
- * to GDB. The caller must free the returned string with g_free.
+ * to GDB. The returned value is expected to be a simple constant string:
+ * the caller will not g_free() it.
  * @disas_set_info: Setup architecture specific components of disassembly info
  * @adjust_watchpoint_address: Perform a target-specific adjustment to an
  * address before attempting to match it against watchpoints.
Signature · 1 line
2.47.1
#32 lore raw

[PULL 18/58] hw/core: Get default_cpu_type calling machine_class_default_cpu_type()

In reply to Philippe Mathieu-Daudé

Since commit 62b4a227a33 the default cpu type can come from the valid_cpu_types[] array. Call the machine_class_default_cpu_type() instead of accessing MachineClass::default_cpu_type field.

Fixes 62b4a227a33 ("hw/core: Add machine_class_default_cpu_type()")

Message-Id: <[email protected]>

---
 hw/core/machine-qmp-cmds.c | 5 +++--
 target/ppc/cpu_init.c      | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
hw/core/machine-qmp-cmds.c +3 -2
index fd8b4e0b44c..9447e345b3c 100644
@@ -73,6 +73,7 @@ MachineInfoList *qmp_query_machines(bool has_compat_props, bool compat_props,
 
     for (el = machines; el; el = el->next) {
         MachineClass *mc = el->data;
+        const char *default_cpu_type = machine_class_default_cpu_type(mc);
         MachineInfo *info;
 
         info = g_malloc0(sizeof(*info));
@@ -91,8 +92,8 @@ MachineInfoList *qmp_query_machines(bool has_compat_props, bool compat_props,
         info->numa_mem_supported = mc->numa_mem_supported;
         info->deprecated = !!mc->deprecation_reason;
         info->acpi = !!object_class_property_find(OBJECT_CLASS(mc), "acpi");
-        if (mc->default_cpu_type) {
-            info->default_cpu_type = g_strdup(mc->default_cpu_type);
+        if (default_cpu_type) {
+            info->default_cpu_type = g_strdup(default_cpu_type);
         }
         if (mc->default_ram_id) {
             info->default_ram_id = g_strdup(mc->default_ram_id);
target/ppc/cpu_init.c +1 -1
index aed9e265992..b0973b6df95 100644
@@ -7082,7 +7082,7 @@ ObjectClass *ppc_cpu_class_by_name(const char *name)
     if (strcmp(name, "max") == 0) {
         MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
         if (mc) {
-            return object_class_by_name(mc->default_cpu_type);
+            return object_class_by_name(machine_class_default_cpu_type(mc));
         }
     }
 #endif
Signature · 1 line
2.47.1
#33 lore raw

[PULL 45/58] accel/kvm: Use target_needs_bswap()

In reply to Philippe Mathieu-Daudé

Check whether we need to swap at runtime using
target_needs_bswap().

Message-Id: <[email protected]>

---
 accel/kvm/kvm-all.c | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)
accel/kvm/kvm-all.c +16 -14
index b8c68c7819a..278a50690c9 100644
@@ -33,6 +33,7 @@
 #include "system/cpus.h"
 #include "system/accel-blocker.h"
 #include "qemu/bswap.h"
+#include "exec/tswap.h"
 #include "system/memory.h"
 #include "system/ram_addr.h"
 #include "qemu/event_notifier.h"
@@ -1318,21 +1319,22 @@ bool kvm_hwpoisoned_mem(void)
 
 static uint32_t adjust_ioeventfd_endianness(uint32_t val, uint32_t size)
 {
-#if HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN
-    /* The kernel expects ioeventfd values in HOST_BIG_ENDIAN
-     * endianness, but the memory core hands them in target endianness.
-     * For example, PPC is always treated as big-endian even if running
-     * on KVM and on PPC64LE.  Correct here.
-     */
-    switch (size) {
-    case 2:
-        val = bswap16(val);
-        break;
-    case 4:
-        val = bswap32(val);
-        break;
+    if (target_needs_bswap()) {
+        /*
+         * The kernel expects ioeventfd values in HOST_BIG_ENDIAN
+         * endianness, but the memory core hands them in target endianness.
+         * For example, PPC is always treated as big-endian even if running
+         * on KVM and on PPC64LE.  Correct here, swapping back.
+         */
+        switch (size) {
+        case 2:
+            val = bswap16(val);
+            break;
+        case 4:
+            val = bswap32(val);
+            break;
+        }
     }
-#endif
     return val;
 }
 
Signature · 1 line
2.47.1
#34 lore raw

[PULL 58/58] qemu: Convert target_name() to TargetInfo API

In reply to Philippe Mathieu-Daudé

Have target_name() be a target-agnostic method, dispatching to a per-target TargetInfo singleton structure.
By default a stub singleton is used. No logical change expected.

Message-Id: <[email protected]>

---
 MAINTAINERS                     |  9 +++++++--
 meson.build                     |  1 +
 include/hw/core/cpu.h           |  2 --
 include/qemu/target-info-impl.h | 26 ++++++++++++++++++++++++++
 include/qemu/target-info.h      |  7 +++++++
 cpu-target.c                    |  5 -----
 hw/core/machine-qmp-cmds.c      |  1 +
 plugins/loader.c                |  2 +-
 system/vl.c                     |  2 +-
 target-info-stub.c              | 10 ++++++++++
 target-info.c                   | 16 ++++++++++++++++
 11 files changed, 70 insertions(+), 11 deletions(-)
 create mode 100644 include/qemu/target-info-impl.h
 create mode 100644 target-info.c
MAINTAINERS +7 -2
index 59d97128199..f8fee87c704 100644
@@ -496,7 +496,6 @@ F: include/exec/cpu*.h
 F: include/exec/exec-all.h
 F: include/exec/target_long.h
 F: include/qemu/accel.h
-F: include/qemu/target-info*.h
 F: include/system/accel-*.h
 F: include/system/cpus.h
 F: include/accel/accel-cpu*.h
@@ -505,7 +504,6 @@ F: accel/Makefile.objs
 F: accel/stubs/Makefile.objs
 F: cpu-common.c
 F: cpu-target.c
-F: target-info*.c
 F: system/cpus.c
 
 Apple Silicon HVF CPUs
@@ -1928,6 +1926,13 @@ F: tests/functional/test_empty_cpu_model.py
 F: tests/unit/test-smp-parse.c
 T: git https://gitlab.com/ehabkost/qemu.git machine-next
 
+TargetInfo API
+M: Pierrick Bouvier <[email protected]>
+M: Philippe Mathieu-Daudé <[email protected]>
+S: Supported
+F: include/qemu/target-info*.h
+F: target-info*.c
+
 Xtensa Machines
 ---------------
 sim
meson.build +1 -0
index 185c2fb0d1b..8ae70dbe45a 100644
@@ -3795,6 +3795,7 @@ endif
 common_ss.add(pagevary)
 specific_ss.add(files('page-target.c', 'page-vary-target.c'))
 
+common_ss.add(files('target-info.c'))
 specific_ss.add(files('target-info-stub.c'))
 
 subdir('backends')
include/hw/core/cpu.h +0 -2
index 2a02d4f0789..12b2ff1f7d2 100644
@@ -1121,8 +1121,6 @@ bool cpu_exec_realizefn(CPUState *cpu, Error **errp);
 void cpu_exec_unrealizefn(CPUState *cpu);
 void cpu_exec_reset_hold(CPUState *cpu);
 
-const char *target_name(void);
-
 #ifdef COMPILING_PER_TARGET
 
 extern const VMStateDescription vmstate_cpu_common;
include/qemu/target-info-impl.h new file +26 -0
new file mode 100644
index 00000000000..d30805f7f28
@@ -0,0 +1,26 @@
+/*
+ * QEMU TargetInfo structure definition
+ *
+ *  Copyright (c) Linaro
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef QEMU_TARGET_INFO_IMPL_H
+#define QEMU_TARGET_INFO_IMPL_H
+
+#include "qemu/target-info.h"
+
+typedef struct TargetInfo {
+    /* runtime equivalent of TARGET_NAME definition */
+    const char *target_name;
+} TargetInfo;
+
+/**
+ * target_info:
+ *
+ * Returns: The TargetInfo structure definition for this target binary.
+ */
+const TargetInfo *target_info(void);
+
+#endif
include/qemu/target-info.h +7 -0
index b4cc4888cac..58d41368974 100644
@@ -9,6 +9,13 @@
 #ifndef QEMU_TARGET_INFO_H
 #define QEMU_TARGET_INFO_H
 
+/**
+ * target_name:
+ *
+ * Returns: Canonical target name (i.e. "i386").
+ */
+const char *target_name(void);
+
 /**
  * target_cpu_type:
  *
cpu-target.c +0 -5
index b5645ff0dbb..1c90a307593 100644
@@ -91,8 +91,3 @@ bool target_big_endian(void)
 {
     return TARGET_BIG_ENDIAN;
 }
-
-const char *target_name(void)
-{
-    return TARGET_NAME;
-}
hw/core/machine-qmp-cmds.c +1 -0
index a5e635152dc..d82043e1c68 100644
@@ -19,6 +19,7 @@
 #include "qapi/qobject-input-visitor.h"
 #include "qapi/type-helpers.h"
 #include "qemu/uuid.h"
+#include "qemu/target-info.h"
 #include "qom/qom-qobject.h"
 #include "system/hostmem.h"
 #include "system/hw_accel.h"
plugins/loader.c +1 -1
index 0d6e082e170..8f0d75c9049 100644
@@ -29,7 +29,7 @@
 #include "qemu/xxhash.h"
 #include "qemu/plugin.h"
 #include "qemu/memalign.h"
-#include "hw/core/cpu.h"
+#include "qemu/target-info.h"
 #include "exec/tb-flush.h"
 
 #include "plugin.h"
system/vl.c +1 -1
index 4ab2001df75..520956f4a19 100644
@@ -40,6 +40,7 @@
 #include "qemu/help_option.h"
 #include "qemu/hw-version.h"
 #include "qemu/uuid.h"
+#include "qemu/target-info.h"
 #include "system/reset.h"
 #include "system/runstate.h"
 #include "system/runstate-action.h"
@@ -79,7 +80,6 @@
 #include "hw/block/block.h"
 #include "hw/i386/x86.h"
 #include "hw/i386/pc.h"
-#include "hw/core/cpu.h"
 #include "migration/cpr.h"
 #include "migration/misc.h"
 #include "migration/snapshot.h"
target-info-stub.c +10 -0
index e5d2195e896..773a10188c8 100644
@@ -8,8 +8,18 @@
 
 #include "qemu/osdep.h"
 #include "qemu/target-info.h"
+#include "qemu/target-info-impl.h"
 #include "cpu.h"
 
+static const TargetInfo target_info_stub = {
+    .target_name = TARGET_NAME,
+};
+
+const TargetInfo *target_info(void)
+{
+    return &target_info_stub;
+}
+
 const char *target_cpu_type(void)
 {
     return CPU_RESOLVING_TYPE;
target-info.c new file +16 -0
new file mode 100644
index 00000000000..84b18931e7e
@@ -0,0 +1,16 @@
+/*
+ * QEMU target info helpers
+ *
+ *  Copyright (c) Linaro
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/target-info.h"
+#include "qemu/target-info-impl.h"
+
+const char *target_name(void)
+{
+    return target_info()->target_name;
+}
Signature · 1 line
2.47.1
#35 lore raw

[PULL 21/58] target/arm: Handle AArch64 in TYPE_ARM_CPU gdb_arch_name

In reply to Philippe Mathieu-Daudé

From: Peter Maydell <[email protected]>

Instead of having the TYPE_AARCH64_CPU subclass set CPUClass::gdb_arch_name to a different function, make the TYPE_ARM_CPU implementation of the method handle AArch64.

For the moment we make the "is this AArch64?" function test "is the CPU of TYPE_AARCH64_CPU?", so that this produces no behavioural change. When we've moved all the gdbstub related methods across to the base class, we will be able to change this to be "does the CPU have the ARM_FEATURE_AARCH64 feature?".

Message-ID: <[email protected]>

---
 target/arm/internals.h | 6 ++++++
 target/arm/cpu.c       | 3 +++
 target/arm/cpu64.c     | 6 ------
 3 files changed, 9 insertions(+), 6 deletions(-)
target/arm/internals.h +6 -0
index d24acdd672e..08f4bd16791 100644
@@ -1826,6 +1826,12 @@ void aarch64_add_pauth_properties(Object *obj);
 void aarch64_add_sve_properties(Object *obj);
 void aarch64_add_sme_properties(Object *obj);
 
+/* Return true if the gdbstub is presenting an AArch64 CPU */
+static inline bool arm_gdbstub_is_aarch64(ARMCPU *cpu)
+{
+    return object_dynamic_cast(OBJECT(cpu), TYPE_AARCH64_CPU);
+}
+
 /* Read the CONTROL register as the MRS instruction would. */
 uint32_t arm_v7m_mrs_control(CPUARMState *env, uint32_t secure);
 
target/arm/cpu.c +3 -0
index 00577f97eb6..bed0e58f3c0 100644
@@ -2649,6 +2649,9 @@ static const gchar *arm_gdb_arch_name(CPUState *cs)
     ARMCPU *cpu = ARM_CPU(cs);
     CPUARMState *env = &cpu->env;
 
+    if (arm_gdbstub_is_aarch64(cpu)) {
+        return "aarch64";
+    }
     if (arm_feature(env, ARM_FEATURE_IWMMXT)) {
         return "iwmmxt";
     }
target/arm/cpu64.c +0 -6
index eaf5705cdc2..fbb7e7b3d64 100644
@@ -813,11 +813,6 @@ static void aarch64_cpu_finalizefn(Object *obj)
 {
 }
 
-static const gchar *aarch64_gdb_arch_name(CPUState *cs)
-{
-    return "aarch64";
-}
-
 static void aarch64_cpu_class_init(ObjectClass *oc, const void *data)
 {
     CPUClass *cc = CPU_CLASS(oc);
@@ -825,7 +820,6 @@ static void aarch64_cpu_class_init(ObjectClass *oc, const void *data)
     cc->gdb_read_register = aarch64_cpu_gdb_read_register;
     cc->gdb_write_register = aarch64_cpu_gdb_write_register;
     cc->gdb_core_xml_file = "aarch64-core.xml";
-    cc->gdb_arch_name = aarch64_gdb_arch_name;
 
     object_class_property_add_bool(oc, "aarch64", aarch64_cpu_get_aarch64,
                                    aarch64_cpu_set_aarch64);
Signature · 1 line
2.47.1
#36 lore raw

[PULL 37/58] meson: Use has_header_symbol() to check getcpu()

In reply to Philippe Mathieu-Daudé

From: Akihiko Odaki <[email protected]>

The use of gnu_source_prefix in the detection of getcpu() was ineffective because the header file that declares getcpu() when _GNU_SOURCE is defined was not included. Pass sched.h to has_header_symbol() so that the existence of the declaration will be properly checked.

Message-ID: <[email protected]>

---
 meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meson.build +2 -1
index bcb9d39a387..f77a9ce569e 100644
@@ -2635,7 +2635,6 @@ config_host_data.set('CONFIG_CLOCK_ADJTIME', cc.has_function('clock_adjtime'))
 config_host_data.set('CONFIG_DUP3', cc.has_function('dup3'))
 config_host_data.set('CONFIG_FALLOCATE', cc.has_function('fallocate'))
 config_host_data.set('CONFIG_POSIX_FALLOCATE', cc.has_function('posix_fallocate'))
-config_host_data.set('CONFIG_GETCPU', cc.has_function('getcpu', prefix: gnu_source_prefix))
 config_host_data.set('CONFIG_SCHED_GETCPU', cc.has_function('sched_getcpu', prefix: '#include <sched.h>'))
 # Note that we need to specify prefix: here to avoid incorrectly
 # thinking that Windows has posix_memalign()
@@ -2713,6 +2712,8 @@ config_host_data.set('CONFIG_FALLOCATE_ZERO_RANGE',
 config_host_data.set('CONFIG_FIEMAP',
                      cc.has_header('linux/fiemap.h') and
                      cc.has_header_symbol('linux/fs.h', 'FS_IOC_FIEMAP'))
+config_host_data.set('CONFIG_GETCPU',
+                     cc.has_header_symbol('sched.h', 'getcpu', prefix: gnu_source_prefix))
 config_host_data.set('CONFIG_GETRANDOM',
                      cc.has_function('getrandom') and
                      cc.has_header_symbol('sys/random.h', 'GRND_NONBLOCK'))
Signature · 1 line
2.47.1
#37 lore raw

[PULL 20/58] gdbstub: Allow gdb_core_xml_file to be set at runtime

In reply to Philippe Mathieu-Daudé

From: Peter Maydell <[email protected]>

Currently the CPUClass:gdb_core_xml_file setting is a simple 'const char *' which the CPU class must set to a fixed string. Allow the CPU class to instead set a new method gdb_get_core_xml_file() which returns this string.

This will allow Arm CPUs to use different XML files for AArch32 vs AArch64 without having to have an extra AArch64-specific class type purely to give somewhere to set cc->gdb_core_xml_file differently.

Message-ID: <[email protected]>

---
 include/hw/core/cpu.h |  5 +++++
 gdbstub/gdbstub.c     | 23 +++++++++++++++++++----
 2 files changed, 24 insertions(+), 4 deletions(-)
include/hw/core/cpu.h +5 -0
index 6ea246514ea..2a02d4f0789 100644
@@ -131,6 +131,10 @@ struct SysemuCPUOps;
  * @gdb_num_core_regs: Number of core registers accessible to GDB or 0 to infer
  *                     from @gdb_core_xml_file.
  * @gdb_core_xml_file: File name for core registers GDB XML description.
+ * @gdb_get_core_xml_file: Optional callback that returns the file name for
+ * the core registers GDB XML description. The returned value is expected to
+ * be a simple constant string: the caller will not g_free() it. If this
+ * is NULL then @gdb_core_xml_file will be used instead.
  * @gdb_stop_before_watchpoint: Indicates whether GDB expects the CPU to stop
  *           before the insn which triggers a watchpoint rather than after it.
  * @gdb_arch_name: Optional callback that returns the architecture name known
@@ -166,6 +170,7 @@ struct CPUClass {
 
     const char *gdb_core_xml_file;
     const gchar * (*gdb_arch_name)(CPUState *cpu);
+    const char * (*gdb_get_core_xml_file)(CPUState *cpu);
 
     void (*disas_set_info)(CPUState *cpu, disassemble_info *info);
 
gdbstub/gdbstub.c +19 -4
index 282e13e163f..565f6b33a90 100644
@@ -565,15 +565,30 @@ static void gdb_register_feature(CPUState *cpu, int base_reg,
     g_array_append_val(cpu->gdb_regs, s);
 }
 
+static const char *gdb_get_core_xml_file(CPUState *cpu)
+{
+    CPUClass *cc = cpu->cc;
+
+    /*
+     * The CPU class can provide the XML filename via a method,
+     * or as a simple fixed string field.
+     */
+    if (cc->gdb_get_core_xml_file) {
+        return cc->gdb_get_core_xml_file(cpu);
+    }
+    return cc->gdb_core_xml_file;
+}
+
 void gdb_init_cpu(CPUState *cpu)
 {
     CPUClass *cc = cpu->cc;
     const GDBFeature *feature;
+    const char *xmlfile = gdb_get_core_xml_file(cpu);
 
     cpu->gdb_regs = g_array_new(false, false, sizeof(GDBRegisterState));
 
-    if (cc->gdb_core_xml_file) {
-        feature = gdb_find_static_feature(cc->gdb_core_xml_file);
+    if (xmlfile) {
+        feature = gdb_find_static_feature(xmlfile);
         gdb_register_feature(cpu, 0,
                              cc->gdb_read_register, cc->gdb_write_register,
                              feature);
@@ -1644,7 +1659,7 @@ void gdb_extend_qsupported_features(char *qflags)
 static void handle_query_supported(GArray *params, void *user_ctx)
 {
     g_string_printf(gdbserver_state.str_buf, "PacketSize=%x", MAX_PACKET_LENGTH);
-    if (first_cpu->cc->gdb_core_xml_file) {
+    if (gdb_get_core_xml_file(first_cpu)) {
         g_string_append(gdbserver_state.str_buf, ";qXfer:features:read+");
     }
 
@@ -1701,7 +1716,7 @@ static void handle_query_xfer_features(GArray *params, void *user_ctx)
     }
 
     process = gdb_get_cpu_process(gdbserver_state.g_cpu);
-    if (!gdbserver_state.g_cpu->cc->gdb_core_xml_file) {
+    if (!gdb_get_core_xml_file(gdbserver_state.g_cpu)) {
         gdb_put_packet("");
         return;
     }
Signature · 1 line
2.47.1
#38 lore raw

[PULL 41/58] system/kvm: make functions accessible from common code

In reply to Philippe Mathieu-Daudé

From: Pierrick Bouvier <[email protected]>

Message-ID: <[email protected]>

---
 include/system/kvm.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/system/kvm.h +4 -4
index 18811cad6fd..b690dda1370 100644
@@ -210,6 +210,10 @@ bool kvm_arm_supports_user_irq(void);
 int kvm_on_sigbus_vcpu(CPUState *cpu, int code, void *addr);
 int kvm_on_sigbus(int code, void *addr);
 
+int kvm_check_extension(KVMState *s, unsigned int extension);
+
+int kvm_vm_ioctl(KVMState *s, unsigned long type, ...);
+
 void kvm_flush_coalesced_mmio_buffer(void);
 
 #ifdef COMPILING_PER_TARGET
@@ -237,8 +241,6 @@ static inline int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_t
 
 int kvm_ioctl(KVMState *s, unsigned long type, ...);
 
-int kvm_vm_ioctl(KVMState *s, unsigned long type, ...);
-
 int kvm_vcpu_ioctl(CPUState *cpu, unsigned long type, ...);
 
 /**
@@ -441,8 +443,6 @@ void kvm_arch_update_guest_debug(CPUState *cpu, struct kvm_guest_debug *dbg);
 
 bool kvm_arch_stop_on_emulation_error(CPUState *cpu);
 
-int kvm_check_extension(KVMState *s, unsigned int extension);
-
 int kvm_vm_check_extension(KVMState *s, unsigned int extension);
 
 #define kvm_vm_enable_cap(s, capability, cap_flags, ...)             \
Signature · 1 line
2.47.1
#39 lore raw

[PULL 51/58] qemu: Introduce target_cpu_type()

In reply to Philippe Mathieu-Daudé

Introduce the target_cpu_type() helper to access the CPU_RESOLVING_TYPE target-specific definition from target-agnostic code.

Message-Id: <[email protected]>

---
 MAINTAINERS                |  2 ++
 meson.build                |  2 ++
 include/qemu/target-info.h | 19 +++++++++++++++++++
 target-info-stub.c         | 16 ++++++++++++++++
 4 files changed, 39 insertions(+)
 create mode 100644 include/qemu/target-info.h
 create mode 100644 target-info-stub.c
MAINTAINERS +2 -0
index d82d962f1a4..28b1e9ba443 100644
@@ -496,6 +496,7 @@ F: include/exec/cpu*.h
 F: include/exec/exec-all.h
 F: include/exec/target_long.h
 F: include/qemu/accel.h
+F: include/qemu/target-info*.h
 F: include/system/accel-*.h
 F: include/system/cpus.h
 F: include/accel/accel-cpu-target.h
@@ -504,6 +505,7 @@ F: accel/Makefile.objs
 F: accel/stubs/Makefile.objs
 F: cpu-common.c
 F: cpu-target.c
+F: target-info*.c
 F: system/cpus.c
 
 Apple Silicon HVF CPUs
meson.build +2 -0
index c736a6f4c4b..185c2fb0d1b 100644
@@ -3795,6 +3795,8 @@ endif
 common_ss.add(pagevary)
 specific_ss.add(files('page-target.c', 'page-vary-target.c'))
 
+specific_ss.add(files('target-info-stub.c'))
+
 subdir('backends')
 subdir('disas')
 subdir('migration')
include/qemu/target-info.h new file +19 -0
new file mode 100644
index 00000000000..b4cc4888cac
@@ -0,0 +1,19 @@
+/*
+ * QEMU target info API
+ *
+ *  Copyright (c) Linaro
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef QEMU_TARGET_INFO_H
+#define QEMU_TARGET_INFO_H
+
+/**
+ * target_cpu_type:
+ *
+ * Returns: target CPU base QOM type name (i.e. TYPE_X86_CPU).
+ */
+const char *target_cpu_type(void);
+
+#endif
target-info-stub.c new file +16 -0
new file mode 100644
index 00000000000..e5d2195e896
@@ -0,0 +1,16 @@
+/*
+ * QEMU target info stubs (target specific)
+ *
+ *  Copyright (c) Linaro
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/target-info.h"
+#include "cpu.h"
+
+const char *target_cpu_type(void)
+{
+    return CPU_RESOLVING_TYPE;
+}
Signature · 1 line
2.47.1
#40 lore raw

[PULL 42/58] accel/tcg: Correct list of included headers in tcg-stub.c

In reply to Philippe Mathieu-Daudé

In commit 3549118b498 we moved cpu_loop_exit*() declarations to "exec/cpu-common.h" but neglected to update tcg-stub.c. We missed it because "exec/cpu-common.h" is indirectly pulled in via "exec/exec-all.h" -> "exec/translation-block.h". Include it directly instead of the not necessary "exec/exec-all.h".

Commit bb6cf6f0168 ("accel/tcg: Factor tcg_cpu_reset_hold() out") removed the need for "exec/tb-flush.h", so remote it too.

Fixes 3549118b498 ("exec: Move cpu_loop_foo() functions to 'cpu-common.h'")

Message-Id: <[email protected]>

---
 accel/stubs/tcg-stub.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
accel/stubs/tcg-stub.c +1 -2
index b2b9881bdfb..3b76b8b17c1 100644
@@ -11,8 +11,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "exec/tb-flush.h"
-#include "exec/exec-all.h"
+#include "exec/cpu-common.h"
 
 G_NORETURN void cpu_loop_exit(CPUState *cpu)
 {
Signature · 1 line
2.47.1
#41 lore raw

[PULL 52/58] cpus: Replace CPU_RESOLVING_TYPE -> target_cpu_type()

In reply to Philippe Mathieu-Daudé

Replace the target-specific CPU_RESOLVING_TYPE definition by a call to the target-agnostic target_cpu_type() runtime helper.

Since the big "cpu.h" is not required anymore in tcg-all.c, remove it, using the tinier "cpu-param.h" header.

Message-Id: <[email protected]>

---
 accel/accel-target.c | 6 ++++--
 accel/tcg/tcg-all.c  | 5 +++--
 cpu-target.c         | 7 ++++---
 3 files changed, 11 insertions(+), 7 deletions(-)
accel/accel-target.c +4 -2
index 33a539b4cbb..08d4e450bde 100644
@@ -25,6 +25,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/accel.h"
+#include "qemu/target-info.h"
 
 #include "cpu.h"
 #include "accel/accel-cpu-target.h"
@@ -88,17 +89,18 @@ static void accel_init_cpu_interfaces(AccelClass *ac)
     const char *ac_name; /* AccelClass name */
     char *acc_name;      /* AccelCPUClass name */
     ObjectClass *acc;    /* AccelCPUClass */
+    const char *cpu_resolving_type = target_cpu_type();
 
     ac_name = object_class_get_name(OBJECT_CLASS(ac));
     g_assert(ac_name != NULL);
 
-    acc_name = g_strdup_printf("%s-%s", ac_name, CPU_RESOLVING_TYPE);
+    acc_name = g_strdup_printf("%s-%s", ac_name, cpu_resolving_type);
     acc = object_class_by_name(acc_name);
     g_free(acc_name);
 
     if (acc) {
         object_class_foreach(accel_init_cpu_int_aux,
-                             CPU_RESOLVING_TYPE, false, acc);
+                             cpu_resolving_type, false, acc);
     }
 }
 
accel/tcg/tcg-all.c +3 -2
index 40d73649796..0ce34ac912c 100644
@@ -35,6 +35,7 @@
 #include "qapi/qapi-types-common.h"
 #include "qapi/qapi-builtin-visit.h"
 #include "qemu/units.h"
+#include "qemu/target-info.h"
 #if defined(CONFIG_USER_ONLY)
 #include "hw/qdev-core.h"
 #else
@@ -43,7 +44,7 @@
 #endif
 #include "accel/tcg/cpu-ops.h"
 #include "internal-common.h"
-#include "cpu.h"
+#include "cpu-param.h"
 
 
 struct TCGState {
@@ -89,7 +90,7 @@ static int tcg_init_machine(MachineState *ms)
     unsigned max_threads = 1;
 
 #ifndef CONFIG_USER_ONLY
-    CPUClass *cc = CPU_CLASS(object_class_by_name(CPU_RESOLVING_TYPE));
+    CPUClass *cc = CPU_CLASS(object_class_by_name(target_cpu_type()));
     bool mttcg_supported = cc->tcg_ops->mttcg_supported;
 
     switch (s->mttcg_enabled) {
cpu-target.c +4 -3
index d68cbab5da9..c2dd590d48a 100644
@@ -22,6 +22,7 @@
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/qemu-print.h"
+#include "qemu/target-info.h"
 #include "system/accel-ops.h"
 #include "system/cpus.h"
 #include "exec/cpu-common.h"
@@ -37,7 +38,7 @@ QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) != sizeof(CPUState));
 
 char *cpu_model_from_type(const char *typename)
 {
-    const char *suffix = "-" CPU_RESOLVING_TYPE;
+    g_autofree char *suffix = g_strdup_printf("-%s", target_cpu_type());
 
     if (!object_class_by_name(typename)) {
         return NULL;
@@ -63,7 +64,7 @@ const char *parse_cpu_option(const char *cpu_option)
         exit(1);
     }
 
-    oc = cpu_class_by_name(CPU_RESOLVING_TYPE, model_pieces[0]);
+    oc = cpu_class_by_name(target_cpu_type(), model_pieces[0]);
     if (oc == NULL) {
         error_report("unable to find CPU model '%s'", model_pieces[0]);
         g_strfreev(model_pieces);
@@ -92,7 +93,7 @@ static void cpu_list_entry(gpointer data, gpointer user_data)
 
 void list_cpus(void)
 {
-    CPUClass *cc = CPU_CLASS(object_class_by_name(CPU_RESOLVING_TYPE));
+    CPUClass *cc = CPU_CLASS(object_class_by_name(target_cpu_type()));
 
     if (cc->list_cpus) {
         cc->list_cpus();
Signature · 1 line
2.47.1
#42 lore raw

[PULL 22/58] target/arm: Handle gdb_core_xml_file in TYPE_ARM_CPU

In reply to Philippe Mathieu-Daudé

From: Peter Maydell <[email protected]>

Instead of having the TYPE_AARCH64_CPU subclass set CPUClass:gdb_core_xml_file to a different value from that that TYPE_ARM_CPU uses, implement the gdb_get_core_xml_file method in the TYPE_ARM_CPU class to return either the AArch64 or AArch32 XML file name.

Message-ID: <[email protected]>

---
 target/arm/cpu.c         | 16 +++++++++++++++-
 target/arm/cpu64.c       |  1 -
 target/arm/tcg/cpu-v7m.c |  1 -
 3 files changed, 15 insertions(+), 3 deletions(-)
target/arm/cpu.c +15 -1
index bed0e58f3c0..5e951675c60 100644
@@ -2658,6 +2658,20 @@ static const gchar *arm_gdb_arch_name(CPUState *cs)
     return "arm";
 }
 
+static const char *arm_gdb_get_core_xml_file(CPUState *cs)
+{
+    ARMCPU *cpu = ARM_CPU(cs);
+    CPUARMState *env = &cpu->env;
+
+    if (arm_gdbstub_is_aarch64(cpu)) {
+        return "aarch64-core.xml";
+    }
+    if (arm_feature(env, ARM_FEATURE_M)) {
+        return "arm-m-profile.xml";
+    }
+    return "arm-core.xml";
+}
+
 #ifndef CONFIG_USER_ONLY
 #include "hw/core/sysemu-cpu-ops.h"
 
@@ -2727,6 +2741,7 @@ static void arm_cpu_class_init(ObjectClass *oc, const void *data)
     cc->sysemu_ops = &arm_sysemu_ops;
 #endif
     cc->gdb_arch_name = arm_gdb_arch_name;
+    cc->gdb_get_core_xml_file = arm_gdb_get_core_xml_file;
     cc->gdb_stop_before_watchpoint = true;
     cc->disas_set_info = arm_disas_set_info;
 
@@ -2749,7 +2764,6 @@ static void cpu_register_class_init(ObjectClass *oc, const void *data)
     CPUClass *cc = CPU_CLASS(acc);
 
     acc->info = data;
-    cc->gdb_core_xml_file = "arm-core.xml";
     if (acc->info->deprecation_note) {
         cc->deprecation_note = acc->info->deprecation_note;
     }
target/arm/cpu64.c +0 -1
index fbb7e7b3d64..5135ef63cb2 100644
@@ -819,7 +819,6 @@ static void aarch64_cpu_class_init(ObjectClass *oc, const void *data)
 
     cc->gdb_read_register = aarch64_cpu_gdb_read_register;
     cc->gdb_write_register = aarch64_cpu_gdb_write_register;
-    cc->gdb_core_xml_file = "aarch64-core.xml";
 
     object_class_property_add_bool(oc, "aarch64", aarch64_cpu_get_aarch64,
                                    aarch64_cpu_set_aarch64);
target/arm/tcg/cpu-v7m.c +0 -1
index 7426aac0dc4..b34b6578574 100644
@@ -266,7 +266,6 @@ static void arm_v7m_class_init(ObjectClass *oc, const void *data)
 
     acc->info = data;
     cc->tcg_ops = &arm_v7m_tcg_ops;
-    cc->gdb_core_xml_file = "arm-m-profile.xml";
 }
 
 static const ARMCPUInfo arm_v7m_cpus[] = {
Signature · 1 line
2.47.1
#43 lore raw

[PULL 57/58] accel: Move target-agnostic code from accel-target.c -> accel-common.c

In reply to Philippe Mathieu-Daudé

Various methods of accel-target.c don't use any target-specific knowledge at all and can be built once in the target-agnostic accel-common.c file.

Message-Id: <[email protected]>

---
 accel/accel-common.c | 142 +++++++++++++++++++++++++++++++++++++++++++
 accel/accel-target.c | 129 ---------------------------------------
 accel/meson.build    |   1 +
 3 files changed, 143 insertions(+), 129 deletions(-)
 create mode 100644 accel/accel-common.c
accel/accel-common.c new file +142 -0
new file mode 100644
index 00000000000..4894b98d64a
@@ -0,0 +1,142 @@
+/*
+ * QEMU accel class, components common to system emulation and user mode
+ *
+ * Copyright (c) 2003-2008 Fabrice Bellard
+ * Copyright (c) 2014 Red Hat Inc.
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/accel.h"
+#include "qemu/target-info.h"
+#include "accel/accel-cpu.h"
+#include "accel-internal.h"
+
+/* Lookup AccelClass from opt_name. Returns NULL if not found */
+AccelClass *accel_find(const char *opt_name)
+{
+    char *class_name = g_strdup_printf(ACCEL_CLASS_NAME("%s"), opt_name);
+    AccelClass *ac = ACCEL_CLASS(module_object_class_by_name(class_name));
+    g_free(class_name);
+    return ac;
+}
+
+/* Return the name of the current accelerator */
+const char *current_accel_name(void)
+{
+    AccelClass *ac = ACCEL_GET_CLASS(current_accel());
+
+    return ac->name;
+}
+
+static void accel_init_cpu_int_aux(ObjectClass *klass, void *opaque)
+{
+    CPUClass *cc = CPU_CLASS(klass);
+    AccelCPUClass *accel_cpu = opaque;
+
+    /*
+     * The first callback allows accel-cpu to run initializations
+     * for the CPU, customizing CPU behavior according to the accelerator.
+     *
+     * The second one allows the CPU to customize the accel-cpu
+     * behavior according to the CPU.
+     *
+     * The second is currently only used by TCG, to specialize the
+     * TCGCPUOps depending on the CPU type.
+     */
+    cc->accel_cpu = accel_cpu;
+    if (accel_cpu->cpu_class_init) {
+        accel_cpu->cpu_class_init(cc);
+    }
+    if (cc->init_accel_cpu) {
+        cc->init_accel_cpu(accel_cpu, cc);
+    }
+}
+
+/* initialize the arch-specific accel CpuClass interfaces */
+static void accel_init_cpu_interfaces(AccelClass *ac)
+{
+    const char *ac_name; /* AccelClass name */
+    char *acc_name;      /* AccelCPUClass name */
+    ObjectClass *acc;    /* AccelCPUClass */
+    const char *cpu_resolving_type = target_cpu_type();
+
+    ac_name = object_class_get_name(OBJECT_CLASS(ac));
+    g_assert(ac_name != NULL);
+
+    acc_name = g_strdup_printf("%s-%s", ac_name, cpu_resolving_type);
+    acc = object_class_by_name(acc_name);
+    g_free(acc_name);
+
+    if (acc) {
+        object_class_foreach(accel_init_cpu_int_aux,
+                             cpu_resolving_type, false, acc);
+    }
+}
+
+void accel_init_interfaces(AccelClass *ac)
+{
+    accel_init_ops_interfaces(ac);
+    accel_init_cpu_interfaces(ac);
+}
+
+void accel_cpu_instance_init(CPUState *cpu)
+{
+    if (cpu->cc->accel_cpu && cpu->cc->accel_cpu->cpu_instance_init) {
+        cpu->cc->accel_cpu->cpu_instance_init(cpu);
+    }
+}
+
+bool accel_cpu_common_realize(CPUState *cpu, Error **errp)
+{
+    AccelState *accel = current_accel();
+    AccelClass *acc = ACCEL_GET_CLASS(accel);
+
+    /* target specific realization */
+    if (cpu->cc->accel_cpu
+        && cpu->cc->accel_cpu->cpu_target_realize
+        && !cpu->cc->accel_cpu->cpu_target_realize(cpu, errp)) {
+        return false;
+    }
+
+    /* generic realization */
+    if (acc->cpu_common_realize && !acc->cpu_common_realize(cpu, errp)) {
+        return false;
+    }
+
+    return true;
+}
+
+void accel_cpu_common_unrealize(CPUState *cpu)
+{
+    AccelState *accel = current_accel();
+    AccelClass *acc = ACCEL_GET_CLASS(accel);
+
+    /* generic unrealization */
+    if (acc->cpu_common_unrealize) {
+        acc->cpu_common_unrealize(cpu);
+    }
+}
+
+int accel_supported_gdbstub_sstep_flags(void)
+{
+    AccelState *accel = current_accel();
+    AccelClass *acc = ACCEL_GET_CLASS(accel);
+    if (acc->gdbstub_supported_sstep_flags) {
+        return acc->gdbstub_supported_sstep_flags();
+    }
+    return 0;
+}
+
+static const TypeInfo accel_types[] = {
+    {
+        .name           = TYPE_ACCEL,
+        .parent         = TYPE_OBJECT,
+        .class_size     = sizeof(AccelClass),
+        .instance_size  = sizeof(AccelState),
+        .abstract       = true,
+    },
+};
+
+DEFINE_TYPES(accel_types)
accel/accel-target.c +0 -129

142 lines not on this page · raw message

accel/meson.build +1 -0
index 5eaeb683385..52909314bfa 100644
@@ -1,3 +1,4 @@
+common_ss.add(files('accel-common.c'))
 specific_ss.add(files('accel-target.c'))
 system_ss.add(files('accel-system.c', 'accel-blocker.c'))
 user_ss.add(files('accel-user.c'))
Signature · 1 line
2.47.1
#44 lore raw

[PULL 12/58] qom: Have class_base_init() take a const data argument

In reply to Philippe Mathieu-Daudé

Message-Id: <[email protected]>

---
 include/qom/object.h     | 2 +-
 hw/core/machine.c        | 2 +-
 hw/core/qdev.c           | 2 +-
 hw/pci/pci.c             | 2 +-
 qom/object.c             | 2 +-
 rust/qemu-api/src/qom.rs | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
include/qom/object.h +1 -1
index 9192265db76..7bb14ca7067 100644
@@ -487,7 +487,7 @@ struct TypeInfo
     size_t class_size;
 
     void (*class_init)(ObjectClass *klass, void *data);
-    void (*class_base_init)(ObjectClass *klass, void *data);
+    void (*class_base_init)(ObjectClass *klass, const void *data);
     void *class_data;
 
     InterfaceInfo *interfaces;
hw/core/machine.c +1 -1
index abfcedd4a5f..bbff84855ae 100644
@@ -1243,7 +1243,7 @@ static void machine_class_init(ObjectClass *oc, void *data)
         "Memory size configuration");
 }
 
-static void machine_class_base_init(ObjectClass *oc, void *data)
+static void machine_class_base_init(ObjectClass *oc, const void *data)
 {
     MachineClass *mc = MACHINE_CLASS(oc);
     mc->max_cpus = mc->max_cpus ?: 1;
hw/core/qdev.c +1 -1
index 2745b5e0929..1e0f47cc848 100644
@@ -693,7 +693,7 @@ static void device_finalize(Object *obj)
     g_free(dev->id);
 }
 
-static void device_class_base_init(ObjectClass *class, void *data)
+static void device_class_base_init(ObjectClass *class, const void *data)
 {
     DeviceClass *klass = DEVICE_CLASS(class);
 
hw/pci/pci.c +1 -1
index 2844ec55560..475b97c649e 100644
@@ -2809,7 +2809,7 @@ static void pci_device_class_init(ObjectClass *klass, void *data)
         "access to indirect DMA memory");
 }
 
-static void pci_device_class_base_init(ObjectClass *klass, void *data)
+static void pci_device_class_base_init(ObjectClass *klass, const void *data)
 {
     if (!object_class_is_abstract(klass)) {
         ObjectClass *conventional =
qom/object.c +1 -1
index 01618d06bd8..dfd59502d11 100644
@@ -55,7 +55,7 @@ struct TypeImpl
     size_t instance_align;
 
     void (*class_init)(ObjectClass *klass, void *data);
-    void (*class_base_init)(ObjectClass *klass, void *data);
+    void (*class_base_init)(ObjectClass *klass, const void *data);
 
     void *class_data;
 
rust/qemu-api/src/qom.rs +1 -1
index 34d7bc0ef96..03fe6247ff6 100644
@@ -492,7 +492,7 @@ pub trait ObjectImpl: ObjectType + IsA<Object> {
     /// the effects of copying the contents of the parent's class struct
     /// to the descendants.
     const CLASS_BASE_INIT: Option<
-        unsafe extern "C" fn(klass: *mut ObjectClass, data: *mut c_void),
+        unsafe extern "C" fn(klass: *mut ObjectClass, data: *const c_void),
     > = None;
 
     const TYPE_INFO: TypeInfo = TypeInfo {
Signature · 1 line
2.47.1
#45 lore raw

[PULL 46/58] target/mips: Check CPU endianness at runtime using env_is_bigendian()

In reply to Philippe Mathieu-Daudé

Since CPU endianness can be toggled at runtime before resetting, checking the endianness at build time preprocessing the TARGET_BIG_ENDIAN definition isn't correct. We have to call mips_env_is_bigendian() to get the CPU endianness at runtime.

Message-Id: <[email protected]>

---
 target/mips/tcg/msa_helper.c | 34 ++++++++++++++++------------------
 1 file changed, 16 insertions(+), 18 deletions(-)
target/mips/tcg/msa_helper.c +16 -18
index 14de4a71ff6..e349344647c 100644
@@ -8212,7 +8212,6 @@ void helper_msa_ffint_u_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
 /* Element-by-element access macros */
 #define DF_ELEMENTS(df) (MSA_WRLEN / DF_BITS(df))
 
-#if TARGET_BIG_ENDIAN
 static inline uint64_t bswap16x4(uint64_t x)
 {
     uint64_t m = 0x00ff00ff00ff00ffull;
@@ -8223,7 +8222,6 @@ static inline uint64_t bswap32x2(uint64_t x)
 {
     return ror64(bswap64(x), 32);
 }
-#endif
 
 void helper_msa_ld_b(CPUMIPSState *env, uint32_t wd,
                      target_ulong addr)
@@ -8252,10 +8250,10 @@ void helper_msa_ld_h(CPUMIPSState *env, uint32_t wd,
      */
     d0 = cpu_ldq_le_data_ra(env, addr + 0, ra);
     d1 = cpu_ldq_le_data_ra(env, addr + 8, ra);
-#if TARGET_BIG_ENDIAN
-    d0 = bswap16x4(d0);
-    d1 = bswap16x4(d1);
-#endif
+    if (mips_env_is_bigendian(env)) {
+        d0 = bswap16x4(d0);
+        d1 = bswap16x4(d1);
+    }
     pwd->d[0] = d0;
     pwd->d[1] = d1;
 }
@@ -8273,10 +8271,10 @@ void helper_msa_ld_w(CPUMIPSState *env, uint32_t wd,
      */
     d0 = cpu_ldq_le_data_ra(env, addr + 0, ra);
     d1 = cpu_ldq_le_data_ra(env, addr + 8, ra);
-#if TARGET_BIG_ENDIAN
-    d0 = bswap32x2(d0);
-    d1 = bswap32x2(d1);
-#endif
+    if (mips_env_is_bigendian(env)) {
+        d0 = bswap32x2(d0);
+        d1 = bswap32x2(d1);
+    }
     pwd->d[0] = d0;
     pwd->d[1] = d1;
 }
@@ -8339,10 +8337,10 @@ void helper_msa_st_h(CPUMIPSState *env, uint32_t wd,
     /* Store 8 bytes at a time.  See helper_msa_ld_h. */
     d0 = pwd->d[0];
     d1 = pwd->d[1];
-#if TARGET_BIG_ENDIAN
-    d0 = bswap16x4(d0);
-    d1 = bswap16x4(d1);
-#endif
+    if (mips_env_is_bigendian(env)) {
+        d0 = bswap16x4(d0);
+        d1 = bswap16x4(d1);
+    }
     cpu_stq_le_data_ra(env, addr + 0, d0, ra);
     cpu_stq_le_data_ra(env, addr + 8, d1, ra);
 }
@@ -8360,10 +8358,10 @@ void helper_msa_st_w(CPUMIPSState *env, uint32_t wd,
     /* Store 8 bytes at a time.  See helper_msa_ld_w. */
     d0 = pwd->d[0];
     d1 = pwd->d[1];
-#if TARGET_BIG_ENDIAN
-    d0 = bswap32x2(d0);
-    d1 = bswap32x2(d1);
-#endif
+    if (mips_env_is_bigendian(env)) {
+        d0 = bswap32x2(d0);
+        d1 = bswap32x2(d1);
+    }
     cpu_stq_le_data_ra(env, addr + 0, d0, ra);
     cpu_stq_le_data_ra(env, addr + 8, d1, ra);
 }
Signature · 1 line
2.47.1
#46 lore raw

[PULL 55/58] accel: Include missing 'qemu/accel.h' header in accel-internal.h

In reply to Philippe Mathieu-Daudé

The "qemu/accel.h" header is implicitly pulled in. Include it explicitly in order to avoid when refactoring unrelated headers:

accel/accel-internal.h:13:32: error: unknown type name 'AccelClass'

     13 | void accel_init_ops_interfaces(AccelClass *ac);
        |                                ^

Message-Id: <[email protected]>

---
 accel/accel-internal.h | 2 ++
 1 file changed, 2 insertions(+)
accel/accel-internal.h +2 -0
index 03426aa21ee..d3a4422cbf7 100644
@@ -10,6 +10,8 @@
 #ifndef ACCEL_INTERNAL_H
 #define ACCEL_INTERNAL_H
 
+#include "qemu/accel.h"
+
 void accel_init_ops_interfaces(AccelClass *ac);
 
 #endif /* ACCEL_SYSTEM_H */
Signature · 1 line
2.47.1
#47 lore raw

[PULL 14/58] qom: Constify TypeInfo::class_data

In reply to Philippe Mathieu-Daudé

All callers now correctly expect a const class data.

Message-Id: <[email protected]>

---
 include/qom/object.h                                | 2 +-
 hw/arm/armsse.c                                     | 2 +-
 hw/block/m25p80.c                                   | 2 +-
 hw/isa/vt82c686.c                                   | 4 ++--
 hw/net/e1000.c                                      | 2 +-
 hw/ppc/spapr_cpu_core.c                             | 2 +-
 hw/scsi/megasas.c                                   | 2 +-
 hw/sensor/tmp421.c                                  | 2 +-
 hw/virtio/virtio-pci.c                              | 4 ++--
 qom/object.c                                        | 2 +-
 target/arm/cpu.c                                    | 2 +-
 target/arm/cpu64.c                                  | 2 +-
 target/mips/cpu.c                                   | 2 +-
 target/s390x/cpu_models.c                           | 4 ++--
 target/sparc/cpu.c                                  | 2 +-
 target/xtensa/helper.c                              | 2 +-
 rust/qemu-api/src/qom.rs                            | 2 +-
 scripts/codeconverter/codeconverter/test_regexps.py | 2 +-
 18 files changed, 21 insertions(+), 21 deletions(-)
include/qom/object.h +1 -1
index 2fb86f00a68..42b75d10a43 100644
@@ -488,7 +488,7 @@ struct TypeInfo
 
     void (*class_init)(ObjectClass *klass, const void *data);
     void (*class_base_init)(ObjectClass *klass, const void *data);
-    void *class_data;
+    const void *class_data;
 
     InterfaceInfo *interfaces;
 };
hw/arm/armsse.c +1 -1
index d65a46b8d8d..9403b65ddb5 100644
@@ -1730,7 +1730,7 @@ static void armsse_register_types(void)
             .name = armsse_variants[i].name,
             .parent = TYPE_ARM_SSE,
             .class_init = armsse_class_init,
-            .class_data = (void *)&armsse_variants[i],
+            .class_data = &armsse_variants[i],
         };
         type_register_static(&ti);
     }
hw/block/m25p80.c +1 -1
index 75b9d712518..a5336d92ff9 100644
@@ -1893,7 +1893,7 @@ static void m25p80_register_types(void)
             .name       = known_devices[i].part_name,
             .parent     = TYPE_M25P80,
             .class_init = m25p80_class_init,
-            .class_data = (void *)&known_devices[i],
+            .class_data = &known_devices[i],
         };
         type_register_static(&ti);
     }
hw/isa/vt82c686.c +2 -2
index 80366aaf647..c62afc907b2 100644
@@ -259,7 +259,7 @@ static const TypeInfo vt82c686b_pm_info = {
     .name          = TYPE_VT82C686B_PM,
     .parent        = TYPE_VIA_PM,
     .class_init    = via_pm_class_init,
-    .class_data    = (void *)&vt82c686b_pm_init_info,
+    .class_data    = &vt82c686b_pm_init_info,
 };
 
 static const ViaPMInitInfo vt8231_pm_init_info = {
@@ -272,7 +272,7 @@ static const TypeInfo vt8231_pm_info = {
     .name          = TYPE_VT8231_PM,
     .parent        = TYPE_VIA_PM,
     .class_init    = via_pm_class_init,
-    .class_data    = (void *)&vt8231_pm_init_info,
+    .class_data    = &vt8231_pm_init_info,
 };
 
 
hw/net/e1000.c +1 -1
index d49730f4ad4..13814e84d18 100644
@@ -1770,7 +1770,7 @@ static void e1000_register_types(void)
 
         type_info.name = info->name;
         type_info.parent = TYPE_E1000_BASE;
-        type_info.class_data = (void *)info;
+        type_info.class_data = info;
         type_info.class_init = e1000_class_init;
 
         type_register_static(&type_info);
hw/ppc/spapr_cpu_core.c +1 -1
index b4b926d759a..4952f9bd2cf 100644
@@ -388,7 +388,7 @@ static void spapr_cpu_core_class_init(ObjectClass *oc, const void *data)
 #define DEFINE_SPAPR_CPU_CORE_TYPE(cpu_model) \
     {                                                   \
         .parent = TYPE_SPAPR_CPU_CORE,                  \
-        .class_data = (void *) POWERPC_CPU_TYPE_NAME(cpu_model), \
+        .class_data = POWERPC_CPU_TYPE_NAME(cpu_model), \
         .class_init = spapr_cpu_core_class_init,        \
         .name = SPAPR_CPU_CORE_TYPE_NAME(cpu_model),    \
     }
hw/scsi/megasas.c +1 -1
index ffcabd5a8e9..b024905a01f 100644
@@ -2572,7 +2572,7 @@ static void megasas_register_types(void)
 
         type_info.name = info->name;
         type_info.parent = TYPE_MEGASAS_BASE;
-        type_info.class_data = (void *)info;
+        type_info.class_data = info;
         type_info.class_init = megasas_class_init;
         type_info.interfaces = info->interfaces;
 
hw/sensor/tmp421.c +1 -1
index 263bfa1bbda..3421c440869 100644
@@ -382,7 +382,7 @@ static void tmp421_register_types(void)
             .name       = devices[i].name,
             .parent     = TYPE_TMP421,
             .class_init = tmp421_class_init,
-            .class_data = (void *) &devices[i],
+            .class_data = &devices[i],
         };
         type_register_static(&ti);
     }
hw/virtio/virtio-pci.c +2 -2
index c0fd3db0630..95bf7ddd972 100644
@@ -2497,13 +2497,13 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t)
 
         generic_type_info.parent = base_name;
         generic_type_info.class_init = virtio_pci_base_class_init;
-        generic_type_info.class_data = (void *)t;
+        generic_type_info.class_data = t;
 
         assert(!t->non_transitional_name);
         assert(!t->transitional_name);
     } else {
         base_type_info.class_init = virtio_pci_base_class_init;
-        base_type_info.class_data = (void *)t;
+        base_type_info.class_data = t;
     }
 
     type_register_static(&base_type_info);
qom/object.c +1 -1
index 06d7367032e..425ee2f0ee8 100644
@@ -57,7 +57,7 @@ struct TypeImpl
     void (*class_init)(ObjectClass *klass, const void *data);
     void (*class_base_init)(ObjectClass *klass, const void *data);
 
-    void *class_data;
+    const void *class_data;
 
     void (*instance_init)(Object *obj);
     void (*instance_post_init)(Object *obj);
target/arm/cpu.c +1 -1
index 81257f20fd7..00577f97eb6 100644
@@ -2758,7 +2758,7 @@ void arm_cpu_register(const ARMCPUInfo *info)
         .parent = TYPE_ARM_CPU,
         .instance_init = arm_cpu_instance_init,
         .class_init = info->class_init ?: cpu_register_class_init,
-        .class_data = (void *)info,
+        .class_data = info,
     };
 
     type_info.name = g_strdup_printf("%s-" TYPE_ARM_CPU, info->name);
target/arm/cpu64.c +1 -1
index 1184c92b4c0..eaf5705cdc2 100644
@@ -855,7 +855,7 @@ void aarch64_cpu_register(const ARMCPUInfo *info)
         .parent = TYPE_AARCH64_CPU,
         .instance_init = aarch64_cpu_instance_init,
         .class_init = info->class_init ?: cpu_register_class_init,
-        .class_data = (void *)info,
+        .class_data = info,
     };
 
     type_info.name = g_strdup_printf("%s-" TYPE_ARM_CPU, info->name);
target/mips/cpu.c +1 -1
index 29611a0a1c3..d13361a1507 100644
@@ -626,7 +626,7 @@ static void mips_register_cpudef_type(const struct mips_def_t *def)
         .name = typename,
         .parent = TYPE_MIPS_CPU,
         .class_init = mips_cpu_cpudef_class_init,
-        .class_data = (void *)def,
+        .class_data = def,
     };
 
     type_register_static(&ti);
target/s390x/cpu_models.c +2 -2
index b097ed55d9d..8951f1b36f9 100644
@@ -1072,7 +1072,7 @@ static void register_types(void)
             .instance_init = s390_cpu_model_initfn,
             .instance_finalize = s390_cpu_model_finalize,
             .class_init = s390_base_cpu_model_class_init,
-            .class_data = (void *) &s390_cpu_defs[i],
+            .class_data = &s390_cpu_defs[i],
         };
         char *name = s390_cpu_type_name(s390_cpu_defs[i].name);
         TypeInfo ti = {
@@ -1081,7 +1081,7 @@ static void register_types(void)
             .instance_init = s390_cpu_model_initfn,
             .instance_finalize = s390_cpu_model_finalize,
             .class_init = s390_cpu_model_class_init,
-            .class_data = (void *) &s390_cpu_defs[i],
+            .class_data = &s390_cpu_defs[i],
         };
 
         type_register_static(&ti_base);
target/sparc/cpu.c +1 -1
index 981aa86e0e0..bc753d5f627 100644
@@ -1104,7 +1104,7 @@ static void sparc_register_cpudef_type(const struct sparc_def_t *def)
         .name = typename,
         .parent = TYPE_SPARC_CPU,
         .class_init = sparc_cpu_cpudef_class_init,
-        .class_data = (void *)def,
+        .class_data = def,
     };
 
     type_register_static(&ti);
target/xtensa/helper.c +1 -1
index 04597879815..2d93b45036d 100644
@@ -192,7 +192,7 @@ void xtensa_register_core(XtensaConfigList *node)
     TypeInfo type = {
         .parent = TYPE_XTENSA_CPU,
         .class_init = xtensa_core_class_init,
-        .class_data = (void *)node->config,
+        .class_data = node->config,
     };
 
     xtensa_finalize_config(node->config);
rust/qemu-api/src/qom.rs +1 -1
index f385cb72753..f0a79f96d5e 100644
@@ -513,7 +513,7 @@ pub trait ObjectImpl: ObjectType + IsA<Object> {
         class_size: core::mem::size_of::<Self::Class>(),
         class_init: Some(rust_class_init::<Self>),
         class_base_init: Self::CLASS_BASE_INIT,
-        class_data: core::ptr::null_mut(),
+        class_data: core::ptr::null(),
         interfaces: core::ptr::null_mut(),
     };
 
scripts/codeconverter/codeconverter/test_regexps.py +1 -1
index 72113927960..08857c5008d 100644
@@ -70,7 +70,7 @@ def fullmatch(regexp, s):
             .name = armsse_variants[i].name,
             .parent = TYPE_ARMSSE,
             .class_init = armsse_class_init,
-            .class_data = (void *)&armsse_variants[i],
+            .class_data = &armsse_variants[i],
         };''', re.MULTILINE)
 
     print(RE_ARRAY_ITEM)
Signature · 1 line
2.47.1
#48 lore raw

[PULL 48/58] hw/mips: Evaluate TARGET_BIG_ENDIAN at compile time

In reply to Philippe Mathieu-Daudé

Rather than evaluating TARGET_BIG_ENDIAN at preprocessing time via #ifdef'ry, do it in C at compile time

Message-Id: <[email protected]>

---
 hw/mips/jazz.c    | 11 ++++-------
 hw/mips/malta.c   | 21 ++++++---------------
 hw/mips/mipssim.c | 11 ++++-------
 3 files changed, 14 insertions(+), 29 deletions(-)
hw/mips/jazz.c +4 -7
index cee92e1825e..7fb0b97a388 100644
@@ -59,12 +59,6 @@ enum jazz_model_e {
     JAZZ_PICA61,
 };
 
-#if TARGET_BIG_ENDIAN
-#define BIOS_FILENAME "mips_bios.bin"
-#else
-#define BIOS_FILENAME "mipsel_bios.bin"
-#endif
-
 static void main_cpu_reset(void *opaque)
 {
     MIPSCPU *cpu = opaque;
@@ -168,6 +162,8 @@ static void mips_jazz_init_net(IOMMUMemoryRegion *rc4030_dma_mr,
 static void mips_jazz_init(MachineState *machine,
                            enum jazz_model_e jazz_model)
 {
+    const char *bios_name = TARGET_BIG_ENDIAN ? "mips_bios.bin"
+                                              : "mipsel_bios.bin";
     MemoryRegion *address_space = get_system_memory();
     char *filename;
     int bios_size, n;
@@ -245,7 +241,8 @@ static void mips_jazz_init(MachineState *machine,
     memory_region_add_subregion(address_space, 0xfff00000LL, bios2);
 
     /* load the BIOS image. */
-    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, machine->firmware ?: BIOS_FILENAME);
+    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS,
+                              machine->firmware ?: bios_name);
     if (filename) {
         bios_size = load_image_targphys(filename, 0xfff00000LL,
                                         MAGNUM_BIOS_SIZE);
hw/mips/malta.c +6 -15
index 8e9cea70b13..cbdbb210568 100644
@@ -94,12 +94,6 @@ typedef struct {
     bool display_inited;
 } MaltaFPGAState;
 
-#if TARGET_BIG_ENDIAN
-#define BIOS_FILENAME "mips_bios.bin"
-#else
-#define BIOS_FILENAME "mipsel_bios.bin"
-#endif
-
 #define TYPE_MIPS_MALTA "mips-malta"
 OBJECT_DECLARE_SIMPLE_TYPE(MaltaState, MIPS_MALTA)
 
@@ -383,11 +377,7 @@ static uint64_t malta_fpga_read(void *opaque, hwaddr addr,
 
     /* STATUS Register */
     case 0x00208:
-#if TARGET_BIG_ENDIAN
-        val = 0x00000012;
-#else
-        val = 0x00000010;
-#endif
+        val = TARGET_BIG_ENDIAN ? 0x00000012 : 0x00000010;
         break;
 
     /* JMPRS Register */
@@ -1177,9 +1167,12 @@ void mips_malta_init(MachineState *machine)
         target_long bios_size = FLASH_SIZE;
         /* Load firmware from flash. */
         if (!dinfo) {
+            const char *bios_name = TARGET_BIG_ENDIAN ? "mips_bios.bin"
+                                                        : "mipsel_bios.bin";
+
             /* Load a BIOS image. */
             filename = qemu_find_file(QEMU_FILE_TYPE_BIOS,
-                                      machine->firmware ?: BIOS_FILENAME);
+                                      machine->firmware ?: bios_name);
             if (filename) {
                 bios_size = load_image_targphys(filename, FLASH_ADDRESS,
                                                 BIOS_SIZE);
@@ -1197,8 +1190,7 @@ void mips_malta_init(MachineState *machine)
          * In little endian mode the 32bit words in the bios are swapped,
          * a neat trick which allows bi-endian firmware.
          */
-#if !TARGET_BIG_ENDIAN
-        {
+        if (!TARGET_BIG_ENDIAN) {
             uint32_t *end, *addr;
             const size_t swapsize = MIN(bios_size, 0x3e0000);
             addr = rom_ptr(FLASH_ADDRESS, swapsize);
@@ -1211,7 +1203,6 @@ void mips_malta_init(MachineState *machine)
                 addr++;
             }
         }
-#endif
     }
 
     /*
hw/mips/mipssim.c +4 -7
index b6dabf2893a..e843307b9b6 100644
@@ -46,12 +46,6 @@
 
 #define BIOS_SIZE (4 * MiB)
 
-#if TARGET_BIG_ENDIAN
-#define BIOS_FILENAME "mips_bios.bin"
-#else
-#define BIOS_FILENAME "mipsel_bios.bin"
-#endif
-
 static struct _loaderparams {
     int ram_size;
     const char *kernel_filename;
@@ -143,6 +137,8 @@ mips_mipssim_init(MachineState *machine)
     const char *kernel_filename = machine->kernel_filename;
     const char *kernel_cmdline = machine->kernel_cmdline;
     const char *initrd_filename = machine->initrd_filename;
+    const char *bios_name = TARGET_BIG_ENDIAN ? "mips_bios.bin"
+                                              : "mipsel_bios.bin";
     char *filename;
     MemoryRegion *address_space_mem = get_system_memory();
     MemoryRegion *isa = g_new(MemoryRegion, 1);
@@ -179,7 +175,8 @@ mips_mipssim_init(MachineState *machine)
     /* Map the BIOS / boot exception handler. */
     memory_region_add_subregion(address_space_mem, 0x1fc00000LL, bios);
     /* Load a BIOS / boot exception handler image. */
-    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, machine->firmware ?: BIOS_FILENAME);
+    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS,
+                              machine->firmware ?: bios_name);
     if (filename) {
         bios_size = load_image_targphys(filename, 0x1fc00000LL, BIOS_SIZE);
         g_free(filename);
Signature · 1 line
2.47.1
#49 lore raw

[PULL 39/58] meson: Share common C source prefixes

In reply to Philippe Mathieu-Daudé

From: Akihiko Odaki <[email protected]>

gnu_source_prefix defines _GNU_SOURCE for compiler object functions. The definition is universally available in the code base.

docs/devel/style.rst also says that the "qemu/osdep.h" header is always included, so files included in the file is also universally available in the code base.

Rename gnu_source_prefix to osdep_prefix, and add #include directives that are referred by the users of gnu_source_prefix and contained in qemu/osdep.h to safely de-duplicate #include directives.

Message-ID: <[email protected]>

---
 meson.build | 68 +++++++++++++++++++++++++----------------------------
 1 file changed, 32 insertions(+), 36 deletions(-)
meson.build +32 -36
index 35dcec8ce5c..d93dbde194f 100644
@@ -2185,10 +2185,21 @@ if not has_malloc_trim and get_option('malloc_trim').enabled()
   endif
 endif
 
-gnu_source_prefix = '''
+osdep_prefix = '''
   #ifndef _GNU_SOURCE
   #define _GNU_SOURCE
   #endif
+
+  #include <stddef.h>
+  #include <sys/types.h>
+
+  #include <limits.h>
+  /* Put unistd.h before time.h as that triggers localtime_r/gmtime_r
+   * function availability on recentish Mingw-w64 platforms. */
+  #include <unistd.h>
+  #include <time.h>
+  #include <errno.h>
+  #include <fcntl.h>
 '''
 
 have_vhost_user_blk_server = get_option('vhost_user_blk_server') \
@@ -2703,7 +2714,7 @@ config_host_data.set('CONFIG_FIEMAP',
                      cc.has_header('linux/fiemap.h') and
                      cc.has_header_symbol('linux/fs.h', 'FS_IOC_FIEMAP'))
 config_host_data.set('CONFIG_GETCPU',
-                     cc.has_header_symbol('sched.h', 'getcpu', prefix: gnu_source_prefix))
+                     cc.has_header_symbol('sched.h', 'getcpu', prefix: osdep_prefix))
 config_host_data.set('CONFIG_GETRANDOM',
                      cc.has_function('getrandom') and
                      cc.has_header_symbol('sys/random.h', 'GRND_NONBLOCK'))
@@ -2748,8 +2759,7 @@ config_host_data.set('HAVE_UTMPX',
 config_host_data.set('CONFIG_EVENTFD', cc.links('''
   #include <sys/eventfd.h>
   int main(void) { return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); }'''))
-config_host_data.set('CONFIG_FDATASYNC', cc.links(gnu_source_prefix + '''
-  #include <unistd.h>
+config_host_data.set('CONFIG_FDATASYNC', cc.links(osdep_prefix + '''
   int main(void) {
   #if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0
   return fdatasync(0);
@@ -2758,10 +2768,8 @@ config_host_data.set('CONFIG_FDATASYNC', cc.links(gnu_source_prefix + '''
   #endif
   }'''))
 
-has_madvise = cc.links(gnu_source_prefix + '''
-  #include <sys/types.h>
+has_madvise = cc.links(osdep_prefix + '''
   #include <sys/mman.h>
-  #include <stddef.h>
   int main(void) { return madvise(NULL, 0, MADV_DONTNEED); }''')
 missing_madvise_proto = false
 if has_madvise
@@ -2771,21 +2779,18 @@ if has_madvise
   # missing-prototype case, we try again with a definitely-bogus prototype.
   # This will only compile if the system headers don't provide the prototype;
   # otherwise the conflicting prototypes will cause a compiler error.
-  missing_madvise_proto = cc.links(gnu_source_prefix + '''
-    #include <sys/types.h>
+  missing_madvise_proto = cc.links(osdep_prefix + '''>
     #include <sys/mman.h>
-    #include <stddef.h>
     extern int madvise(int);
     int main(void) { return madvise(0); }''')
 endif
 config_host_data.set('CONFIG_MADVISE', has_madvise)
 config_host_data.set('HAVE_MADVISE_WITHOUT_PROTOTYPE', missing_madvise_proto)
 
-config_host_data.set('CONFIG_MEMFD', cc.links(gnu_source_prefix + '''
+config_host_data.set('CONFIG_MEMFD', cc.links(osdep_prefix + '''
   #include <sys/mman.h>
   int main(void) { return memfd_create("foo", MFD_ALLOW_SEALING); }'''))
-config_host_data.set('CONFIG_OPEN_BY_HANDLE', cc.links(gnu_source_prefix + '''
-  #include <fcntl.h>
+config_host_data.set('CONFIG_OPEN_BY_HANDLE', cc.links(osdep_prefix + '''
   #if !defined(AT_EMPTY_PATH)
   # error missing definition
   #else
@@ -2796,13 +2801,12 @@ config_host_data.set('CONFIG_OPEN_BY_HANDLE', cc.links(gnu_source_prefix + '''
 # i.e. errno is set and -1 is returned. That's not really how POSIX defines the
 # function. On the flip side, it has madvise() which is preferred anyways.
 if host_os != 'darwin'
-  config_host_data.set('CONFIG_POSIX_MADVISE', cc.links(gnu_source_prefix + '''
+  config_host_data.set('CONFIG_POSIX_MADVISE', cc.links(osdep_prefix + '''
     #include <sys/mman.h>
-    #include <stddef.h>
     int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); }'''))
 endif
 
-config_host_data.set('CONFIG_PTHREAD_SETNAME_NP_W_TID', cc.links(gnu_source_prefix + '''
+config_host_data.set('CONFIG_PTHREAD_SETNAME_NP_W_TID', cc.links(osdep_prefix + '''
   #include <pthread.h>
 
   static void *f(void *p) { return NULL; }
@@ -2813,7 +2817,7 @@ config_host_data.set('CONFIG_PTHREAD_SETNAME_NP_W_TID', cc.links(gnu_source_pref
     pthread_setname_np(thread, "QEMU");
     return 0;
   }''', dependencies: threads))
-config_host_data.set('CONFIG_PTHREAD_SETNAME_NP_WO_TID', cc.links(gnu_source_prefix + '''
+config_host_data.set('CONFIG_PTHREAD_SETNAME_NP_WO_TID', cc.links(osdep_prefix + '''
   #include <pthread.h>
 
   static void *f(void *p) { pthread_setname_np("QEMU"); return NULL; }
@@ -2823,7 +2827,7 @@ config_host_data.set('CONFIG_PTHREAD_SETNAME_NP_WO_TID', cc.links(gnu_source_pre
     pthread_create(&thread, 0, f, 0);
     return 0;
   }''', dependencies: threads))
-config_host_data.set('CONFIG_PTHREAD_SET_NAME_NP', cc.links(gnu_source_prefix + '''
+config_host_data.set('CONFIG_PTHREAD_SET_NAME_NP', cc.links(osdep_prefix + '''
   #include <pthread.h>
   #include <pthread_np.h>
 
@@ -2835,9 +2839,8 @@ config_host_data.set('CONFIG_PTHREAD_SET_NAME_NP', cc.links(gnu_source_prefix +
     pthread_set_name_np(thread, "QEMU");
     return 0;
   }''', dependencies: threads))
-config_host_data.set('CONFIG_PTHREAD_CONDATTR_SETCLOCK', cc.links(gnu_source_prefix + '''
+config_host_data.set('CONFIG_PTHREAD_CONDATTR_SETCLOCK', cc.links(osdep_prefix + '''
   #include <pthread.h>
-  #include <time.h>
 
   int main(void)
   {
@@ -2846,7 +2849,7 @@ config_host_data.set('CONFIG_PTHREAD_CONDATTR_SETCLOCK', cc.links(gnu_source_pre
     pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
     return 0;
   }''', dependencies: threads))
-config_host_data.set('CONFIG_PTHREAD_AFFINITY_NP', cc.links(gnu_source_prefix + '''
+config_host_data.set('CONFIG_PTHREAD_AFFINITY_NP', cc.links(osdep_prefix + '''
   #include <pthread.h>
 
   static void *f(void *p) { return NULL; }
@@ -2863,15 +2866,10 @@ config_host_data.set('CONFIG_PTHREAD_AFFINITY_NP', cc.links(gnu_source_prefix +
     CPU_FREE(cpuset);
     return 0;
   }''', dependencies: threads))
-config_host_data.set('CONFIG_SIGNALFD', cc.links(gnu_source_prefix + '''
+config_host_data.set('CONFIG_SIGNALFD', cc.links(osdep_prefix + '''
   #include <sys/signalfd.h>
-  #include <stddef.h>
   int main(void) { return signalfd(-1, NULL, SFD_CLOEXEC); }'''))
-config_host_data.set('CONFIG_SPLICE', cc.links(gnu_source_prefix + '''
-  #include <unistd.h>
-  #include <fcntl.h>
-  #include <limits.h>
-
+config_host_data.set('CONFIG_SPLICE', cc.links(osdep_prefix + '''
   int main(void)
   {
     int len, fd = 0;
@@ -2880,13 +2878,13 @@ config_host_data.set('CONFIG_SPLICE', cc.links(gnu_source_prefix + '''
     return 0;
   }'''))
 
-config_host_data.set('HAVE_MLOCKALL', cc.links(gnu_source_prefix + '''
+config_host_data.set('HAVE_MLOCKALL', cc.links(osdep_prefix + '''
   #include <sys/mman.h>
   int main(void) {
     return mlockall(MCL_FUTURE);
   }'''))
 
-config_host_data.set('HAVE_MLOCK_ONFAULT', cc.links(gnu_source_prefix + '''
+config_host_data.set('HAVE_MLOCK_ONFAULT', cc.links(osdep_prefix + '''
   #include <sys/mman.h>
   int main(void) {
       return mlockall(MCL_FUTURE | MCL_ONFAULT);
@@ -2895,7 +2893,7 @@ config_host_data.set('HAVE_MLOCK_ONFAULT', cc.links(gnu_source_prefix + '''
 have_l2tpv3 = false
 if get_option('l2tpv3').allowed() and have_system
   have_l2tpv3 = cc.has_type('struct mmsghdr',
-    prefix: gnu_source_prefix + '''
+    prefix: osdep_prefix + '''
       #include <sys/socket.h>
       #include <linux/ip.h>''')
 endif
@@ -3011,13 +3009,13 @@ if has_int128_type
   endif
 endif
 
-config_host_data.set('CONFIG_GETAUXVAL', cc.links(gnu_source_prefix + '''
+config_host_data.set('CONFIG_GETAUXVAL', cc.links(osdep_prefix + '''
   #include <sys/auxv.h>
   int main(void) {
     return getauxval(AT_HWCAP) == 0;
   }'''))
 
-config_host_data.set('CONFIG_ELF_AUX_INFO', cc.links(gnu_source_prefix + '''
+config_host_data.set('CONFIG_ELF_AUX_INFO', cc.links(osdep_prefix + '''
   #include <sys/auxv.h>
   int main(void) {
     unsigned long hwcap = 0;
@@ -3130,9 +3128,7 @@ config_host_data.set('CONFIG_MEMBARRIER', get_option('membarrier') \
   .allowed())
 
 have_afalg = get_option('crypto_afalg') \
-  .require(cc.compiles(gnu_source_prefix + '''
-    #include <errno.h>
-    #include <sys/types.h>
+  .require(cc.compiles(osdep_prefix + '''
     #include <sys/socket.h>
     #include <linux/if_alg.h>
     int main(void) {
Signature · 1 line
2.47.1
#50 lore raw

[PULL 40/58] meson: Use osdep_prefix for strchrnul()

In reply to Philippe Mathieu-Daudé

From: Akihiko Odaki <[email protected]>

macOS SDK may have the symbol of strchrnul(), but it is actually available only on macOS 15.4 or later and that fact is codified in string.h. Include the header file using osdep_prefix to check if the function is available on the deployment target.

Message-ID: <[email protected]>

---
 meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meson.build +2 -1
index d93dbde194f..c736a6f4c4b 100644
@@ -2193,6 +2193,7 @@ osdep_prefix = '''
   #include <stddef.h>
   #include <sys/types.h>
 
+  #include <string.h>
   #include <limits.h>
   /* Put unistd.h before time.h as that triggers localtime_r/gmtime_r
    * function availability on recentish Mingw-w64 platforms. */
@@ -2657,7 +2658,7 @@ config_host_data.set('HAVE_GETIFADDRS', cc.has_function('getifaddrs'))
 config_host_data.set('HAVE_GLIB_WITH_SLICE_ALLOCATOR', glib_has_gslice)
 config_host_data.set('HAVE_GLIB_WITH_ALIGNED_ALLOC', glib_has_aligned_alloc)
 config_host_data.set('HAVE_OPENPTY', cc.has_function('openpty', dependencies: util))
-config_host_data.set('HAVE_STRCHRNUL', cc.has_function('strchrnul'))
+config_host_data.set('HAVE_STRCHRNUL', cc.has_function('strchrnul', prefix: osdep_prefix))
 config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix: '#include <stdlib.h>'))
 if rbd.found()
   config_host_data.set('HAVE_RBD_NAMESPACE_EXISTS',
Signature · 1 line
2.47.1
#51 lore raw

[PULL 50/58] qapi: Rename TargetInfo structure as QemuTargetInfo

In reply to Philippe Mathieu-Daudé

The QAPI-generated 'TargetInfo' structure name is only used in a single file. We want to heavily use another structure similarly named. Rename the QAPI one, since structure names are not part of the public API.

Message-Id: <[email protected]>

---
 qapi/machine.json          | 10 +++++-----
 hw/core/machine-qmp-cmds.c |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)
qapi/machine.json +5 -5
index a9ff8076317..c8feb9fe17b 100644
@@ -275,15 +275,15 @@
 { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
 
 ##
-# @TargetInfo:
+# @QemuTargetInfo:
 #
-# Information describing the QEMU target.
+# Information on the target configuration built into the QEMU binary.
 #
 # @arch: the target architecture
 #
 # Since: 1.2
 ##
-{ 'struct': 'TargetInfo',
+{ 'struct': 'QemuTargetInfo',
   'data': { 'arch': 'SysEmuTarget' } }
 
 ##
@@ -291,11 +291,11 @@
 #
 # Return information about the target for this QEMU
 #
-# Returns: TargetInfo
+# Returns: QemuTargetInfo
 #
 # Since: 1.2
 ##
-{ 'command': 'query-target', 'returns': 'TargetInfo' }
+{ 'command': 'query-target', 'returns': 'QemuTargetInfo' }
 
 ##
 # @UuidInfo:
hw/core/machine-qmp-cmds.c +2 -2
index 9447e345b3c..a5e635152dc 100644
@@ -134,9 +134,9 @@ CurrentMachineParams *qmp_query_current_machine(Error **errp)
     return params;
 }
 
-TargetInfo *qmp_query_target(Error **errp)
+QemuTargetInfo *qmp_query_target(Error **errp)
 {
-    TargetInfo *info = g_malloc0(sizeof(*info));
+    QemuTargetInfo *info = g_malloc0(sizeof(*info));
 
     info->arch = qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1,
                                  &error_abort);
Signature · 1 line
2.47.1
#52 lore raw

[PULL 26/58] target/mips: Fix MIPS16e translation

In reply to Philippe Mathieu-Daudé

From: Hauke Mehrtens <[email protected]>

Fix a wrong conversion to gen_op_addr_addi(). The framesize should be added like it was done before.

This bug broke booting OpenWrt MIPS32 BE malta Linux system images generated by OpenWrt.

Fixes d0b24b7f50e1 ("target/mips: Use gen_op_addr_addi() when possible")

Message-ID: <[email protected]>

---
 target/mips/tcg/mips16e_translate.c.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/mips/tcg/mips16e_translate.c.inc +2 -2
index a9af8f1e74a..97da3456ea5 100644
@@ -306,7 +306,7 @@ static void gen_mips16_restore(DisasContext *ctx,
     int astatic;
     TCGv t0 = tcg_temp_new();
 
-    gen_op_addr_addi(ctx, t0, cpu_gpr[29], -framesize);
+    gen_op_addr_addi(ctx, t0, cpu_gpr[29], framesize);
 
     if (do_ra) {
         decr_and_load(ctx, 31, t0);
@@ -386,7 +386,7 @@ static void gen_mips16_restore(DisasContext *ctx,
         }
     }
 
-    gen_op_addr_addi(ctx, cpu_gpr[29], cpu_gpr[29], -framesize);
+    gen_op_addr_addi(ctx, cpu_gpr[29], cpu_gpr[29], framesize);
 }
 
 #if defined(TARGET_MIPS64)
Signature · 1 line
2.47.1
#53 lore raw

[PULL 36/58] pc-bios: Move device tree files in their own subdir

In reply to Philippe Mathieu-Daudé

From: BALATON Zoltan <[email protected]>

We have several device tree files already and may have more in the future so add a new dtb subdirectory and move device tree files there so they are not mixed with ROM binaries.

Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>

---
 MAINTAINERS                                |   2 +-
 system/datadir.c                           |   4 +++-
 pc-bios/{ => dtb}/bamboo.dtb               | Bin
 pc-bios/{ => dtb}/bamboo.dts               |   0
 pc-bios/{ => dtb}/canyonlands.dtb          | Bin
 pc-bios/{ => dtb}/canyonlands.dts          |   0
 pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++
 pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
 pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
 pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
 pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0
 pc-bios/meson.build                        |  23 +--------------------
 qemu.nsi                                   |   2 +-
 13 files changed, 29 insertions(+), 25 deletions(-)
 rename pc-bios/{ => dtb}/bamboo.dtb (100%)
 rename pc-bios/{ => dtb}/bamboo.dts (100%)
 rename pc-bios/{ => dtb}/canyonlands.dtb (100%)
 rename pc-bios/{ => dtb}/canyonlands.dts (100%)
 create mode 100644 pc-bios/dtb/meson.build
 rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%)
 rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%)
 rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%)
 rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)
MAINTAINERS +1 -1
index 661a47db5ac..d82d962f1a4 100644
@@ -1581,7 +1581,7 @@ F: hw/pci-host/ppc440_pcix.c
 F: hw/display/sm501*
 F: hw/ide/sii3112.c
 F: hw/rtc/m41t80.c
-F: pc-bios/canyonlands.dt[sb]
+F: pc-bios/dtb/canyonlands.dt[sb]
 F: pc-bios/u-boot-sam460ex-20100605.bin
 F: roms/u-boot-sam460ex
 F: docs/system/ppc/amigang.rst
system/datadir.c +3 -1
index e450b84ce91..f96f8fc2646 100644
@@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char *name)
 
     switch (type) {
     case QEMU_FILE_TYPE_BIOS:
-    case QEMU_FILE_TYPE_DTB:
         subdir = "";
         break;
+    case QEMU_FILE_TYPE_DTB:
+        subdir = "dtb/";
+        break;
     case QEMU_FILE_TYPE_KEYMAP:
         subdir = "keymaps/";
         break;
pc-bios/dtb/bamboo.dtb renamed from pc-bios/bamboo.dtb +0 -0
similarity index 100%
rename from pc-bios/bamboo.dtb
rename to pc-bios/dtb/bamboo.dtb
pc-bios/dtb/bamboo.dts renamed from pc-bios/bamboo.dts +0 -0
similarity index 100%
rename from pc-bios/bamboo.dts
rename to pc-bios/dtb/bamboo.dts
pc-bios/dtb/canyonlands.dtb renamed from pc-bios/canyonlands.dtb +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dtb
rename to pc-bios/dtb/canyonlands.dtb
pc-bios/dtb/canyonlands.dts renamed from pc-bios/canyonlands.dts +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dts
rename to pc-bios/dtb/canyonlands.dts
pc-bios/dtb/meson.build new file +23 -0
new file mode 100644
index 00000000000..7a71835bca7
@@ -0,0 +1,23 @@
+dtbs = [
+  'bamboo.dtb',
+  'canyonlands.dtb',
+  'petalogix-ml605.dtb',
+  'petalogix-s3adsp1800.dtb',
+]
+
+dtc = find_program('dtc', required: false)
+if dtc.found()
+  foreach out : dtbs
+    f = fs.replace_suffix(out, '.dts')
+    custom_target(f,
+        build_by_default: have_system,
+        input: files(f),
+        output: out,
+        install: get_option('install_blobs'),
+        install_dir: qemu_datadir / 'dtb',
+        command: [ dtc, '-q', '-I', 'dts', '-O', 'dtb',
+                        '-o', '@OUTPUT@', '@INPUT0@' ])
+  endforeach
+else
+    install_data(dtbs, install_dir: qemu_datadir / 'dtb')
+endif
pc-bios/dtb/petalogix-ml605.dtb renamed from pc-bios/petalogix-ml605.dtb +0 -0
similarity index 100%
rename from pc-bios/petalogix-ml605.dtb
rename to pc-bios/dtb/petalogix-ml605.dtb
pc-bios/dtb/petalogix-ml605.dts renamed from pc-bios/petalogix-ml605.dts +0 -0
similarity index 100%
rename from pc-bios/petalogix-ml605.dts
rename to pc-bios/dtb/petalogix-ml605.dts
pc-bios/dtb/petalogix-s3adsp1800.dtb renamed from pc-bios/petalogix-s3adsp1800.dtb +0 -0
similarity index 100%
rename from pc-bios/petalogix-s3adsp1800.dtb
rename to pc-bios/dtb/petalogix-s3adsp1800.dtb
pc-bios/dtb/petalogix-s3adsp1800.dts renamed from pc-bios/petalogix-s3adsp1800.dts +0 -0
similarity index 100%
rename from pc-bios/petalogix-s3adsp1800.dts
rename to pc-bios/dtb/petalogix-s3adsp1800.dts
pc-bios/meson.build +1 -22
index 34d6616c32b..34d8cc4f338 100644
@@ -86,31 +86,10 @@ blobs = [
   'vof-nvram.bin',
 ]
 
-dtc = find_program('dtc', required: false)
-foreach f : [
-  'bamboo.dts',
-  'canyonlands.dts',
-  'petalogix-s3adsp1800.dts',
-  'petalogix-ml605.dts',
-]
-  out = fs.replace_suffix(f, '.dtb')
-  if dtc.found()
-    custom_target(f,
-        build_by_default: have_system,
-        input: files(f),
-        output: out,
-        install: get_option('install_blobs'),
-        install_dir: qemu_datadir,
-        command: [ dtc, '-q', '-I', 'dts', '-O', 'dtb',
-                        '-o', '@OUTPUT@', '@INPUT0@' ])
-  else
-    blobs += out
-  endif
-endforeach
-
 if get_option('install_blobs')
   install_data(blobs, install_dir: qemu_datadir)
 endif
 
 subdir('descriptors')
+subdir('dtb')
 subdir('keymaps')
qemu.nsi +1 -1
index b186f223e14..d419986ca06 100644
@@ -204,7 +204,6 @@ Section "Uninstall"
     Delete "$INSTDIR\*.bmp"
     Delete "$INSTDIR\*.bin"
     Delete "$INSTDIR\*.dll"
-    Delete "$INSTDIR\*.dtb"
     Delete "$INSTDIR\*.fd"
     Delete "$INSTDIR\*.img"
     Delete "$INSTDIR\*.lid"
@@ -215,6 +214,7 @@ Section "Uninstall"
     Delete "$INSTDIR\qemu-io.exe"
     Delete "$INSTDIR\qemu.exe"
     Delete "$INSTDIR\qemu-system-*.exe"
+    RMDir /r "$INSTDIR\dtb"
     RMDir /r "$INSTDIR\doc"
     RMDir /r "$INSTDIR\share"
     ; Remove generated files
Signature · 1 line
2.47.1
#54 lore raw

Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir

Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 87 lines

From: BALATON Zoltan <[email protected]>

We have several device tree files already and may have more in the future so add a new dtb subdirectory and move device tree files there so they are not mixed with ROM binaries.

Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>

---

MAINTAINERS                                |   2 +-
system/datadir.c                           |   4 +++-
pc-bios/{ => dtb}/bamboo.dtb               | Bin
pc-bios/{ => dtb}/bamboo.dts               |   0
pc-bios/{ => dtb}/canyonlands.dtb          | Bin
pc-bios/{ => dtb}/canyonlands.dts          |   0
pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++
pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0
pc-bios/meson.build                        |  23 +--------------------
qemu.nsi                                   |   2 +-
13 files changed, 29 insertions(+), 25 deletions(-)

rename pc-bios/{ => dtb}/bamboo.dtb (100%) rename pc-bios/{ => dtb}/bamboo.dts (100%) rename pc-bios/{ => dtb}/canyonlands.dtb (100%) rename pc-bios/{ => dtb}/canyonlands.dts (100%) create mode 100644 pc-bios/dtb/meson.build rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%) rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)

MAINTAINERS +0 -0
index 661a47db5ac..d82d962f1a4 100644
@@ -1581,7 +1581,7 @@ F: hw/pci-host/ppc440_pcix.c

F: hw/display/sm501*
F: hw/ide/sii3112.c
F: hw/rtc/m41t80.c

MAINTAINERS +1 -1
-F: pc-bios/canyonlands.dt[sb]
+F: pc-bios/dtb/canyonlands.dt[sb]

F: pc-bios/u-boot-sam460ex-20100605.bin
F: roms/u-boot-sam460ex
F: docs/system/ppc/amigang.rst

system/datadir.c +3 -1
index e450b84ce91..f96f8fc2646 100644
@@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char *name)
 
    switch (type) {
    case QEMU_FILE_TYPE_BIOS:
-    case QEMU_FILE_TYPE_DTB:
        subdir = "";
        break;
+    case QEMU_FILE_TYPE_DTB:
+        subdir = "dtb/";
+        break;
    case QEMU_FILE_TYPE_KEYMAP:
        subdir = "keymaps/";
        break;
pc-bios/dtb/bamboo.dtb renamed from pc-bios/bamboo.dtb +0 -0
similarity index 100%
rename from pc-bios/bamboo.dtb
rename to pc-bios/dtb/bamboo.dtb
pc-bios/dtb/bamboo.dts renamed from pc-bios/bamboo.dts +0 -0
similarity index 100%
rename from pc-bios/bamboo.dts
rename to pc-bios/dtb/bamboo.dts
pc-bios/dtb/canyonlands.dtb renamed from pc-bios/canyonlands.dtb +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dtb
rename to pc-bios/dtb/canyonlands.dtb
pc-bios/dtb/canyonlands.dts renamed from pc-bios/canyonlands.dts +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dts
rename to pc-bios/dtb/canyonlands.dts
pc-bios/dtb/meson.build new file +0 -0
new file mode 100644
index 00000000000..7a71835bca7

pc-bios/dtb/meson.build line 5

Quoted 5 lines
pc-bios/dtb/meson.build new file +5 -0
@@ -0,0 +1,23 @@
+dtbs = [
+  'bamboo.dtb',
+  'canyonlands.dtb',
+  'petalogix-ml605.dtb',
+  'petalogix-s3adsp1800.dtb',

Was it intended that the suffix changed from .dts to .dtb? This change isn't motivated in the commit message and usually source files rather than generated artifacts are listed in build files.

Best regards,
Bernhard

Quoted 91 lines
pc-bios/dtb/meson.build new file +18 -0
+]
+
+dtc = find_program('dtc', required: false)
+if dtc.found()
+  foreach out : dtbs
+    f = fs.replace_suffix(out, '.dts')
+    custom_target(f,
+        build_by_default: have_system,
+        input: files(f),
+        output: out,
+        install: get_option('install_blobs'),
+        install_dir: qemu_datadir / 'dtb',
+        command: [ dtc, '-q', '-I', 'dts', '-O', 'dtb',
+                        '-o', '@OUTPUT@', '@INPUT0@' ])
+  endforeach
+else
+    install_data(dtbs, install_dir: qemu_datadir / 'dtb')
+endif
pc-bios/dtb/petalogix-ml605.dtb renamed from pc-bios/petalogix-ml605.dtb +0 -0
similarity index 100%
rename from pc-bios/petalogix-ml605.dtb
rename to pc-bios/dtb/petalogix-ml605.dtb
pc-bios/dtb/petalogix-ml605.dts renamed from pc-bios/petalogix-ml605.dts +0 -0
similarity index 100%
rename from pc-bios/petalogix-ml605.dts
rename to pc-bios/dtb/petalogix-ml605.dts
pc-bios/dtb/petalogix-s3adsp1800.dtb renamed from pc-bios/petalogix-s3adsp1800.dtb +0 -0
similarity index 100%
rename from pc-bios/petalogix-s3adsp1800.dtb
rename to pc-bios/dtb/petalogix-s3adsp1800.dtb
pc-bios/dtb/petalogix-s3adsp1800.dts renamed from pc-bios/petalogix-s3adsp1800.dts +0 -0
similarity index 100%
rename from pc-bios/petalogix-s3adsp1800.dts
rename to pc-bios/dtb/petalogix-s3adsp1800.dts
pc-bios/meson.build +0 -0
index 34d6616c32b..34d8cc4f338 100644
@@ -86,31 +86,10 @@ blobs = [
  'vof-nvram.bin',

]

pc-bios/meson.build +0 -22
-dtc = find_program('dtc', required: false)
-foreach f : [
-  'bamboo.dts',
-  'canyonlands.dts',
-  'petalogix-s3adsp1800.dts',
-  'petalogix-ml605.dts',
-]
-  out = fs.replace_suffix(f, '.dtb')
-  if dtc.found()
-    custom_target(f,
-        build_by_default: have_system,
-        input: files(f),
-        output: out,
-        install: get_option('install_blobs'),
-        install_dir: qemu_datadir,
-        command: [ dtc, '-q', '-I', 'dts', '-O', 'dtb',
-                        '-o', '@OUTPUT@', '@INPUT0@' ])
-  else
-    blobs += out
-  endif
-endforeach
-

if get_option('install_blobs')
install_data(blobs, install_dir: qemu_datadir)
endif

subdir('descriptors')
+subdir('dtb')
subdir('keymaps')

qemu.nsi +1 -1
index b186f223e14..d419986ca06 100644
@@ -204,7 +204,6 @@ Section "Uninstall"
    Delete "$INSTDIR\*.bmp"
    Delete "$INSTDIR\*.bin"
    Delete "$INSTDIR\*.dll"
-    Delete "$INSTDIR\*.dtb"
    Delete "$INSTDIR\*.fd"
    Delete "$INSTDIR\*.img"
    Delete "$INSTDIR\*.lid"
@@ -215,6 +214,7 @@ Section "Uninstall"
    Delete "$INSTDIR\qemu-io.exe"
    Delete "$INSTDIR\qemu.exe"
    Delete "$INSTDIR\qemu-system-*.exe"
+    RMDir /r "$INSTDIR\dtb"
    RMDir /r "$INSTDIR\doc"
    RMDir /r "$INSTDIR\share"
    ; Remove generated files
#55 lore raw

Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir

Quoted 87 lines · Bernhard Beschow

Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 86 lines

From: BALATON Zoltan <[email protected]>

We have several device tree files already and may have more in the future so add a new dtb subdirectory and move device tree files there so they are not mixed with ROM binaries.

Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>

---

MAINTAINERS                                |   2 +-
system/datadir.c                           |   4 +++-
pc-bios/{ => dtb}/bamboo.dtb               | Bin
pc-bios/{ => dtb}/bamboo.dts               |   0
pc-bios/{ => dtb}/canyonlands.dtb          | Bin
pc-bios/{ => dtb}/canyonlands.dts          |   0
pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++
pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0
pc-bios/meson.build                        |  23 +--------------------
qemu.nsi                                   |   2 +-
13 files changed, 29 insertions(+), 25 deletions(-)

rename pc-bios/{ => dtb}/bamboo.dtb (100%) rename pc-bios/{ => dtb}/bamboo.dts (100%) rename pc-bios/{ => dtb}/canyonlands.dtb (100%) rename pc-bios/{ => dtb}/canyonlands.dts (100%) create mode 100644 pc-bios/dtb/meson.build rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%) rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)

MAINTAINERS +0 -0
index 661a47db5ac..d82d962f1a4 100644
@@ -1581,7 +1581,7 @@ F: hw/pci-host/ppc440_pcix.c

F: hw/display/sm501*
F: hw/ide/sii3112.c
F: hw/rtc/m41t80.c

MAINTAINERS +1 -1
-F: pc-bios/canyonlands.dt[sb]
+F: pc-bios/dtb/canyonlands.dt[sb]

F: pc-bios/u-boot-sam460ex-20100605.bin
F: roms/u-boot-sam460ex
F: docs/system/ppc/amigang.rst

system/datadir.c +3 -1
index e450b84ce91..f96f8fc2646 100644
@@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char *name)
 
    switch (type) {
    case QEMU_FILE_TYPE_BIOS:
-    case QEMU_FILE_TYPE_DTB:
        subdir = "";
        break;
+    case QEMU_FILE_TYPE_DTB:
+        subdir = "dtb/";
+        break;
    case QEMU_FILE_TYPE_KEYMAP:
        subdir = "keymaps/";
        break;
pc-bios/dtb/bamboo.dtb renamed from pc-bios/bamboo.dtb +0 -0
similarity index 100%
rename from pc-bios/bamboo.dtb
rename to pc-bios/dtb/bamboo.dtb
pc-bios/dtb/bamboo.dts renamed from pc-bios/bamboo.dts +0 -0
similarity index 100%
rename from pc-bios/bamboo.dts
rename to pc-bios/dtb/bamboo.dts
pc-bios/dtb/canyonlands.dtb renamed from pc-bios/canyonlands.dtb +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dtb
rename to pc-bios/dtb/canyonlands.dtb
pc-bios/dtb/canyonlands.dts renamed from pc-bios/canyonlands.dts +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dts
rename to pc-bios/dtb/canyonlands.dts
pc-bios/dtb/meson.build new file +0 -0
new file mode 100644
index 00000000000..7a71835bca7
Quoted 8 lines

pc-bios/dtb/meson.build line 5

Quoted 6 lines
pc-bios/dtb/meson.build new file +5 -0
@@ -0,0 +1,23 @@
+dtbs = [
+  'bamboo.dtb',
+  'canyonlands.dtb',
+  'petalogix-ml605.dtb',
+  'petalogix-s3adsp1800.dtb',

Was it intended that the suffix changed from .dts to .dtb? This change isn't motivated in the commit message and usually source files rather than generated artifacts are listed in build files.

I think I either found similar python code somewhere and followed that because meson and python is not something I understand well. Or changed it because we always need the list of dtbs to install but only need the dts when compiling so this way we don't need another list or replacing suffix twice.

Regards,
BALATON Zoltan

#56 lore raw

Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir

Quoted 98 lines · BALATON Zoltan
Quoted 88 lines · Bernhard Beschow

Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 87 lines

From: BALATON Zoltan <[email protected]>

We have several device tree files already and may have more in the future so add a new dtb subdirectory and move device tree files there so they are not mixed with ROM binaries.

Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>

---
MAINTAINERS                                |   2 +- system/datadir.c                           |   4 +++- pc-bios/{ => dtb}/bamboo.dtb               | Bin
pc-bios/{ => dtb}/bamboo.dts               |   0
pc-bios/{ => dtb}/canyonlands.dtb          | Bin
pc-bios/{ => dtb}/canyonlands.dts          |   0 pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++ pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0 pc-bios/meson.build                        |  23 +-------------------- qemu.nsi                                   |   2 +-

13 files changed, 29 insertions(+), 25 deletions(-)

rename pc-bios/{ => dtb}/bamboo.dtb (100%) rename pc-bios/{ => dtb}/bamboo.dts (100%) rename pc-bios/{ => dtb}/canyonlands.dtb (100%) rename pc-bios/{ => dtb}/canyonlands.dts (100%) create mode 100644 pc-bios/dtb/meson.build rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%) rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)

MAINTAINERS +0 -0
index 661a47db5ac..d82d962f1a4 100644
@@ -1581,7 +1581,7 @@ F: hw/pci-host/ppc440_pcix.c

F: hw/display/sm501*
F: hw/ide/sii3112.c
F: hw/rtc/m41t80.c

MAINTAINERS +1 -1
-F: pc-bios/canyonlands.dt[sb]
+F: pc-bios/dtb/canyonlands.dt[sb]

F: pc-bios/u-boot-sam460ex-20100605.bin
F: roms/u-boot-sam460ex
F: docs/system/ppc/amigang.rst

system/datadir.c +0 -0
index e450b84ce91..f96f8fc2646 100644
@@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char 
 *name)
 
     switch (type) {

    case QEMU_FILE_TYPE_BIOS:
-    case QEMU_FILE_TYPE_DTB:
        subdir = "";
        break;
+    case QEMU_FILE_TYPE_DTB:
+        subdir = "dtb/";
+        break;
    case QEMU_FILE_TYPE_KEYMAP:
        subdir = "keymaps/";
        break;

pc-bios/dtb/bamboo.dtb renamed from pc-bios/bamboo.dtb +0 -0
similarity index 100%
rename from pc-bios/bamboo.dtb
rename to pc-bios/dtb/bamboo.dtb
pc-bios/dtb/bamboo.dts renamed from pc-bios/bamboo.dts +0 -0
similarity index 100%
rename from pc-bios/bamboo.dts
rename to pc-bios/dtb/bamboo.dts
pc-bios/dtb/canyonlands.dtb renamed from pc-bios/canyonlands.dtb +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dtb
rename to pc-bios/dtb/canyonlands.dtb
pc-bios/dtb/canyonlands.dts renamed from pc-bios/canyonlands.dts +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dts
rename to pc-bios/dtb/canyonlands.dts
pc-bios/dtb/meson.build new file +0 -0
new file mode 100644
index 00000000000..7a71835bca7
Quoted 8 lines

pc-bios/dtb/meson.build line 5

Quoted 6 lines
pc-bios/dtb/meson.build new file +5 -0
@@ -0,0 +1,23 @@
+dtbs = [
+  'bamboo.dtb',
+  'canyonlands.dtb',
+  'petalogix-ml605.dtb',
+  'petalogix-s3adsp1800.dtb',

Was it intended that the suffix changed from .dts to .dtb? This change isn't motivated in the commit message and usually source files rather than generated artifacts are listed in build files.

Quoted 1 line

I think I either found similar python code somewhere and followed that because meson and python is not something I understand well. Or changed it because we always need the list of dtbs to install but only need the dts when compiling so this way we don't need another list or replacing suffix twice.

Should we revert?

#57 lore raw

Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir

Quoted 99 lines · Philippe Mathieu-Daudé
Quoted 98 lines · BALATON Zoltan
Quoted 96 lines · Bernhard Beschow

Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 88 lines

From: BALATON Zoltan <[email protected]>

We have several device tree files already and may have more in the future so add a new dtb subdirectory and move device tree files there so they are not mixed with ROM binaries.

Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>

---
MAINTAINERS                                |   2 +- system/datadir.c                           |   4 +++- pc-bios/{ => dtb}/bamboo.dtb               | Bin
pc-bios/{ => dtb}/bamboo.dts               |   0
pc-bios/{ => dtb}/canyonlands.dtb          | Bin
pc-bios/{ => dtb}/canyonlands.dts          |   0 pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++ pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0 pc-bios/meson.build                        |  23 +-------------------- qemu.nsi                                   |   2 +-

13 files changed, 29 insertions(+), 25 deletions(-)

rename pc-bios/{ => dtb}/bamboo.dtb (100%) rename pc-bios/{ => dtb}/bamboo.dts (100%) rename pc-bios/{ => dtb}/canyonlands.dtb (100%) rename pc-bios/{ => dtb}/canyonlands.dts (100%) create mode 100644 pc-bios/dtb/meson.build rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%) rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)

MAINTAINERS +0 -0
index 661a47db5ac..d82d962f1a4 100644
@@ -1581,7 +1581,7 @@ F: hw/pci-host/ppc440_pcix.c

F: hw/display/sm501*
F: hw/ide/sii3112.c
F: hw/rtc/m41t80.c

MAINTAINERS +1 -1
-F: pc-bios/canyonlands.dt[sb]
+F: pc-bios/dtb/canyonlands.dt[sb]

F: pc-bios/u-boot-sam460ex-20100605.bin
F: roms/u-boot-sam460ex
F: docs/system/ppc/amigang.rst

system/datadir.c +0 -0
index e450b84ce91..f96f8fc2646 100644
@@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char 
 *name)
 
     switch (type) {

    case QEMU_FILE_TYPE_BIOS:
-    case QEMU_FILE_TYPE_DTB:
        subdir = "";
        break;
+    case QEMU_FILE_TYPE_DTB:
+        subdir = "dtb/";
+        break;
    case QEMU_FILE_TYPE_KEYMAP:
        subdir = "keymaps/";
        break;

pc-bios/dtb/bamboo.dtb renamed from pc-bios/bamboo.dtb +0 -0
similarity index 100%
rename from pc-bios/bamboo.dtb
rename to pc-bios/dtb/bamboo.dtb
pc-bios/dtb/bamboo.dts renamed from pc-bios/bamboo.dts +0 -0
similarity index 100%
rename from pc-bios/bamboo.dts
rename to pc-bios/dtb/bamboo.dts
pc-bios/dtb/canyonlands.dtb renamed from pc-bios/canyonlands.dtb +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dtb
rename to pc-bios/dtb/canyonlands.dtb
pc-bios/dtb/canyonlands.dts renamed from pc-bios/canyonlands.dts +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dts
rename to pc-bios/dtb/canyonlands.dts
pc-bios/dtb/meson.build new file +0 -0
new file mode 100644
index 00000000000..7a71835bca7

pc-bios/dtb/meson.build line 5

Quoted 5 lines
pc-bios/dtb/meson.build new file +5 -0
@@ -0,0 +1,23 @@
+dtbs = [
+  'bamboo.dtb',
+  'canyonlands.dtb',
+  'petalogix-ml605.dtb',
+  'petalogix-s3adsp1800.dtb',

Was it intended that the suffix changed from .dts to .dtb? This change isn't motivated in the commit message and usually source files rather than generated artifacts are listed in build files.

Quoted 3 lines
Quoted 1 line

I think I either found similar python code somewhere and followed that because meson and python is not something I understand well. Or changed it because we always need the list of dtbs to install but only need the dts when compiling so this way we don't need another list or replacing suffix twice.

Should we revert?

Why? It works just lists the build targets instead of source files to avoid converting between the two twice. So what it does was not contested only the way it was implemented had a nit. I don't think this is worth changing because of that.

Regards,
BALATON Zoltan

#58 lore raw

Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir

Quoted 100 lines · BALATON Zoltan
Quoted 99 lines · Philippe Mathieu-Daudé
Quoted 98 lines · BALATON Zoltan
Quoted 96 lines · Bernhard Beschow

Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 88 lines

From: BALATON Zoltan <[email protected]>

We have several device tree files already and may have more in the future so add a new dtb subdirectory and move device tree files there so they are not mixed with ROM binaries.

Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>

---
MAINTAINERS                                |   2 +- system/datadir.c                           |   4 +++- pc-bios/{ => dtb}/bamboo.dtb               | Bin
pc-bios/{ => dtb}/bamboo.dts               |   0
pc-bios/{ => dtb}/canyonlands.dtb          | Bin
pc-bios/{ => dtb}/canyonlands.dts          |   0 pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++ pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0 pc-bios/meson.build                        |  23 +-------------------- qemu.nsi                                   |   2 +-

13 files changed, 29 insertions(+), 25 deletions(-)

rename pc-bios/{ => dtb}/bamboo.dtb (100%) rename pc-bios/{ => dtb}/bamboo.dts (100%) rename pc-bios/{ => dtb}/canyonlands.dtb (100%) rename pc-bios/{ => dtb}/canyonlands.dts (100%) create mode 100644 pc-bios/dtb/meson.build rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%) rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)

MAINTAINERS +0 -0
index 661a47db5ac..d82d962f1a4 100644
@@ -1581,7 +1581,7 @@ F: hw/pci-host/ppc440_pcix.c

F: hw/display/sm501*
F: hw/ide/sii3112.c
F: hw/rtc/m41t80.c

MAINTAINERS +1 -1
-F: pc-bios/canyonlands.dt[sb]
+F: pc-bios/dtb/canyonlands.dt[sb]

F: pc-bios/u-boot-sam460ex-20100605.bin
F: roms/u-boot-sam460ex
F: docs/system/ppc/amigang.rst

system/datadir.c +0 -0
index e450b84ce91..f96f8fc2646 100644
@@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const 
 char *name)
 
     switch (type) {

    case QEMU_FILE_TYPE_BIOS:
-    case QEMU_FILE_TYPE_DTB:
        subdir = "";
        break;
+    case QEMU_FILE_TYPE_DTB:
+        subdir = "dtb/";
+        break;
    case QEMU_FILE_TYPE_KEYMAP:
        subdir = "keymaps/";
        break;

pc-bios/dtb/bamboo.dtb renamed from pc-bios/bamboo.dtb +0 -0
similarity index 100%
rename from pc-bios/bamboo.dtb
rename to pc-bios/dtb/bamboo.dtb
pc-bios/dtb/bamboo.dts renamed from pc-bios/bamboo.dts +0 -0
similarity index 100%
rename from pc-bios/bamboo.dts
rename to pc-bios/dtb/bamboo.dts
pc-bios/dtb/canyonlands.dtb renamed from pc-bios/canyonlands.dtb +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dtb
rename to pc-bios/dtb/canyonlands.dtb
pc-bios/dtb/canyonlands.dts renamed from pc-bios/canyonlands.dts +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dts
rename to pc-bios/dtb/canyonlands.dts
pc-bios/dtb/meson.build new file +0 -0
new file mode 100644
index 00000000000..7a71835bca7

pc-bios/dtb/meson.build line 5

Quoted 5 lines
pc-bios/dtb/meson.build new file +5 -0
@@ -0,0 +1,23 @@
+dtbs = [
+  'bamboo.dtb',
+  'canyonlands.dtb',
+  'petalogix-ml605.dtb',
+  'petalogix-s3adsp1800.dtb',

Was it intended that the suffix changed from .dts to .dtb? This change isn't motivated in the commit message and usually source files rather than generated artifacts are listed in build files.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

I think I either found similar python code somewhere and followed that because meson and python is not something I understand well. Or changed it because we always need the list of dtbs to install but only need the dts when compiling so this way we don't need another list or replacing suffix twice.

Should we revert?

Why? It works just lists the build targets instead of source files to avoid converting between the two twice. So what it does was not contested only the way it was implemented had a nit. I don't think this is worth changing because of that.

Well, it is a hidden change that wasn't noticed during review.

#59 lore raw

Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir

In reply to Philippe Mathieu-Daudé

Am 2. Juni 2025 08:12:39 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 98 lines · BALATON Zoltan
Quoted 97 lines · Bernhard Beschow
Quoted 95 lines

Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 87 lines

From: BALATON Zoltan <[email protected]>

We have several device tree files already and may have more in the future so add a new dtb subdirectory and move device tree files there so they are not mixed with ROM binaries.

Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>

---
MAINTAINERS                                |   2 +- system/datadir.c                           |   4 +++- pc-bios/{ => dtb}/bamboo.dtb               | Bin
pc-bios/{ => dtb}/bamboo.dts               |   0
pc-bios/{ => dtb}/canyonlands.dtb          | Bin
pc-bios/{ => dtb}/canyonlands.dts          |   0 pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++ pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0 pc-bios/meson.build                        |  23 +-------------------- qemu.nsi                                   |   2 +-

13 files changed, 29 insertions(+), 25 deletions(-)

rename pc-bios/{ => dtb}/bamboo.dtb (100%) rename pc-bios/{ => dtb}/bamboo.dts (100%) rename pc-bios/{ => dtb}/canyonlands.dtb (100%) rename pc-bios/{ => dtb}/canyonlands.dts (100%) create mode 100644 pc-bios/dtb/meson.build rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%) rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)

MAINTAINERS +0 -0
index 661a47db5ac..d82d962f1a4 100644
@@ -1581,7 +1581,7 @@ F: hw/pci-host/ppc440_pcix.c

F: hw/display/sm501*
F: hw/ide/sii3112.c
F: hw/rtc/m41t80.c

MAINTAINERS +1 -1
-F: pc-bios/canyonlands.dt[sb]
+F: pc-bios/dtb/canyonlands.dt[sb]

F: pc-bios/u-boot-sam460ex-20100605.bin
F: roms/u-boot-sam460ex
F: docs/system/ppc/amigang.rst

system/datadir.c +0 -0
index e450b84ce91..f96f8fc2646 100644
@@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char *name)
 
     switch (type) {

    case QEMU_FILE_TYPE_BIOS:
-    case QEMU_FILE_TYPE_DTB:
        subdir = "";
        break;
+    case QEMU_FILE_TYPE_DTB:
+        subdir = "dtb/";
+        break;
    case QEMU_FILE_TYPE_KEYMAP:
        subdir = "keymaps/";
        break;

pc-bios/dtb/bamboo.dtb renamed from pc-bios/bamboo.dtb +0 -0
similarity index 100%
rename from pc-bios/bamboo.dtb
rename to pc-bios/dtb/bamboo.dtb
pc-bios/dtb/bamboo.dts renamed from pc-bios/bamboo.dts +0 -0
similarity index 100%
rename from pc-bios/bamboo.dts
rename to pc-bios/dtb/bamboo.dts
pc-bios/dtb/canyonlands.dtb renamed from pc-bios/canyonlands.dtb +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dtb
rename to pc-bios/dtb/canyonlands.dtb
pc-bios/dtb/canyonlands.dts renamed from pc-bios/canyonlands.dts +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dts
rename to pc-bios/dtb/canyonlands.dts
pc-bios/dtb/meson.build new file +0 -0
new file mode 100644
index 00000000000..7a71835bca7

pc-bios/dtb/meson.build line 5

Quoted 5 lines
pc-bios/dtb/meson.build new file +5 -0
@@ -0,0 +1,23 @@
+dtbs = [
+  'bamboo.dtb',
+  'canyonlands.dtb',
+  'petalogix-ml605.dtb',
+  'petalogix-s3adsp1800.dtb',

Was it intended that the suffix changed from .dts to .dtb? This change isn't motivated in the commit message and usually source files rather than generated artifacts are listed in build files.

Quoted 3 lines
Quoted 1 line

I think I either found similar python code somewhere and followed that because meson and python is not something I understand well. Or changed it because we always need the list of dtbs to install but only need the dts when compiling so this way we don't need another list or replacing suffix twice.

Should we revert?

What's the idea behind having dtbs in the repository instead of making dtc mandatory? If there is any perspective that we could remove the dtbs in the future I vote for restoring the original logic. I could send a patch since I have further dtb fixes for the e500 and arm.

Best regards,
Bernhard

#60 lore raw

Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir

Quoted 101 lines · Bernhard Beschow

Am 2. Juni 2025 08:12:39 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 98 lines · BALATON Zoltan
Quoted 97 lines · Bernhard Beschow
Quoted 95 lines

Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 87 lines

From: BALATON Zoltan <[email protected]>

We have several device tree files already and may have more in the future so add a new dtb subdirectory and move device tree files there so they are not mixed with ROM binaries.

Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>

---
MAINTAINERS                                |   2 +- system/datadir.c                           |   4 +++- pc-bios/{ => dtb}/bamboo.dtb               | Bin
pc-bios/{ => dtb}/bamboo.dts               |   0
pc-bios/{ => dtb}/canyonlands.dtb          | Bin
pc-bios/{ => dtb}/canyonlands.dts          |   0 pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++ pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0 pc-bios/meson.build                        |  23 +-------------------- qemu.nsi                                   |   2 +-

13 files changed, 29 insertions(+), 25 deletions(-)

rename pc-bios/{ => dtb}/bamboo.dtb (100%) rename pc-bios/{ => dtb}/bamboo.dts (100%) rename pc-bios/{ => dtb}/canyonlands.dtb (100%) rename pc-bios/{ => dtb}/canyonlands.dts (100%) create mode 100644 pc-bios/dtb/meson.build rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%) rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)

MAINTAINERS +0 -0
index 661a47db5ac..d82d962f1a4 100644
@@ -1581,7 +1581,7 @@ F: hw/pci-host/ppc440_pcix.c

F: hw/display/sm501*
F: hw/ide/sii3112.c
F: hw/rtc/m41t80.c

MAINTAINERS +1 -1
-F: pc-bios/canyonlands.dt[sb]
+F: pc-bios/dtb/canyonlands.dt[sb]

F: pc-bios/u-boot-sam460ex-20100605.bin
F: roms/u-boot-sam460ex
F: docs/system/ppc/amigang.rst

system/datadir.c +3 -1
index e450b84ce91..f96f8fc2646 100644
@@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char *name)
 
     switch (type) {
     case QEMU_FILE_TYPE_BIOS:
-    case QEMU_FILE_TYPE_DTB:
         subdir = "";
         break;
+    case QEMU_FILE_TYPE_DTB:
+        subdir = "dtb/";
+        break;
     case QEMU_FILE_TYPE_KEYMAP:
         subdir = "keymaps/";
         break;
pc-bios/dtb/bamboo.dtb renamed from pc-bios/bamboo.dtb +0 -0
similarity index 100%
rename from pc-bios/bamboo.dtb
rename to pc-bios/dtb/bamboo.dtb
pc-bios/dtb/bamboo.dts renamed from pc-bios/bamboo.dts +0 -0
similarity index 100%
rename from pc-bios/bamboo.dts
rename to pc-bios/dtb/bamboo.dts
pc-bios/dtb/canyonlands.dtb renamed from pc-bios/canyonlands.dtb +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dtb
rename to pc-bios/dtb/canyonlands.dtb
pc-bios/dtb/canyonlands.dts renamed from pc-bios/canyonlands.dts +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dts
rename to pc-bios/dtb/canyonlands.dts
pc-bios/dtb/meson.build new file +0 -0
new file mode 100644
index 00000000000..7a71835bca7

pc-bios/dtb/meson.build line 5

Quoted 5 lines
pc-bios/dtb/meson.build new file +5 -0
@@ -0,0 +1,23 @@
+dtbs = [
+  'bamboo.dtb',
+  'canyonlands.dtb',
+  'petalogix-ml605.dtb',
+  'petalogix-s3adsp1800.dtb',

Was it intended that the suffix changed from .dts to .dtb? This change isn't motivated in the commit message and usually source files rather than generated artifacts are listed in build files.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

I think I either found similar python code somewhere and followed that because meson and python is not something I understand well. Or changed it because we always need the list of dtbs to install but only need the dts when compiling so this way we don't need another list or replacing suffix twice.

Should we revert?

What's the idea behind having dtbs in the repository instead of making dtc mandatory? If there is any perspective that we could remove the dtbs in the future I vote for restoring the original logic. I could send a patch since I have further dtb fixes for the e500 and arm.

IMHO since we require libfdt for many boards already anyway, we could also require dtc for these boards that need a dtb (and disable them if dtc is not available) ... we just might need some additional Kconfig symbol for that case since dtc and libfdt are sometimes shipped in different packages on the various distros and thus could be installed independently from each other.

Thomas

#61 lore raw

Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir

Am 3. Juni 2025 11:38:59 UTC schrieb Thomas Huth <[email protected]>:

Quoted 102 lines · Bernhard Beschow
Quoted 101 lines

Am 2. Juni 2025 08:12:39 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 98 lines · BALATON Zoltan
Quoted 97 lines · Bernhard Beschow
Quoted 95 lines

Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 87 lines

From: BALATON Zoltan <[email protected]>

We have several device tree files already and may have more in the future so add a new dtb subdirectory and move device tree files there so they are not mixed with ROM binaries.

Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>

---
MAINTAINERS                                |   2 +- system/datadir.c                           |   4 +++- pc-bios/{ => dtb}/bamboo.dtb               | Bin
pc-bios/{ => dtb}/bamboo.dts               |   0
pc-bios/{ => dtb}/canyonlands.dtb          | Bin
pc-bios/{ => dtb}/canyonlands.dts          |   0 pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++ pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0 pc-bios/meson.build                        |  23 +-------------------- qemu.nsi                                   |   2 +-

13 files changed, 29 insertions(+), 25 deletions(-)

rename pc-bios/{ => dtb}/bamboo.dtb (100%) rename pc-bios/{ => dtb}/bamboo.dts (100%) rename pc-bios/{ => dtb}/canyonlands.dtb (100%) rename pc-bios/{ => dtb}/canyonlands.dts (100%) create mode 100644 pc-bios/dtb/meson.build rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%) rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)

MAINTAINERS +0 -0
index 661a47db5ac..d82d962f1a4 100644
@@ -1581,7 +1581,7 @@ F: hw/pci-host/ppc440_pcix.c

F: hw/display/sm501*
F: hw/ide/sii3112.c
F: hw/rtc/m41t80.c

MAINTAINERS +1 -1
-F: pc-bios/canyonlands.dt[sb]
+F: pc-bios/dtb/canyonlands.dt[sb]

F: pc-bios/u-boot-sam460ex-20100605.bin
F: roms/u-boot-sam460ex
F: docs/system/ppc/amigang.rst

system/datadir.c +3 -1
index e450b84ce91..f96f8fc2646 100644
@@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char *name)
 
     switch (type) {
     case QEMU_FILE_TYPE_BIOS:
-    case QEMU_FILE_TYPE_DTB:
         subdir = "";
         break;
+    case QEMU_FILE_TYPE_DTB:
+        subdir = "dtb/";
+        break;
     case QEMU_FILE_TYPE_KEYMAP:
         subdir = "keymaps/";
         break;
pc-bios/dtb/bamboo.dtb renamed from pc-bios/bamboo.dtb +0 -0
similarity index 100%
rename from pc-bios/bamboo.dtb
rename to pc-bios/dtb/bamboo.dtb
pc-bios/dtb/bamboo.dts renamed from pc-bios/bamboo.dts +0 -0
similarity index 100%
rename from pc-bios/bamboo.dts
rename to pc-bios/dtb/bamboo.dts
pc-bios/dtb/canyonlands.dtb renamed from pc-bios/canyonlands.dtb +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dtb
rename to pc-bios/dtb/canyonlands.dtb
pc-bios/dtb/canyonlands.dts renamed from pc-bios/canyonlands.dts +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dts
rename to pc-bios/dtb/canyonlands.dts
pc-bios/dtb/meson.build new file +0 -0
new file mode 100644
index 00000000000..7a71835bca7

pc-bios/dtb/meson.build line 5

Quoted 5 lines
pc-bios/dtb/meson.build new file +5 -0
@@ -0,0 +1,23 @@
+dtbs = [
+  'bamboo.dtb',
+  'canyonlands.dtb',
+  'petalogix-ml605.dtb',
+  'petalogix-s3adsp1800.dtb',

Was it intended that the suffix changed from .dts to .dtb? This change isn't motivated in the commit message and usually source files rather than generated artifacts are listed in build files.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

I think I either found similar python code somewhere and followed that because meson and python is not something I understand well. Or changed it because we always need the list of dtbs to install but only need the dts when compiling so this way we don't need another list or replacing suffix twice.

Should we revert?

What's the idea behind having dtbs in the repository instead of making dtc mandatory? If there is any perspective that we could remove the dtbs in the future I vote for restoring the original logic. I could send a patch since I have further dtb fixes for the e500 and arm.

IMHO since we require libfdt for many boards already anyway, we could also require dtc for these boards that need a dtb (and disable them if dtc is not available) ... we just might need some additional Kconfig symbol for that case since dtc and libfdt are sometimes shipped in different packages on the various distros and thus could be installed independently from each other.

I'd try that, and I have some ideas on how to make this work similar to how we deal with .c files. I could then use this mechanism in my e500-fdt branch. Let's see...

Best regards,
Bernhard

Quoted 3 lines

Thomas

#62 lore raw

Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir

Am 4. Juni 2025 09:59:44 UTC schrieb Bernhard Beschow <[email protected]>:

Quoted 107 lines

Am 3. Juni 2025 11:38:59 UTC schrieb Thomas Huth <[email protected]>:

Quoted 104 lines · Bernhard Beschow
Quoted 103 lines

Am 2. Juni 2025 08:12:39 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 100 lines · BALATON Zoltan
Quoted 98 lines · Bernhard Beschow
Quoted 87 lines

Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 86 lines

From: BALATON Zoltan <[email protected]>

We have several device tree files already and may have more in the future so add a new dtb subdirectory and move device tree files there so they are not mixed with ROM binaries.

Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>

---
MAINTAINERS                                |   2 +- system/datadir.c                           |   4 +++- pc-bios/{ => dtb}/bamboo.dtb               | Bin
pc-bios/{ => dtb}/bamboo.dts               |   0
pc-bios/{ => dtb}/canyonlands.dtb          | Bin
pc-bios/{ => dtb}/canyonlands.dts          |   0 pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++ pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0 pc-bios/meson.build                        |  23 +-------------------- qemu.nsi                                   |   2 +-

13 files changed, 29 insertions(+), 25 deletions(-)

rename pc-bios/{ => dtb}/bamboo.dtb (100%) rename pc-bios/{ => dtb}/bamboo.dts (100%) rename pc-bios/{ => dtb}/canyonlands.dtb (100%) rename pc-bios/{ => dtb}/canyonlands.dts (100%) create mode 100644 pc-bios/dtb/meson.build rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%) rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)

MAINTAINERS +0 -0
index 661a47db5ac..d82d962f1a4 100644
@@ -1581,7 +1581,7 @@ F: hw/pci-host/ppc440_pcix.c

F: hw/display/sm501*
F: hw/ide/sii3112.c
F: hw/rtc/m41t80.c

MAINTAINERS +1 -1
-F: pc-bios/canyonlands.dt[sb]
+F: pc-bios/dtb/canyonlands.dt[sb]

F: pc-bios/u-boot-sam460ex-20100605.bin
F: roms/u-boot-sam460ex
F: docs/system/ppc/amigang.rst

system/datadir.c +3 -1
index e450b84ce91..f96f8fc2646 100644
@@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char *name)
 
     switch (type) {
     case QEMU_FILE_TYPE_BIOS:
-    case QEMU_FILE_TYPE_DTB:
         subdir = "";
         break;
+    case QEMU_FILE_TYPE_DTB:
+        subdir = "dtb/";
+        break;
     case QEMU_FILE_TYPE_KEYMAP:
         subdir = "keymaps/";
         break;
pc-bios/dtb/bamboo.dtb renamed from pc-bios/bamboo.dtb +0 -0
similarity index 100%
rename from pc-bios/bamboo.dtb
rename to pc-bios/dtb/bamboo.dtb
pc-bios/dtb/bamboo.dts renamed from pc-bios/bamboo.dts +0 -0
similarity index 100%
rename from pc-bios/bamboo.dts
rename to pc-bios/dtb/bamboo.dts
pc-bios/dtb/canyonlands.dtb renamed from pc-bios/canyonlands.dtb +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dtb
rename to pc-bios/dtb/canyonlands.dtb
pc-bios/dtb/canyonlands.dts renamed from pc-bios/canyonlands.dts +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dts
rename to pc-bios/dtb/canyonlands.dts
pc-bios/dtb/meson.build new file +0 -0
new file mode 100644
index 00000000000..7a71835bca7
Quoted 8 lines

pc-bios/dtb/meson.build line 5

Quoted 6 lines
pc-bios/dtb/meson.build new file +5 -0
@@ -0,0 +1,23 @@
+dtbs = [
+  'bamboo.dtb',
+  'canyonlands.dtb',
+  'petalogix-ml605.dtb',
+  'petalogix-s3adsp1800.dtb',

Was it intended that the suffix changed from .dts to .dtb? This change isn't motivated in the commit message and usually source files rather than generated artifacts are listed in build files.

I think I either found similar python code somewhere and followed that because meson and python is not something I understand well. Or changed it because we always need the list of dtbs to install but only need the dts when compiling so this way we don't need another list or replacing suffix twice.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Should we revert?

What's the idea behind having dtbs in the repository instead of making dtc mandatory? If there is any perspective that we could remove the dtbs in the future I vote for restoring the original logic. I could send a patch since I have further dtb fixes for the e500 and arm.

IMHO since we require libfdt for many boards already anyway, we could also require dtc for these boards that need a dtb (and disable them if dtc is not available) ... we just might need some additional Kconfig symbol for that case since dtc and libfdt are sometimes shipped in different packages on the various distros and thus could be installed independently from each other.

I'd try that, and I have some ideas on how to make this work similar to how we deal with .c files. I could then use this mechanism in my e500-fdt branch. Let's see...

Series is out: <https://lore.kernel.org/qemu-devel/[email protected]/>

Best regards,
Bernhard

Quoted 6 lines

Best regards,
Bernhard

Quoted 3 lines

Thomas

#63 lore raw

Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir

In reply to Bernhard Beschow
Quoted 99 lines · Bernhard Beschow

Am 2. Juni 2025 08:12:39 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 98 lines · BALATON Zoltan
Quoted 97 lines · Bernhard Beschow
Quoted 95 lines

Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 87 lines

From: BALATON Zoltan <[email protected]>

We have several device tree files already and may have more in the future so add a new dtb subdirectory and move device tree files there so they are not mixed with ROM binaries.

Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>

---
MAINTAINERS                                |   2 +- system/datadir.c                           |   4 +++- pc-bios/{ => dtb}/bamboo.dtb               | Bin
pc-bios/{ => dtb}/bamboo.dts               |   0
pc-bios/{ => dtb}/canyonlands.dtb          | Bin
pc-bios/{ => dtb}/canyonlands.dts          |   0 pc-bios/dtb/meson.build                    |  23 +++++++++++++++++++++ pc-bios/{ => dtb}/petalogix-ml605.dtb      | Bin
pc-bios/{ => dtb}/petalogix-ml605.dts      |   0
pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb | Bin
pc-bios/{ => dtb}/petalogix-s3adsp1800.dts |   0 pc-bios/meson.build                        |  23 +-------------------- qemu.nsi                                   |   2 +-

13 files changed, 29 insertions(+), 25 deletions(-)

rename pc-bios/{ => dtb}/bamboo.dtb (100%) rename pc-bios/{ => dtb}/bamboo.dts (100%) rename pc-bios/{ => dtb}/canyonlands.dtb (100%) rename pc-bios/{ => dtb}/canyonlands.dts (100%) create mode 100644 pc-bios/dtb/meson.build rename pc-bios/{ => dtb}/petalogix-ml605.dtb (100%) rename pc-bios/{ => dtb}/petalogix-ml605.dts (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dtb (100%) rename pc-bios/{ => dtb}/petalogix-s3adsp1800.dts (100%)

MAINTAINERS +0 -0
index 661a47db5ac..d82d962f1a4 100644
@@ -1581,7 +1581,7 @@ F: hw/pci-host/ppc440_pcix.c

F: hw/display/sm501*
F: hw/ide/sii3112.c
F: hw/rtc/m41t80.c

MAINTAINERS +1 -1
-F: pc-bios/canyonlands.dt[sb]
+F: pc-bios/dtb/canyonlands.dt[sb]

F: pc-bios/u-boot-sam460ex-20100605.bin
F: roms/u-boot-sam460ex
F: docs/system/ppc/amigang.rst

system/datadir.c +0 -0
index e450b84ce91..f96f8fc2646 100644
@@ -44,9 +44,11 @@ char *qemu_find_file(QemuFileType type, const char *name)
 
     switch (type) {

    case QEMU_FILE_TYPE_BIOS:
-    case QEMU_FILE_TYPE_DTB:
        subdir = "";
        break;
+    case QEMU_FILE_TYPE_DTB:
+        subdir = "dtb/";
+        break;
    case QEMU_FILE_TYPE_KEYMAP:
        subdir = "keymaps/";
        break;

pc-bios/dtb/bamboo.dtb renamed from pc-bios/bamboo.dtb +0 -0
similarity index 100%
rename from pc-bios/bamboo.dtb
rename to pc-bios/dtb/bamboo.dtb
pc-bios/dtb/bamboo.dts renamed from pc-bios/bamboo.dts +0 -0
similarity index 100%
rename from pc-bios/bamboo.dts
rename to pc-bios/dtb/bamboo.dts
pc-bios/dtb/canyonlands.dtb renamed from pc-bios/canyonlands.dtb +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dtb
rename to pc-bios/dtb/canyonlands.dtb
pc-bios/dtb/canyonlands.dts renamed from pc-bios/canyonlands.dts +0 -0
similarity index 100%
rename from pc-bios/canyonlands.dts
rename to pc-bios/dtb/canyonlands.dts
pc-bios/dtb/meson.build new file +0 -0
new file mode 100644
index 00000000000..7a71835bca7

pc-bios/dtb/meson.build line 5

Quoted 5 lines
pc-bios/dtb/meson.build new file +5 -0
@@ -0,0 +1,23 @@
+dtbs = [
+  'bamboo.dtb',
+  'canyonlands.dtb',
+  'petalogix-ml605.dtb',
+  'petalogix-s3adsp1800.dtb',

Was it intended that the suffix changed from .dts to .dtb? This change isn't motivated in the commit message and usually source files rather than generated artifacts are listed in build files.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

I think I either found similar python code somewhere and followed that because meson and python is not something I understand well. Or changed it because we always need the list of dtbs to install but only need the dts when compiling so this way we don't need another list or replacing suffix twice.

Should we revert?

What's the idea behind having dtbs in the repository instead of making dtc mandatory? If there is any perspective that we could remove the dtbs in the future I vote for restoring the original logic. I could send a patch since I have further dtb fixes for the e500 and arm.

This patch did not change that, dtbs were already there so this is a proposed unrelated further change. Reverting the patch leaves you with dtb and dts files mixed with rom binaries. This patch only aimed to separate device tree files from rom binaries. So you're nitpicking if the array in the makefile should list dts or dtb files while both of them are there so I don't think it matters much which are listed. Dtbs are used when dtc is not found and only installing pre-built files while list of dts is only needed when building from dts and it is easy to replace the extension so if you want we can change it to list dts at the expense of adding one extra line to make the dtb array without dtc. I saved that one line by listing dtbs.

Now you propose another change to drop dtbs and always build from dts. I'm not against that but that's not related to this patch. I think dtbs were included for convenience so we don't need dtc.

Regards,
BALATON Zoltan

#64 lore raw

[PULL 53/58] cpus: Move target-agnostic methods out of cpu-target.c

In reply to Philippe Mathieu-Daudé

Various methods of cpu-target.c don't use any target-specific knowledge at all and can be built once in the target-agnostic cpu-common.c file.

Message-Id: <[email protected]>

---
 cpu-target.c         | 77 +-------------------------------------------
 hw/core/cpu-common.c | 74 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+), 76 deletions(-)
cpu-target.c +1 -76
index c2dd590d48a..b5645ff0dbb 100644
@@ -19,94 +19,19 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
-#include "qapi/error.h"
-#include "qemu/error-report.h"
-#include "qemu/qemu-print.h"
-#include "qemu/target-info.h"
 #include "system/accel-ops.h"
 #include "system/cpus.h"
 #include "exec/cpu-common.h"
 #include "exec/tswap.h"
 #include "exec/replay-core.h"
 #include "exec/log.h"
-#include "accel/accel-cpu-target.h"
+#include "hw/core/cpu.h"
 #include "trace/trace-root.h"
 
 /* Validate correct placement of CPUArchState. */
 QEMU_BUILD_BUG_ON(offsetof(ArchCPU, parent_obj) != 0);
 QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) != sizeof(CPUState));
 
-char *cpu_model_from_type(const char *typename)
-{
-    g_autofree char *suffix = g_strdup_printf("-%s", target_cpu_type());
-
-    if (!object_class_by_name(typename)) {
-        return NULL;
-    }
-
-    if (g_str_has_suffix(typename, suffix)) {
-        return g_strndup(typename, strlen(typename) - strlen(suffix));
-    }
-
-    return g_strdup(typename);
-}
-
-const char *parse_cpu_option(const char *cpu_option)
-{
-    ObjectClass *oc;
-    CPUClass *cc;
-    gchar **model_pieces;
-    const char *cpu_type;
-
-    model_pieces = g_strsplit(cpu_option, ",", 2);
-    if (!model_pieces[0]) {
-        error_report("-cpu option cannot be empty");
-        exit(1);
-    }
-
-    oc = cpu_class_by_name(target_cpu_type(), model_pieces[0]);
-    if (oc == NULL) {
-        error_report("unable to find CPU model '%s'", model_pieces[0]);
-        g_strfreev(model_pieces);
-        exit(EXIT_FAILURE);
-    }
-
-    cpu_type = object_class_get_name(oc);
-    cc = CPU_CLASS(oc);
-    cc->parse_features(cpu_type, model_pieces[1], &error_fatal);
-    g_strfreev(model_pieces);
-    return cpu_type;
-}
-
-static void cpu_list_entry(gpointer data, gpointer user_data)
-{
-    CPUClass *cc = CPU_CLASS(OBJECT_CLASS(data));
-    const char *typename = object_class_get_name(OBJECT_CLASS(data));
-    g_autofree char *model = cpu_model_from_type(typename);
-
-    if (cc->deprecation_note) {
-        qemu_printf("  %s (deprecated)\n", model);
-    } else {
-        qemu_printf("  %s\n", model);
-    }
-}
-
-void list_cpus(void)
-{
-    CPUClass *cc = CPU_CLASS(object_class_by_name(target_cpu_type()));
-
-    if (cc->list_cpus) {
-        cc->list_cpus();
-    } else {
-        GSList *list;
-
-        list = object_class_get_list_sorted(TYPE_CPU, false);
-        qemu_printf("Available CPUs:\n");
-        g_slist_foreach(list, cpu_list_entry, NULL);
-        g_slist_free(list);
-    }
-}
-
 /* enable or disable single step mode. EXCP_DEBUG is returned by the
    CPU loop after each instruction */
 void cpu_single_step(CPUState *cpu, int enabled)
hw/core/cpu-common.c +74 -0

95 lines not on this page · raw message

Signature · 1 line
2.47.1
#65 lore raw

[PULL 54/58] accel: Implement accel_init_ops_interfaces() for both system/user mode

In reply to Philippe Mathieu-Daudé

We want to build more common code, moving objects from meson's specific_ss[] set to common_ss[]. Since the CONFIG_USER_ONLY definitions isn't applied on the common_ss[] set, it is simpler to add an empty accel_init_ops_interfaces() stub on user emulation, removing any CONFIG_USER_ONLY use in accel-target.c.

Message-Id: <[email protected]>

---
 MAINTAINERS                                |  2 +-
 accel/{accel-system.h => accel-internal.h} |  8 ++++----
 accel/accel-system.c                       |  4 ++--
 accel/accel-target.c                       | 10 ++--------
 accel/accel-user.c                         |  6 ++++++
 5 files changed, 15 insertions(+), 15 deletions(-)
 rename accel/{accel-system.h => accel-internal.h} (56%)
MAINTAINERS +1 -1
index 28b1e9ba443..07711cfd381 100644
@@ -500,7 +500,7 @@ F: include/qemu/target-info*.h
 F: include/system/accel-*.h
 F: include/system/cpus.h
 F: include/accel/accel-cpu-target.h
-F: accel/accel-*.c
+F: accel/accel-*.?
 F: accel/Makefile.objs
 F: accel/stubs/Makefile.objs
 F: cpu-common.c
accel/accel-internal.h renamed from accel/accel-system.h +4 -4
similarity index 56%
rename from accel/accel-system.h
rename to accel/accel-internal.h
index 2d37c73c97b..03426aa21ee 100644
@@ -1,5 +1,5 @@
 /*
- * QEMU System Emulation accel internal functions
+ * QEMU accel internal functions
  *
  * Copyright 2021 SUSE LLC
  *
@@ -7,9 +7,9 @@
  * See the COPYING file in the top-level directory.
  */
 
-#ifndef ACCEL_SYSTEM_H
-#define ACCEL_SYSTEM_H
+#ifndef ACCEL_INTERNAL_H
+#define ACCEL_INTERNAL_H
 
-void accel_system_init_ops_interfaces(AccelClass *ac);
+void accel_init_ops_interfaces(AccelClass *ac);
 
 #endif /* ACCEL_SYSTEM_H */
accel/accel-system.c +2 -2
index 5df49fbe831..a0f562ae9ff 100644
@@ -29,7 +29,7 @@
 #include "system/accel-ops.h"
 #include "system/cpus.h"
 #include "qemu/error-report.h"
-#include "accel-system.h"
+#include "accel-internal.h"
 
 int accel_init_machine(AccelState *accel, MachineState *ms)
 {
@@ -63,7 +63,7 @@ void accel_setup_post(MachineState *ms)
 }
 
 /* initialize the arch-independent accel operation interfaces */
-void accel_system_init_ops_interfaces(AccelClass *ac)
+void accel_init_ops_interfaces(AccelClass *ac)
 {
     const char *ac_name;
     char *ops_name;
accel/accel-target.c +2 -8
index 08d4e450bde..7f3bbf31a8b 100644
@@ -29,10 +29,7 @@
 
 #include "cpu.h"
 #include "accel/accel-cpu-target.h"
-
-#ifndef CONFIG_USER_ONLY
-#include "accel-system.h"
-#endif /* !CONFIG_USER_ONLY */
+#include "accel-internal.h"
 
 static const TypeInfo accel_type = {
     .name = TYPE_ACCEL,
@@ -106,10 +103,7 @@ static void accel_init_cpu_interfaces(AccelClass *ac)
 
 void accel_init_interfaces(AccelClass *ac)
 {
-#ifndef CONFIG_USER_ONLY
-    accel_system_init_ops_interfaces(ac);
-#endif /* !CONFIG_USER_ONLY */
-
+    accel_init_ops_interfaces(ac);
     accel_init_cpu_interfaces(ac);
 }
 
accel/accel-user.c +6 -0
index 22b6a1a1a89..7d192306a65 100644
@@ -9,6 +9,12 @@
 
 #include "qemu/osdep.h"
 #include "qemu/accel.h"
+#include "accel-internal.h"
+
+void accel_init_ops_interfaces(AccelClass *ac)
+{
+    /* nothing */
+}
 
 AccelState *current_accel(void)
 {
Signature · 1 line
2.47.1
#66 lore raw

[PULL 56/58] accel: Make AccelCPUClass structure target-agnostic

In reply to Philippe Mathieu-Daudé

Move the target-agnostic parts of "accel/accel-cpu-target.h" to "accel/accel-cpu.h".

Doing so we need to include missing "hw/core/cpu.h" header in "accel/accel-cpu.h" otherwise we get:

include/accel/accel-cpu-target.h:39:28: error: unknown type name 'CPUClass'

     39 |     void (*cpu_class_init)(CPUClass *cc);
        |                            ^

Message-Id: <[email protected]>

---
 MAINTAINERS                      |  2 +-
 include/accel/accel-cpu-target.h | 12 +-----------
 include/accel/accel-cpu.h        | 23 +++++++++++++++++++++++
 accel/accel-target.c             |  1 -
 4 files changed, 25 insertions(+), 13 deletions(-)
 create mode 100644 include/accel/accel-cpu.h
MAINTAINERS +1 -1
index 07711cfd381..59d97128199 100644
@@ -499,7 +499,7 @@ F: include/qemu/accel.h
 F: include/qemu/target-info*.h
 F: include/system/accel-*.h
 F: include/system/cpus.h
-F: include/accel/accel-cpu-target.h
+F: include/accel/accel-cpu*.h
 F: accel/accel-*.?
 F: accel/Makefile.objs
 F: accel/stubs/Makefile.objs
include/accel/accel-cpu-target.h +1 -11
index 37dde7fae3e..6feb344e29b 100644
@@ -21,21 +21,11 @@
  */
 
 #include "qom/object.h"
+#include "accel/accel-cpu.h"
 #include "cpu.h"
 
 #define TYPE_ACCEL_CPU "accel-" CPU_RESOLVING_TYPE
 #define ACCEL_CPU_NAME(name) (name "-" TYPE_ACCEL_CPU)
-typedef struct AccelCPUClass AccelCPUClass;
 DECLARE_CLASS_CHECKERS(AccelCPUClass, ACCEL_CPU, TYPE_ACCEL_CPU)
 
-typedef struct AccelCPUClass {
-    /*< private >*/
-    ObjectClass parent_class;
-    /*< public >*/
-
-    void (*cpu_class_init)(CPUClass *cc);
-    void (*cpu_instance_init)(CPUState *cpu);
-    bool (*cpu_target_realize)(CPUState *cpu, Error **errp);
-} AccelCPUClass;
-
 #endif /* ACCEL_CPU_H */
include/accel/accel-cpu.h new file +23 -0
new file mode 100644
index 00000000000..9e7eede7c3c
@@ -0,0 +1,23 @@
+/*
+ * Accelerator interface, specializes CPUClass
+ *
+ * Copyright 2021 SUSE LLC
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef ACCEL_CPU_H
+#define ACCEL_CPU_H
+
+#include "qom/object.h"
+#include "hw/core/cpu.h"
+
+typedef struct AccelCPUClass {
+    ObjectClass parent_class;
+
+    void (*cpu_class_init)(CPUClass *cc);
+    void (*cpu_instance_init)(CPUState *cpu);
+    bool (*cpu_target_realize)(CPUState *cpu, Error **errp);
+} AccelCPUClass;
+
+#endif /* ACCEL_CPU_H */
accel/accel-target.c +0 -1
index 7f3bbf31a8b..82a29e61476 100644
@@ -27,7 +27,6 @@
 #include "qemu/accel.h"
 #include "qemu/target-info.h"
 
-#include "cpu.h"
 #include "accel/accel-cpu-target.h"
 #include "accel-internal.h"
 
Signature · 1 line
2.47.1
#67 lore raw

[PULL 44/58] linux-user/elfload: Use target_needs_bswap()

In reply to Philippe Mathieu-Daudé

Check whether we need to swap at runtime using
target_needs_bswap().

Message-Id: <[email protected]>

---
 linux-user/elfload.c | 63 +++++++++++++++++++++++++++-----------------
 1 file changed, 39 insertions(+), 24 deletions(-)
linux-user/elfload.c +39 -24
index 99811af5e7b..fbfdec2f17c 100644
@@ -12,6 +12,7 @@
 #include "exec/page-protection.h"
 #include "exec/mmap-lock.h"
 #include "exec/translation-block.h"
+#include "exec/tswap.h"
 #include "user/guest-base.h"
 #include "user-internals.h"
 #include "signal-common.h"
@@ -2122,9 +2123,12 @@ static inline void memcpy_fromfs(void * to, const void * from, unsigned long n)
     memcpy(to, from, n);
 }
 
-#if HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN
 static void bswap_ehdr(struct elfhdr *ehdr)
 {
+    if (!target_needs_bswap()) {
+        return;
+    }
+
     bswap16s(&ehdr->e_type);            /* Object file type */
     bswap16s(&ehdr->e_machine);         /* Architecture */
     bswap32s(&ehdr->e_version);         /* Object file version */
@@ -2142,8 +2146,11 @@ static void bswap_ehdr(struct elfhdr *ehdr)
 
 static void bswap_phdr(struct elf_phdr *phdr, int phnum)
 {
-    int i;
-    for (i = 0; i < phnum; ++i, ++phdr) {
+    if (!target_needs_bswap()) {
+        return;
+    }
+
+    for (int i = 0; i < phnum; ++i, ++phdr) {
         bswap32s(&phdr->p_type);        /* Segment type */
         bswap32s(&phdr->p_flags);       /* Segment flags */
         bswaptls(&phdr->p_offset);      /* Segment file offset */
@@ -2157,8 +2164,11 @@ static void bswap_phdr(struct elf_phdr *phdr, int phnum)
 
 static void bswap_shdr(struct elf_shdr *shdr, int shnum)
 {
-    int i;
-    for (i = 0; i < shnum; ++i, ++shdr) {
+    if (!target_needs_bswap()) {
+        return;
+    }
+
+    for (int i = 0; i < shnum; ++i, ++shdr) {
         bswap32s(&shdr->sh_name);
         bswap32s(&shdr->sh_type);
         bswaptls(&shdr->sh_flags);
@@ -2174,6 +2184,10 @@ static void bswap_shdr(struct elf_shdr *shdr, int shnum)
 
 static void bswap_sym(struct elf_sym *sym)
 {
+    if (!target_needs_bswap()) {
+        return;
+    }
+
     bswap32s(&sym->st_name);
     bswaptls(&sym->st_value);
     bswaptls(&sym->st_size);
@@ -2183,6 +2197,10 @@ static void bswap_sym(struct elf_sym *sym)
 #ifdef TARGET_MIPS
 static void bswap_mips_abiflags(Mips_elf_abiflags_v0 *abiflags)
 {
+    if (!target_needs_bswap()) {
+        return;
+    }
+
     bswap16s(&abiflags->version);
     bswap32s(&abiflags->ases);
     bswap32s(&abiflags->isa_ext);
@@ -2190,15 +2208,6 @@ static void bswap_mips_abiflags(Mips_elf_abiflags_v0 *abiflags)
     bswap32s(&abiflags->flags2);
 }
 #endif
-#else
-static inline void bswap_ehdr(struct elfhdr *ehdr) { }
-static inline void bswap_phdr(struct elf_phdr *phdr, int phnum) { }
-static inline void bswap_shdr(struct elf_shdr *shdr, int shnum) { }
-static inline void bswap_sym(struct elf_sym *sym) { }
-#ifdef TARGET_MIPS
-static inline void bswap_mips_abiflags(Mips_elf_abiflags_v0 *abiflags) { }
-#endif
-#endif
 
 #ifdef USE_ELF_CORE_DUMP
 static int elf_core_dump(int, const CPUArchState *);
@@ -3144,11 +3153,11 @@ static bool parse_elf_properties(const ImageSource *src,
      * The contents of a valid PT_GNU_PROPERTY is a sequence of uint32_t.
      * Swap most of them now, beyond the header and namesz.
      */
-#if HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN
-    for (int i = 4; i < n / 4; i++) {
-        bswap32s(note.data + i);
+    if (target_needs_bswap()) {
+        for (int i = 4; i < n / 4; i++) {
+            bswap32s(note.data + i);
+        }
     }
-#endif
 
     /*
      * Note that nhdr is 3 words, and that the "name" described by namesz
@@ -4000,9 +4009,12 @@ struct target_elf_prpsinfo {
     char    pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
 };
 
-#if HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN
 static void bswap_prstatus(struct target_elf_prstatus *prstatus)
 {
+    if (!target_needs_bswap()) {
+        return;
+    }
+
     prstatus->pr_info.si_signo = tswap32(prstatus->pr_info.si_signo);
     prstatus->pr_info.si_code = tswap32(prstatus->pr_info.si_code);
     prstatus->pr_info.si_errno = tswap32(prstatus->pr_info.si_errno);
@@ -4020,6 +4032,10 @@ static void bswap_prstatus(struct target_elf_prstatus *prstatus)
 
 static void bswap_psinfo(struct target_elf_prpsinfo *psinfo)
 {
+    if (!target_needs_bswap()) {
+        return;
+    }
+
     psinfo->pr_flag = tswapal(psinfo->pr_flag);
     psinfo->pr_uid = tswap16(psinfo->pr_uid);
     psinfo->pr_gid = tswap16(psinfo->pr_gid);
@@ -4031,15 +4047,14 @@ static void bswap_psinfo(struct target_elf_prpsinfo *psinfo)
 
 static void bswap_note(struct elf_note *en)
 {
+    if (!target_needs_bswap()) {
+        return;
+    }
+
     bswap32s(&en->n_namesz);
     bswap32s(&en->n_descsz);
     bswap32s(&en->n_type);
 }
-#else
-static inline void bswap_prstatus(struct target_elf_prstatus *p) { }
-static inline void bswap_psinfo(struct target_elf_prpsinfo *p) {}
-static inline void bswap_note(struct elf_note *en) { }
-#endif /* HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN */
 
 /*
  * Calculate file (dump) size of given memory region.
Signature · 1 line
2.47.1