* [PULL 00/58] Misc single binary patches for 2025-04-25
@ 2025-04-25 15:27 Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 01/58] target/hexagon: Explode MO_TExx -> MO_TE | MO_xx Philippe Mathieu-Daudé
` (57 more replies)
0 siblings, 58 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé
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%)
--
2.47.1
^ permalink raw reply [flat|nested] 69+ messages in thread
* [PULL 01/58] target/hexagon: Explode MO_TExx -> MO_TE | MO_xx
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
@ 2025-04-25 15:27 ` Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 02/58] target/hexagon: Replace MO_TE -> MO_LE Philippe Mathieu-Daudé
` (56 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Anton Johansson
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
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20250312103238.99981-2-philmd@linaro.org>
---
target/hexagon/macros.h | 10 +++++-----
target/hexagon/genptr.c | 8 ++++----
target/hexagon/translate.c | 6 +++---
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/target/hexagon/macros.h b/target/hexagon/macros.h
index ee3d4c88e7b..57825efa55d 100644
--- a/target/hexagon/macros.h
+++ b/target/hexagon/macros.h
@@ -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) \
diff --git a/target/hexagon/genptr.c b/target/hexagon/genptr.c
index 2c5e15cfcf6..561e93c9fd4 100644
--- a/target/hexagon/genptr.c
+++ b/target/hexagon/genptr.c
@@ -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);
}
diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c
index dd26801e647..0109f31e19f 100644
--- a/target/hexagon/translate.c
+++ b/target/hexagon/translate.c
@@ -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:
{
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 02/58] target/hexagon: Replace MO_TE -> MO_LE
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 01/58] target/hexagon: Explode MO_TExx -> MO_TE | MO_xx Philippe Mathieu-Daudé
@ 2025-04-25 15:27 ` Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 03/58] target/i386: Replace MO_TE* -> MO_LE* Philippe Mathieu-Daudé
` (55 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Anton Johansson
We only build the Hexagon target using little endianness order.
The MO_TE definition always expands to MO_LE. Use the latter to
simplify.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20250312103238.99981-3-philmd@linaro.org>
---
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(-)
diff --git a/target/hexagon/macros.h b/target/hexagon/macros.h
index 57825efa55d..e5eb31e6711 100644
--- a/target/hexagon/macros.h
+++ b/target/hexagon/macros.h
@@ -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) \
diff --git a/target/hexagon/genptr.c b/target/hexagon/genptr.c
index 561e93c9fd4..08fc5413de7 100644
--- a/target/hexagon/genptr.c
+++ b/target/hexagon/genptr.c
@@ -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);
}
diff --git a/target/hexagon/idef-parser/parser-helpers.c b/target/hexagon/idef-parser/parser-helpers.c
index a7dcd85fe43..542af8d0a65 100644
--- a/target/hexagon/idef-parser/parser-helpers.c
+++ b/target/hexagon/idef-parser/parser-helpers.c
@@ -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,
diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c
index 0109f31e19f..02fd40c160f 100644
--- a/target/hexagon/translate.c
+++ b/target/hexagon/translate.c
@@ -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:
{
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 03/58] target/i386: Replace MO_TE* -> MO_LE*
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 01/58] target/hexagon: Explode MO_TExx -> MO_TE | MO_xx Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 02/58] target/hexagon: Replace MO_TE -> MO_LE Philippe Mathieu-Daudé
@ 2025-04-25 15:27 ` Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 04/58] cpus: Introduce CPUClass::list_cpus() callback Philippe Mathieu-Daudé
` (54 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
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
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20250312142124.15138-1-philmd@linaro.org>
---
target/i386/tcg/emit.c.inc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc
index 4e09e96fc13..ca6bc2ea82f 100644
--- a/target/i386/tcg/emit.c.inc
+++ b/target/i386/tcg/emit.c.inc
@@ -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. */
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 04/58] cpus: Introduce CPUClass::list_cpus() callback
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2025-04-25 15:27 ` [PULL 03/58] target/i386: Replace MO_TE* -> MO_LE* Philippe Mathieu-Daudé
@ 2025-04-25 15:27 ` Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 05/58] target/i386: Register CPUClass:list_cpus Philippe Mathieu-Daudé
` (53 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:27 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Thomas Huth, Richard Henderson,
Zhao Liu
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.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20250324185837.46506-2-philmd@linaro.org>
---
include/hw/core/cpu.h | 2 ++
cpu-target.c | 8 +++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index c8d6abff19a..5b645df59f5 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -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,
diff --git a/cpu-target.c b/cpu-target.c
index 14cd623bffe..d139a18f5b1 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -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
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 05/58] target/i386: Register CPUClass:list_cpus
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2025-04-25 15:27 ` [PULL 04/58] cpus: Introduce CPUClass::list_cpus() callback Philippe Mathieu-Daudé
@ 2025-04-25 15:27 ` Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 06/58] target/ppc: " Philippe Mathieu-Daudé
` (52 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:27 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Thomas Huth, Richard Henderson,
Zhao Liu
Register x86_cpu_list() as CPUClass:list_cpus callback.
Reduce its scope and remove the cpu_list definition.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20250324185837.46506-3-philmd@linaro.org>
---
target/i386/cpu.h | 3 ---
target/i386/cpu.c | 3 ++-
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 9866595cd0e..54bf9639f19 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -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
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 1f970aa4daa..955295fe798 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -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;
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 06/58] target/ppc: Register CPUClass:list_cpus
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (4 preceding siblings ...)
2025-04-25 15:27 ` [PULL 05/58] target/i386: Register CPUClass:list_cpus Philippe Mathieu-Daudé
@ 2025-04-25 15:27 ` Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 07/58] target/sparc: " Philippe Mathieu-Daudé
` (51 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:27 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Thomas Huth, Richard Henderson,
Zhao Liu
Register ppc_cpu_list() as CPUClass:list_cpus callback.
Reduce its scope and remove the cpu_list definition.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20250324185837.46506-4-philmd@linaro.org>
---
target/ppc/cpu.h | 4 ----
target/ppc/cpu_init.c | 3 ++-
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index 3c02f7f7d45..f4cc823c5c2 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -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)
diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index fde7d71fc68..077991ed535 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -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;
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 07/58] target/sparc: Register CPUClass:list_cpus
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (5 preceding siblings ...)
2025-04-25 15:27 ` [PULL 06/58] target/ppc: " Philippe Mathieu-Daudé
@ 2025-04-25 15:27 ` Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 08/58] target/s390x: " Philippe Mathieu-Daudé
` (50 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:27 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Thomas Huth, Richard Henderson,
Zhao Liu
Register sparc_cpu_list() as CPUClass:list_cpus callback.
Reduce its scope and remove the cpu_list definition.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20250324185837.46506-5-philmd@linaro.org>
---
target/sparc/cpu.h | 3 ---
target/sparc/cpu.c | 3 ++-
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h
index 83ac818933b..37fd1e066e9 100644
--- a/target/sparc/cpu.h
+++ b/target/sparc/cpu.h
@@ -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
diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c
index f7d231c6f8b..174b76f7624 100644
--- a/target/sparc/cpu.c
+++ b/target/sparc/cpu.c
@@ -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)
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 08/58] target/s390x: Register CPUClass:list_cpus
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (6 preceding siblings ...)
2025-04-25 15:27 ` [PULL 07/58] target/sparc: " Philippe Mathieu-Daudé
@ 2025-04-25 15:27 ` Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 09/58] cpus: Remove #ifdef check on cpu_list definition Philippe Mathieu-Daudé
` (49 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:27 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Thomas Huth, Zhao Liu, Eric Farman
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.
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20250324185837.46506-6-philmd@linaro.org>
---
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(-)
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index 90f64ee20cc..d9ca2506e27 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -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
diff --git a/target/s390x/cpu_models.h b/target/s390x/cpu_models.h
index 71d4bc2dd4a..f701bc0b532 100644
--- a/target/s390x/cpu_models.h
+++ b/target/s390x/cpu_models.h
@@ -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);
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 52c273b3dea..cf5b9974c58 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -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"
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index 41cccc1e692..43fc3194bc9 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -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;
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 09/58] cpus: Remove #ifdef check on cpu_list definition
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (7 preceding siblings ...)
2025-04-25 15:27 ` [PULL 08/58] target/s390x: " Philippe Mathieu-Daudé
@ 2025-04-25 15:27 ` Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 10/58] hw/pci-host/designware: Use deposit/extract API Philippe Mathieu-Daudé
` (48 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:27 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Thomas Huth, Richard Henderson,
Zhao Liu
Since we removed all definitions of cpu_list, the #ifdef
check is always true. Remove it, inlining cpu_list().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20250324185837.46506-7-philmd@linaro.org>
---
cpu-target.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/cpu-target.c b/cpu-target.c
index d139a18f5b1..c99d208a7c4 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -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);
}
}
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 10/58] hw/pci-host/designware: Use deposit/extract API
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (8 preceding siblings ...)
2025-04-25 15:27 ` [PULL 09/58] cpus: Remove #ifdef check on cpu_list definition Philippe Mathieu-Daudé
@ 2025-04-25 15:27 ` Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 11/58] hw/misc/edu: Convert type_init() -> DEFINE_TYPES() Philippe Mathieu-Daudé
` (47 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Gustavo Romero
Prefer the safer (less bug-prone) deposit/extract API
to access lower/upper 32-bit of 64-bit registers.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Message-Id: <20250331152041.74533-3-philmd@linaro.org>
---
hw/pci-host/designware.c | 48 ++++++++++++++--------------------------
1 file changed, 17 insertions(+), 31 deletions(-)
diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c
index 5598d18f478..9c3a5f8d910 100644
--- a/hw/pci-host/designware.c
+++ b/hw/pci-host/designware.c
@@ -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:
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 11/58] hw/misc/edu: Convert type_init() -> DEFINE_TYPES()
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (9 preceding siblings ...)
2025-04-25 15:27 ` [PULL 10/58] hw/pci-host/designware: Use deposit/extract API Philippe Mathieu-Daudé
@ 2025-04-25 15:27 ` Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 12/58] qom: Have class_base_init() take a const data argument Philippe Mathieu-Daudé
` (46 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
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.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250424194905.82506-2-philmd@linaro.org>
---
hw/misc/edu.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/hw/misc/edu.c b/hw/misc/edu.c
index 504178b4a22..5723ef0ed13 100644
--- a/hw/misc/edu.c
+++ b/hw/misc/edu.c
@@ -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)
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 12/58] qom: Have class_base_init() take a const data argument
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (10 preceding siblings ...)
2025-04-25 15:27 ` [PULL 11/58] hw/misc/edu: Convert type_init() -> DEFINE_TYPES() Philippe Mathieu-Daudé
@ 2025-04-25 15:27 ` Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 14/58] qom: Constify TypeInfo::class_data Philippe Mathieu-Daudé
` (45 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250424194905.82506-3-philmd@linaro.org>
---
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(-)
diff --git a/include/qom/object.h b/include/qom/object.h
index 9192265db76..7bb14ca7067 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -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;
diff --git a/hw/core/machine.c b/hw/core/machine.c
index abfcedd4a5f..bbff84855ae 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -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;
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 2745b5e0929..1e0f47cc848 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -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);
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 2844ec55560..475b97c649e 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -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 =
diff --git a/qom/object.c b/qom/object.c
index 01618d06bd8..dfd59502d11 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -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;
diff --git a/rust/qemu-api/src/qom.rs b/rust/qemu-api/src/qom.rs
index 34d7bc0ef96..03fe6247ff6 100644
--- a/rust/qemu-api/src/qom.rs
+++ b/rust/qemu-api/src/qom.rs
@@ -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 {
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 14/58] qom: Constify TypeInfo::class_data
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (11 preceding siblings ...)
2025-04-25 15:27 ` [PULL 12/58] qom: Have class_base_init() take a const data argument Philippe Mathieu-Daudé
@ 2025-04-25 15:27 ` Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 15/58] qom: Constify TypeInfo::interfaces Philippe Mathieu-Daudé
` (44 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
All callers now correctly expect a const class data.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250424194905.82506-5-philmd@linaro.org>
---
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(-)
diff --git a/include/qom/object.h b/include/qom/object.h
index 2fb86f00a68..42b75d10a43 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -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;
};
diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c
index d65a46b8d8d..9403b65ddb5 100644
--- a/hw/arm/armsse.c
+++ b/hw/arm/armsse.c
@@ -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);
}
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index 75b9d712518..a5336d92ff9 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -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);
}
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index 80366aaf647..c62afc907b2 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -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,
};
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index d49730f4ad4..13814e84d18 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -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);
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index b4b926d759a..4952f9bd2cf 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -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), \
}
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index ffcabd5a8e9..b024905a01f 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -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;
diff --git a/hw/sensor/tmp421.c b/hw/sensor/tmp421.c
index 263bfa1bbda..3421c440869 100644
--- a/hw/sensor/tmp421.c
+++ b/hw/sensor/tmp421.c
@@ -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);
}
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index c0fd3db0630..95bf7ddd972 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -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);
diff --git a/qom/object.c b/qom/object.c
index 06d7367032e..425ee2f0ee8 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -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);
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 81257f20fd7..00577f97eb6 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -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);
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index 1184c92b4c0..eaf5705cdc2 100644
--- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c
@@ -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);
diff --git a/target/mips/cpu.c b/target/mips/cpu.c
index 29611a0a1c3..d13361a1507 100644
--- a/target/mips/cpu.c
+++ b/target/mips/cpu.c
@@ -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);
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index b097ed55d9d..8951f1b36f9 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -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);
diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c
index 981aa86e0e0..bc753d5f627 100644
--- a/target/sparc/cpu.c
+++ b/target/sparc/cpu.c
@@ -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);
diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c
index 04597879815..2d93b45036d 100644
--- a/target/xtensa/helper.c
+++ b/target/xtensa/helper.c
@@ -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);
diff --git a/rust/qemu-api/src/qom.rs b/rust/qemu-api/src/qom.rs
index f385cb72753..f0a79f96d5e 100644
--- a/rust/qemu-api/src/qom.rs
+++ b/rust/qemu-api/src/qom.rs
@@ -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(),
};
diff --git a/scripts/codeconverter/codeconverter/test_regexps.py b/scripts/codeconverter/codeconverter/test_regexps.py
index 72113927960..08857c5008d 100644
--- a/scripts/codeconverter/codeconverter/test_regexps.py
+++ b/scripts/codeconverter/codeconverter/test_regexps.py
@@ -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)
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 15/58] qom: Constify TypeInfo::interfaces
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (12 preceding siblings ...)
2025-04-25 15:27 ` [PULL 14/58] qom: Constify TypeInfo::class_data Philippe Mathieu-Daudé
@ 2025-04-25 15:27 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 16/58] qom: Make InterfaceInfo[] uses const Philippe Mathieu-Daudé
` (43 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20250424194905.82506-6-philmd@linaro.org>
---
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(-)
diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio/virtio-pci.h
index 567a9b0a9da..31ec144509f 100644
--- a/include/hw/virtio/virtio-pci.h
+++ b/include/hw/virtio/virtio-pci.h
@@ -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. */
diff --git a/include/qom/object.h b/include/qom/object.h
index 42b75d10a43..26a45f638cd 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -490,7 +490,7 @@ struct TypeInfo
void (*class_base_init)(ObjectClass *klass, const void *data);
const void *class_data;
- InterfaceInfo *interfaces;
+ const InterfaceInfo *interfaces;
};
/**
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index b024905a01f..a39e3e0e4fa 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -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[] = {
diff --git a/rust/qemu-api/src/qom.rs b/rust/qemu-api/src/qom.rs
index f0a79f96d5e..f1b4022157b 100644
--- a/rust/qemu-api/src/qom.rs
+++ b/rust/qemu-api/src/qom.rs
@@ -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
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 16/58] qom: Make InterfaceInfo[] uses const
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (13 preceding siblings ...)
2025-04-25 15:27 ` [PULL 15/58] qom: Constify TypeInfo::interfaces Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 17/58] qom/object: Fix type conflict of GLib function pointers Philippe Mathieu-Daudé
` (42 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
Mechanical change using:
$ sed -i -E 's/\(InterfaceInfo.?\[/\(const InterfaceInfo\[/g' \
$(git grep -lE '\(InterfaceInfo.?\[\]\)')
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20250424194905.82506-7-philmd@linaro.org>
---
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(-)
diff --git a/include/qom/object.h b/include/qom/object.h
index 26a45f638cd..1d5b0337242 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -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 \
diff --git a/authz/list.c b/authz/list.c
index bbd99f2b7fc..17aa0efd80e 100644
--- a/authz/list.c
+++ b/authz/list.c
@@ -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 },
{ }
}
diff --git a/authz/listfile.c b/authz/listfile.c
index b58d4ebd1d8..13741d5a722 100644
--- a/authz/listfile.c
+++ b/authz/listfile.c
@@ -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 },
{ }
}
diff --git a/authz/pamacct.c b/authz/pamacct.c
index 07b8aad4972..c0ad67479a7 100644
--- a/authz/pamacct.c
+++ b/authz/pamacct.c
@@ -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 },
{ }
}
diff --git a/authz/simple.c b/authz/simple.c
index f6985b840ea..f8f2b98518a 100644
--- a/authz/simple.c
+++ b/authz/simple.c
@@ -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 },
{ }
}
diff --git a/backends/cryptodev.c b/backends/cryptodev.c
index 51bbe5ce40f..79f8882d3be 100644
--- a/backends/cryptodev.c
+++ b/backends/cryptodev.c
@@ -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 },
{ }
}
diff --git a/backends/dbus-vmstate.c b/backends/dbus-vmstate.c
index 8c2deef43d4..7d5b58b4c90 100644
--- a/backends/dbus-vmstate.c
+++ b/backends/dbus-vmstate.c
@@ -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 },
{ }
diff --git a/backends/hostmem.c b/backends/hostmem.c
index 195f37fa443..35734d6f4d1 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -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 },
{ }
}
diff --git a/backends/iommufd.c b/backends/iommufd.c
index 17f7ae38094..1498102099d 100644
--- a/backends/iommufd.c
+++ b/backends/iommufd.c
@@ -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 },
{ }
}
diff --git a/backends/rng.c b/backends/rng.c
index b3480d27a12..ab94dfea850 100644
--- a/backends/rng.c
+++ b/backends/rng.c
@@ -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 },
{ }
}
diff --git a/block/throttle-groups.c b/block/throttle-groups.c
index 9720cafb964..66fdce9a90e 100644
--- a/block/throttle-groups.c
+++ b/block/throttle-groups.c
@@ -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 },
{ }
},
diff --git a/crypto/secret_common.c b/crypto/secret_common.c
index 2399ce412be..a5ecb876aeb 100644
--- a/crypto/secret_common.c
+++ b/crypto/secret_common.c
@@ -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 },
{ }
}
diff --git a/crypto/tls-cipher-suites.c b/crypto/tls-cipher-suites.c
index e546cc7c0e6..d9b61d0c08a 100644
--- a/crypto/tls-cipher-suites.c
+++ b/crypto/tls-cipher-suites.c
@@ -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 },
{ }
diff --git a/crypto/tlscredsanon.c b/crypto/tlscredsanon.c
index 0e2d133821f..44af9e6c9af 100644
--- a/crypto/tlscredsanon.c
+++ b/crypto/tlscredsanon.c
@@ -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 },
{ }
}
diff --git a/crypto/tlscredspsk.c b/crypto/tlscredspsk.c
index 287c2a3c96c..5b68a6b7ba2 100644
--- a/crypto/tlscredspsk.c
+++ b/crypto/tlscredspsk.c
@@ -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 },
{ }
}
diff --git a/crypto/tlscredsx509.c b/crypto/tlscredsx509.c
index 143993f5393..63a72fe47c8 100644
--- a/crypto/tlscredsx509.c
+++ b/crypto/tlscredsx509.c
@@ -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 },
{ }
}
diff --git a/event-loop-base.c b/event-loop-base.c
index 733c54486c0..8ca143bea43 100644
--- a/event-loop-base.c
+++ b/event-loop-base.c
@@ -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 },
{ }
}
diff --git a/hw/acpi/erst.c b/hw/acpi/erst.c
index 90148ec9dc2..099cabb7ab7 100644
--- a/hw/acpi/erst.c
+++ b/hw/acpi/erst.c
@@ -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 },
{ }
}
diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c
index f589e79a2bb..d8adfea6480 100644
--- a/hw/acpi/generic_event_device.c
+++ b/hw/acpi/generic_event_device.c
@@ -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 },
{ }
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 5860e8408bd..b16d45f03e1 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -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 },
diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c
index 9403b65ddb5..50ab7f48105 100644
--- a/hw/arm/armsse.c
+++ b/hw/arm/armsse.c
@@ -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 },
{ }
}
diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c
index 8474549f5f4..5dd87cc0281 100644
--- a/hw/arm/mps2-tz.c
+++ b/hw/arm/mps2-tz.c
@@ -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 },
{ }
},
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 17faf34aae2..177f3dd22c1 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -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 },
{ }
},
diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
index 7454cc60deb..669a0463cc1 100644
--- a/hw/audio/ac97.c
+++ b/hw/audio/ac97.c
@@ -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 },
{ },
},
diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index 322b7798149..8efb9692128 100644
--- a/hw/audio/es1370.c
+++ b/hw/audio/es1370.c
@@ -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 },
{ },
},
diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
index 2f1b08e9c1c..b256c8ccea1 100644
--- a/hw/audio/intel-hda.c
+++ b/hw/audio/intel-hda.c
@@ -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 },
{ },
},
diff --git a/hw/audio/via-ac97.c b/hw/audio/via-ac97.c
index 5feef663d8c..1e0a5c7398b 100644
--- a/hw/audio/via-ac97.c
+++ b/hw/audio/via-ac97.c
@@ -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 },
{ },
},
diff --git a/hw/block/fdc-isa.c b/hw/block/fdc-isa.c
index fbba2ab6296..6d1790e0e61 100644
--- a/hw/block/fdc-isa.c
+++ b/hw/block/fdc-isa.c
@@ -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 },
{ },
},
diff --git a/hw/char/diva-gsp.c b/hw/char/diva-gsp.c
index 9a623d680b3..60f933191d2 100644
--- a/hw/char/diva-gsp.c
+++ b/hw/char/diva-gsp.c
@@ -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 },
{ },
},
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index 217ddaf2e3e..8732e4e9f96 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -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 },
{ },
},
diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c
index fe7fb1625b5..0ea59a3d5c2 100644
--- a/hw/char/serial-isa.c
+++ b/hw/char/serial-isa.c
@@ -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 },
{ },
},
diff --git a/hw/char/serial-pci-multi.c b/hw/char/serial-pci-multi.c
index ee1c0f7dc4f..fb184c2e6dc 100644
--- a/hw/char/serial-pci-multi.c
+++ b/hw/char/serial-pci-multi.c
@@ -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 },
{ },
},
diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
index bd38c7428c6..8707e819144 100644
--- a/hw/char/serial-pci.c
+++ b/hw/char/serial-pci.c
@@ -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 },
{ },
},
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
index 00572873d28..eb79f5258b6 100644
--- a/hw/char/virtio-serial-bus.c
+++ b/hw/char/virtio-serial-bus.c
@@ -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 },
{ }
}
diff --git a/hw/core/bus.c b/hw/core/bus.c
index c3b431a014b..bddfc22d388 100644
--- a/hw/core/bus.c
+++ b/hw/core/bus.c
@@ -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 },
{ }
},
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 4a3760c101e..f6002261768 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -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 },
{ }
diff --git a/hw/cxl/switch-mailbox-cci.c b/hw/cxl/switch-mailbox-cci.c
index b92bbeb16ed..223f2204331 100644
--- a/hw/cxl/switch-mailbox-cci.c
+++ b/hw/cxl/switch-mailbox-cci.c
@@ -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 },
{ }
},
diff --git a/hw/display/ati.c b/hw/display/ati.c
index 4e88d099431..7de27732cdc 100644
--- a/hw/display/ati.c
+++ b/hw/display/ati.c
@@ -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 },
{ },
},
diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c
index 1d329fc9cce..ad2821c9745 100644
--- a/hw/display/bochs-display.c
+++ b/hw/display/bochs-display.c
@@ -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 },
{ },
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
index 4e5ae04af0f..ef08694626d 100644
--- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c
@@ -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 },
{ },
},
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 6c820bcdb58..18f482ca7f7 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -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 },
{ },
},
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index dcff1e978ed..6d2f18684c3 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -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 },
{ },
},
diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
index a8601972740..b81f7fd2d0f 100644
--- a/hw/display/vga-pci.c
+++ b/hw/display/vga-pci.c
@@ -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 },
{ },
diff --git a/hw/display/virtio-gpu-pci-rutabaga.c b/hw/display/virtio-gpu-pci-rutabaga.c
index abbb898c65d..5fdff37f2c1 100644
--- a/hw/display/virtio-gpu-pci-rutabaga.c
+++ b/hw/display/virtio-gpu-pci-rutabaga.c
@@ -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 },
{ },
}
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 7777deb17d0..544bb65320b 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -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 },
{ },
},
diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c
index 1d67e505364..2463952ada2 100644
--- a/hw/dma/i8257.c
+++ b/hw/dma/i8257.c
@@ -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 },
{ }
}
diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c
index bf1b523ac88..2020399fd59 100644
--- a/hw/dma/xilinx_axidma.c
+++ b/hw/dma/xilinx_axidma.c
@@ -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 },
{ }
}
diff --git a/hw/dma/xlnx_csu_dma.c b/hw/dma/xlnx_csu_dma.c
index 6943c927d07..3db3904d835 100644
--- a/hw/dma/xlnx_csu_dma.c
+++ b/hw/dma/xlnx_csu_dma.c
@@ -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 },
{ }
}
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 18122766780..dacedc5409c 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -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 },
{ }
},
diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c
index f1fca30fea5..956c9b59bbc 100644
--- a/hw/i2c/smbus_ich9.c
+++ b/hw/i2c/smbus_ich9.c
@@ -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 },
{ },
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index b94802e21a6..2cf7e24a21d 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -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 },
{ },
},
diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index 14a918a531c..e0daf0d4fc3 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -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 },
{ }
},
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 49753bf0b30..70656157ca0 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -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 },
{ }
},
diff --git a/hw/i386/sgx-epc.c b/hw/i386/sgx-epc.c
index 8fb80900b7a..2b3b2823b5f 100644
--- a/hw/i386/sgx-epc.c
+++ b/hw/i386/sgx-epc.c
@@ -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 },
{ }
},
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index c8e2551b2b4..e2d04092992 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -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 },
{ }
},
diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
index 7c0d345f964..c8b852be0cc 100644
--- a/hw/i386/xen/xen_platform.c
+++ b/hw/i386/xen/xen_platform.c
@@ -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 },
{ },
},
diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c
index 65868bd5e59..87a974ae5a0 100644
--- a/hw/i386/xen/xen_pvdevice.c
+++ b/hw/i386/xen/xen_pvdevice.c
@@ -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 },
{ },
},
diff --git a/hw/ide/ich.c b/hw/ide/ich.c
index f2773ab4621..4cade0d1219 100644
--- a/hw/ide/ich.c
+++ b/hw/ide/ich.c
@@ -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 },
{ },
},
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 0ed72e42233..1e50bb9e483 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -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 },
{ },
},
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index 83930dd50c0..71f5f976e9c 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -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 },
{ },
},
diff --git a/hw/intc/arm_gic_common.c b/hw/intc/arm_gic_common.c
index f61d1c1fe60..0f0c48d89ab 100644
--- a/hw/intc/arm_gic_common.c
+++ b/hw/intc/arm_gic_common.c
@@ -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 },
{ },
},
diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c
index dd86a50300a..1cee68193ca 100644
--- a/hw/intc/arm_gicv3_common.c
+++ b/hw/intc/arm_gicv3_common.c
@@ -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 },
{ },
},
diff --git a/hw/intc/goldfish_pic.c b/hw/intc/goldfish_pic.c
index b80538cdeba..2359861785d 100644
--- a/hw/intc/goldfish_pic.c
+++ b/hw/intc/goldfish_pic.c
@@ -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 },
{ }
},
diff --git a/hw/intc/i8259_common.c b/hw/intc/i8259_common.c
index 4a92e0da908..602e44c8eaf 100644
--- a/hw/intc/i8259_common.c
+++ b/hw/intc/i8259_common.c
@@ -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 },
{ }
},
diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c
index b0381c7990d..fce3486e519 100644
--- a/hw/intc/ioapic_common.c
+++ b/hw/intc/ioapic_common.c
@@ -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 },
{ }
},
diff --git a/hw/intc/loongarch_extioi_common.c b/hw/intc/loongarch_extioi_common.c
index 126f13d12cf..9e1589060cd 100644
--- a/hw/intc/loongarch_extioi_common.c
+++ b/hw/intc/loongarch_extioi_common.c
@@ -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 },
{ }
},
diff --git a/hw/intc/loongarch_ipi.c b/hw/intc/loongarch_ipi.c
index 4dad240689f..2f8bb578284 100644
--- a/hw/intc/loongarch_ipi.c
+++ b/hw/intc/loongarch_ipi.c
@@ -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 },
{ }
},
diff --git a/hw/intc/m68k_irqc.c b/hw/intc/m68k_irqc.c
index 215e1a6ed5b..2532322618a 100644
--- a/hw/intc/m68k_irqc.c
+++ b/hw/intc/m68k_irqc.c
@@ -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 },
{ }
diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c
index cd73881b5b0..935c0e4742f 100644
--- a/hw/intc/pnv_xive.c
+++ b/hw/intc/pnv_xive.c
@@ -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 },
{ }
}
diff --git a/hw/intc/pnv_xive2.c b/hw/intc/pnv_xive2.c
index 02437dddac6..ec8b0c68f1a 100644
--- a/hw/intc/pnv_xive2.c
+++ b/hw/intc/pnv_xive2.c
@@ -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 },
{ }
}
diff --git a/hw/intc/slavio_intctl.c b/hw/intc/slavio_intctl.c
index 5776055a8b4..00b80bb177c 100644
--- a/hw/intc/slavio_intctl.c
+++ b/hw/intc/slavio_intctl.c
@@ -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 },
{ }
},
diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c
index 7fde6059bfe..440edb97d8d 100644
--- a/hw/intc/spapr_xive.c
+++ b/hw/intc/spapr_xive.c
@@ -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 },
{ }
},
diff --git a/hw/intc/xics_spapr.c b/hw/intc/xics_spapr.c
index 9e465fb8f3b..7663596a4a4 100644
--- a/hw/intc/xics_spapr.c
+++ b/hw/intc/xics_spapr.c
@@ -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 },
{ }
},
diff --git a/hw/intc/xive.c b/hw/intc/xive.c
index 069c1e9a5e8..27b473e4d76 100644
--- a/hw/intc/xive.c
+++ b/hw/intc/xive.c
@@ -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 },
{ }
diff --git a/hw/intc/xive2.c b/hw/intc/xive2.c
index 3337a943fb2..a08cf906d0e 100644
--- a/hw/intc/xive2.c
+++ b/hw/intc/xive2.c
@@ -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 },
{ }
diff --git a/hw/ipack/tpci200.c b/hw/ipack/tpci200.c
index f6993330d23..40b30517c75 100644
--- a/hw/ipack/tpci200.c
+++ b/hw/ipack/tpci200.c
@@ -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 },
{ },
},
diff --git a/hw/ipmi/isa_ipmi_bt.c b/hw/ipmi/isa_ipmi_bt.c
index db539e68aee..0ad91ccf689 100644
--- a/hw/ipmi/isa_ipmi_bt.c
+++ b/hw/ipmi/isa_ipmi_bt.c
@@ -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 },
{ }
diff --git a/hw/ipmi/isa_ipmi_kcs.c b/hw/ipmi/isa_ipmi_kcs.c
index 4cbc6c577cd..418d234e0f1 100644
--- a/hw/ipmi/isa_ipmi_kcs.c
+++ b/hw/ipmi/isa_ipmi_kcs.c
@@ -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 },
{ }
diff --git a/hw/ipmi/pci_ipmi_bt.c b/hw/ipmi/pci_ipmi_bt.c
index 23f65c6886e..905101dcafd 100644
--- a/hw/ipmi/pci_ipmi_bt.c
+++ b/hw/ipmi/pci_ipmi_bt.c
@@ -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 },
{ }
diff --git a/hw/ipmi/pci_ipmi_kcs.c b/hw/ipmi/pci_ipmi_kcs.c
index 4077b6a7b09..4d6cde826ec 100644
--- a/hw/ipmi/pci_ipmi_kcs.c
+++ b/hw/ipmi/pci_ipmi_kcs.c
@@ -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 },
{ }
diff --git a/hw/ipmi/smbus_ipmi.c b/hw/ipmi/smbus_ipmi.c
index 7345844a3a9..78c332de54d 100644
--- a/hw/ipmi/smbus_ipmi.c
+++ b/hw/ipmi/smbus_ipmi.c
@@ -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 },
{ }
diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
index 26c8ec4f77a..06e8f0ce3e0 100644
--- a/hw/isa/i82378.c
+++ b/hw/isa/i82378.c
@@ -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 },
{ },
},
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index d3e623b1e88..71afb45b631 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -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 },
diff --git a/hw/isa/piix.c b/hw/isa/piix.c
index 2c6e76f97cc..52c14d3cd5b 100644
--- a/hw/isa/piix.c
+++ b/hw/isa/piix.c
@@ -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 },
{ },
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index c62afc907b2..337958617a4 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -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 },
{ },
},
diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index fde25e94095..779544fadaf 100644
--- a/hw/loongarch/virt.c
+++ b/hw/loongarch/virt.c
@@ -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 },
{ }
},
diff --git a/hw/m68k/q800-glue.c b/hw/m68k/q800-glue.c
index b428e7c833e..36de67c328e 100644
--- a/hw/m68k/q800-glue.c
+++ b/hw/m68k/q800-glue.c
@@ -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 },
{ }
},
diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c
index c95722a2ae4..bba923f8eab 100644
--- a/hw/mem/cxl_type3.c
+++ b/hw/mem/cxl_type3.c
@@ -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 },
{}
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 6f68171442f..f701d5b5f9b 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -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 },
{ }
},
diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c
index d83a81b60d3..a015d4a9b8c 100644
--- a/hw/misc/applesmc.c
+++ b/hw/misc/applesmc.c
@@ -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 },
{ },
},
diff --git a/hw/misc/edu.c b/hw/misc/edu.c
index 8224603593f..cece633e113 100644
--- a/hw/misc/edu.c
+++ b/hw/misc/edu.c
@@ -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 },
{ },
},
diff --git a/hw/misc/ivshmem-pci.c b/hw/misc/ivshmem-pci.c
index 2844b6f9099..5a10bca633d 100644
--- a/hw/misc/ivshmem-pci.c
+++ b/hw/misc/ivshmem-pci.c
@@ -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 },
{ },
},
diff --git a/hw/misc/macio/gpio.c b/hw/misc/macio/gpio.c
index e5d1e1168e2..990551f91f4 100644
--- a/hw/misc/macio/gpio.c
+++ b/hw/misc/macio/gpio.c
@@ -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 },
{ }
},
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index b0418db49ea..6710485d728 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -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 },
{ },
},
diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c
index 0ea26451f1f..3f6a8bba84f 100644
--- a/hw/misc/pci-testdev.c
+++ b/hw/misc/pci-testdev.c
@@ -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 },
{ },
},
diff --git a/hw/misc/pvpanic-isa.c b/hw/misc/pvpanic-isa.c
index 55522ee56cb..f7b421c713b 100644
--- a/hw/misc/pvpanic-isa.c
+++ b/hw/misc/pvpanic-isa.c
@@ -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 },
{ },
},
diff --git a/hw/misc/pvpanic-pci.c b/hw/misc/pvpanic-pci.c
index 51ebf661076..2869b6a7ff8 100644
--- a/hw/misc/pvpanic-pci.c
+++ b/hw/misc/pvpanic-pci.c
@@ -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 },
{ }
}
diff --git a/hw/misc/xlnx-versal-cframe-reg.c b/hw/misc/xlnx-versal-cframe-reg.c
index e28d569ebef..1ce083e2409 100644
--- a/hw/misc/xlnx-versal-cframe-reg.c
+++ b/hw/misc/xlnx-versal-cframe-reg.c
@@ -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 },
{ }
}
diff --git a/hw/misc/xlnx-versal-cfu.c b/hw/misc/xlnx-versal-cfu.c
index 02e4fed05b9..b920fc77c3f 100644
--- a/hw/misc/xlnx-versal-cfu.c
+++ b/hw/misc/xlnx-versal-cfu.c
@@ -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 },
{ }
}
diff --git a/hw/net/can/can_kvaser_pci.c b/hw/net/can/can_kvaser_pci.c
index c0bb598baef..be16769de29 100644
--- a/hw/net/can/can_kvaser_pci.c
+++ b/hw/net/can/can_kvaser_pci.c
@@ -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 },
{ },
},
diff --git a/hw/net/can/can_mioe3680_pci.c b/hw/net/can/can_mioe3680_pci.c
index 9aac70dccd3..44f3ba370dc 100644
--- a/hw/net/can/can_mioe3680_pci.c
+++ b/hw/net/can/can_mioe3680_pci.c
@@ -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 },
{ },
},
diff --git a/hw/net/can/can_pcm3680_pci.c b/hw/net/can/can_pcm3680_pci.c
index b305f7e9b7d..7296d63be79 100644
--- a/hw/net/can/can_pcm3680_pci.c
+++ b/hw/net/can/can_pcm3680_pci.c
@@ -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 },
{ },
},
diff --git a/hw/net/can/ctucan_pci.c b/hw/net/can/ctucan_pci.c
index 0dee9b59d10..bed6785433e 100644
--- a/hw/net/can/ctucan_pci.c
+++ b/hw/net/can/ctucan_pci.c
@@ -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 },
{ },
},
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index 13814e84d18..cba4999e6d0 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -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 },
{ },
},
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
index f38249a6a97..89e6d52ba0f 100644
--- a/hw/net/e1000e.c
+++ b/hw/net/e1000e.c
@@ -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 },
{ }
},
diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index ef0f9337a0b..d47df5a97fd 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -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 },
{ },
};
diff --git a/hw/net/igb.c b/hw/net/igb.c
index ba30433a500..e4c02365d67 100644
--- a/hw/net/igb.c
+++ b/hw/net/igb.c
@@ -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 },
{ }
},
diff --git a/hw/net/igbvf.c b/hw/net/igbvf.c
index 91e7ccf931b..31d72c4977d 100644
--- a/hw/net/igbvf.c
+++ b/hw/net/igbvf.c
@@ -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 },
{ }
},
diff --git a/hw/net/ne2000-pci.c b/hw/net/ne2000-pci.c
index 2153973af43..ce937e1b618 100644
--- a/hw/net/ne2000-pci.c
+++ b/hw/net/ne2000-pci.c
@@ -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 },
{ },
},
diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
index 429c2171803..0ca5bc21938 100644
--- a/hw/net/pcnet-pci.c
+++ b/hw/net/pcnet-pci.c
@@ -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 },
{ },
},
diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c
index 3d307f4ab15..cc49701dd3c 100644
--- a/hw/net/rocker/rocker.c
+++ b/hw/net/rocker/rocker.c
@@ -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 },
{ },
},
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index ad812954cf8..15b8f7501ae 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -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 },
{ },
},
diff --git a/hw/net/sungem.c b/hw/net/sungem.c
index 123d08ee8e3..b405eb89fa5 100644
--- a/hw/net/sungem.c
+++ b/hw/net/sungem.c
@@ -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 },
{ }
}
diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c
index 46c9f5020b1..c2f7a8483da 100644
--- a/hw/net/sunhme.c
+++ b/hw/net/sunhme.c
@@ -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 },
{ }
}
diff --git a/hw/net/tulip.c b/hw/net/tulip.c
index fb3366d8ee3..63fe5134586 100644
--- a/hw/net/tulip.c
+++ b/hw/net/tulip.c
@@ -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 },
{ },
},
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 4bcf1f902f5..83d942af179 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -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 },
{ }
diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c
index e45bc048e05..1f5c7480476 100644
--- a/hw/net/xilinx_axienet.c
+++ b/hw/net/xilinx_axienet.c
@@ -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 },
{ }
}
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index e87295f5f84..fd935507bc0 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -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 },
{ }
},
diff --git a/hw/pci-bridge/cxl_downstream.c b/hw/pci-bridge/cxl_downstream.c
index ab3b550a889..1065245a8b8 100644
--- a/hw/pci-bridge/cxl_downstream.c
+++ b/hw/pci-bridge/cxl_downstream.c
@@ -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 },
{ }
diff --git a/hw/pci-bridge/cxl_root_port.c b/hw/pci-bridge/cxl_root_port.c
index 8b1e149e9ba..e6a4035d26c 100644
--- a/hw/pci-bridge/cxl_root_port.c
+++ b/hw/pci-bridge/cxl_root_port.c
@@ -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 },
{ }
},
diff --git a/hw/pci-bridge/cxl_upstream.c b/hw/pci-bridge/cxl_upstream.c
index 822a8285554..208e0c6172e 100644
--- a/hw/pci-bridge/cxl_upstream.c
+++ b/hw/pci-bridge/cxl_upstream.c
@@ -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 },
{ }
diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c
index f2b294aee27..1d73c14c1f8 100644
--- a/hw/pci-bridge/i82801b11.c
+++ b/hw/pci-bridge/i82801b11.c
@@ -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 },
{ },
},
diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c
index 3b57583199d..b328e50ab31 100644
--- a/hw/pci-bridge/pci_bridge_dev.c
+++ b/hw/pci-bridge/pci_bridge_dev.c
@@ -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 },
{ }
diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
index 1e2e394ee8a..3a29dfefc2c 100644
--- a/hw/pci-bridge/pci_expander_bridge.c
+++ b/hw/pci-bridge/pci_expander_bridge.c
@@ -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 },
{},
},
diff --git a/hw/pci-bridge/pcie_pci_bridge.c b/hw/pci-bridge/pcie_pci_bridge.c
index 833fe35cd5a..fce292a519b 100644
--- a/hw/pci-bridge/pcie_pci_bridge.c
+++ b/hw/pci-bridge/pcie_pci_bridge.c
@@ -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 },
{ },
diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c
index 512c2ab305c..22c2fdb71e7 100644
--- a/hw/pci-bridge/pcie_root_port.c
+++ b/hw/pci-bridge/pcie_root_port.c
@@ -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 },
{ }
},
diff --git a/hw/pci-bridge/simba.c b/hw/pci-bridge/simba.c
index c7565d9e946..bbae594e119 100644
--- a/hw/pci-bridge/simba.c
+++ b/hw/pci-bridge/simba.c
@@ -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 },
{ },
},
diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c
index d85c23fe4a8..dc7d1aa7d77 100644
--- a/hw/pci-bridge/xio3130_downstream.c
+++ b/hw/pci-bridge/xio3130_downstream.c
@@ -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 },
{ }
},
diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstream.c
index d7a27158124..40057b749bf 100644
--- a/hw/pci-bridge/xio3130_upstream.c
+++ b/hw/pci-bridge/xio3130_upstream.c
@@ -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 },
{ }
},
diff --git a/hw/pci-host/articia.c b/hw/pci-host/articia.c
index 043fb85e840..cc65aac2a87 100644
--- a/hw/pci-host/articia.c
+++ b/hw/pci-host/articia.c
@@ -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 },
{ },
},
diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index 4508cdd21ae..7d6251a78d7 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -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 },
{ },
},
diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c
index d03c998e3ad..183f838392c 100644
--- a/hw/pci-host/designware.c
+++ b/hw/pci-host/designware.c
@@ -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 },
{ }
},
diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c
index 7dcac4ee3c4..b806a2286f7 100644
--- a/hw/pci-host/gpex.c
+++ b/hw/pci-host/gpex.c
@@ -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 },
{ },
},
diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c
index b48d44623dd..f9da5a908c1 100644
--- a/hw/pci-host/grackle.c
+++ b/hw/pci-host/grackle.c
@@ -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 },
{ },
},
diff --git a/hw/pci-host/gt64120.c b/hw/pci-host/gt64120.c
index bd74b6e8714..56a6ef93b7a 100644
--- a/hw/pci-host/gt64120.c
+++ b/hw/pci-host/gt64120.c
@@ -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 },
{ },
},
diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c
index fcc9f3818a4..e13bb1b53e4 100644
--- a/hw/pci-host/i440fx.c
+++ b/hw/pci-host/i440fx.c
@@ -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 },
{ },
},
diff --git a/hw/pci-host/mv64361.c b/hw/pci-host/mv64361.c
index f51f385b226..e05b6770102 100644
--- a/hw/pci-host/mv64361.c
+++ b/hw/pci-host/mv64361.c
@@ -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 },
{ },
},
diff --git a/hw/pci-host/pnv_phb3_pbcq.c b/hw/pci-host/pnv_phb3_pbcq.c
index 4e24b1449d0..1f7a149580d 100644
--- a/hw/pci-host/pnv_phb3_pbcq.c
+++ b/hw/pci-host/pnv_phb3_pbcq.c
@@ -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 },
{ }
}
diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c
index feb812dc1a9..77ea35299d3 100644
--- a/hw/pci-host/pnv_phb4.c
+++ b/hw/pci-host/pnv_phb4.c
@@ -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 },
{ },
}
diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
index cc46641cdf8..5bac1c42ed0 100644
--- a/hw/pci-host/pnv_phb4_pec.c
+++ b/hw/pci-host/pnv_phb4_pec.c
@@ -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 },
{ }
}
diff --git a/hw/pci-host/ppc4xx_pci.c b/hw/pci-host/ppc4xx_pci.c
index dcc4b78660c..25478176881 100644
--- a/hw/pci-host/ppc4xx_pci.c
+++ b/hw/pci-host/ppc4xx_pci.c
@@ -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 },
{ },
},
diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c
index 2f6354c931e..e97a515d5fe 100644
--- a/hw/pci-host/ppce500.c
+++ b/hw/pci-host/ppce500.c
@@ -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 },
{ },
},
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index c2a71108f2e..1951ae440cc 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -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 },
{ },
},
diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c
index 3f158838a0a..21f7ca65e06 100644
--- a/hw/pci-host/raven.c
+++ b/hw/pci-host/raven.c
@@ -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 },
{ },
},
diff --git a/hw/pci-host/sabre.c b/hw/pci-host/sabre.c
index f7086086f9a..538624c5079 100644
--- a/hw/pci-host/sabre.c
+++ b/hw/pci-host/sabre.c
@@ -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 },
{ },
},
diff --git a/hw/pci-host/sh_pci.c b/hw/pci-host/sh_pci.c
index 52bff66d6a1..de8f6a84aab 100644
--- a/hw/pci-host/sh_pci.c
+++ b/hw/pci-host/sh_pci.c
@@ -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 },
{ },
},
diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
index 7cb37e01d8f..194037d6e75 100644
--- a/hw/pci-host/uninorth.c
+++ b/hw/pci-host/uninorth.c
@@ -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 },
{ },
},
diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c
index b333158e102..8ea26e3ff00 100644
--- a/hw/pci-host/versatile.c
+++ b/hw/pci-host/versatile.c
@@ -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 },
{ },
},
diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c
index 70e9b2b9810..c71492de9e7 100644
--- a/hw/pci-host/xilinx-pcie.c
+++ b/hw/pci-host/xilinx-pcie.c
@@ -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 },
{ }
},
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index c60991def8f..fe38c4c0287 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -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 },
{ }
}
diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c
index 0fe66e8b12d..76255c4cd89 100644
--- a/hw/pci/pci_bridge.c
+++ b/hw/pci/pci_bridge.c
@@ -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 },
{ },
},
diff --git a/hw/pci/pcie_port.c b/hw/pci/pcie_port.c
index 8629b3aafd6..54f639e3d4f 100644
--- a/hw/pci/pcie_port.c
+++ b/hw/pci/pcie_port.c
@@ -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 },
{ }
}
diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c
index cd594eeb3ed..775b9d8da00 100644
--- a/hw/ppc/e500plat.c
+++ b/hw/ppc/e500plat.c
@@ -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 },
{ }
}
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 92fe60b2a2c..0b6e096116a 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -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 },
{ }
},
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index 5c5bf99b4d6..40ae936ad8a 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -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 },
{ }
},
diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c
index bb6f94f502c..e15cf964278 100644
--- a/hw/ppc/pegasos2.c
+++ b/hw/ppc/pegasos2.c
@@ -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 },
{ }
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 4590231f888..4a49e9d1a86 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -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 },
{ },
diff --git a/hw/ppc/pnv_adu.c b/hw/ppc/pnv_adu.c
index f9620806ec7..005fbda4750 100644
--- a/hw/ppc/pnv_adu.c
+++ b/hw/ppc/pnv_adu.c
@@ -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 },
{ } },
};
diff --git a/hw/ppc/pnv_chiptod.c b/hw/ppc/pnv_chiptod.c
index 4ca511a4dee..b9e9c7ba3db 100644
--- a/hw/ppc/pnv_chiptod.c
+++ b/hw/ppc/pnv_chiptod.c
@@ -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 },
{ }
}
diff --git a/hw/ppc/pnv_i2c.c b/hw/ppc/pnv_i2c.c
index b2f372c8743..60de4794917 100644
--- a/hw/ppc/pnv_i2c.c
+++ b/hw/ppc/pnv_i2c.c
@@ -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 },
{ }
}
diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c
index d92347bcd2c..f6beba0917d 100644
--- a/hw/ppc/pnv_lpc.c
+++ b/hw/ppc/pnv_lpc.c
@@ -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 },
{ }
}
diff --git a/hw/ppc/pnv_n1_chiplet.c b/hw/ppc/pnv_n1_chiplet.c
index 05e3fd6f731..053f6473f22 100644
--- a/hw/ppc/pnv_n1_chiplet.c
+++ b/hw/ppc/pnv_n1_chiplet.c
@@ -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 },
{ }
}
diff --git a/hw/ppc/pnv_nest_pervasive.c b/hw/ppc/pnv_nest_pervasive.c
index b5182d54fa1..1b1b14fed95 100644
--- a/hw/ppc/pnv_nest_pervasive.c
+++ b/hw/ppc/pnv_nest_pervasive.c
@@ -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 },
{ }
}
diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c
index 0fd247e6ade..5d947d8b520 100644
--- a/hw/ppc/pnv_psi.c
+++ b/hw/ppc/pnv_psi.c
@@ -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 },
{ }
}
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 02663851ae9..702f774cda9 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -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 },
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index d0468e3fe64..1ac1185825e 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -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 },
{ }
}
diff --git a/hw/remote/machine.c b/hw/remote/machine.c
index 9fb92ec6f13..e4b47838bad 100644
--- a/hw/remote/machine.c
+++ b/hw/remote/machine.c
@@ -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 },
{ }
}
diff --git a/hw/remote/proxy.c b/hw/remote/proxy.c
index d2de48c9e37..b0165aa2a1d 100644
--- a/hw/remote/proxy.c
+++ b/hw/remote/proxy.c
@@ -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 },
{ },
},
diff --git a/hw/remote/remote-obj.c b/hw/remote/remote-obj.c
index 75f8d6df8a1..85882902d7f 100644
--- a/hw/remote/remote-obj.c
+++ b/hw/remote/remote-obj.c
@@ -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 },
{ }
}
diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c
index b0ae403f060..ea6165ebdce 100644
--- a/hw/remote/vfio-user-obj.c
+++ b/hw/remote/vfio-user-obj.c
@@ -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 },
{ }
}
diff --git a/hw/riscv/riscv-iommu-pci.c b/hw/riscv/riscv-iommu-pci.c
index d93cf7521bd..1f44eef74ea 100644
--- a/hw/riscv/riscv-iommu-pci.c
+++ b/hw/riscv/riscv-iommu-pci.c
@@ -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 },
{ },
},
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 557efd15a13..be1bf0f6468 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -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 },
{ }
},
diff --git a/hw/rtc/m48t59-isa.c b/hw/rtc/m48t59-isa.c
index 4a7c0af9f04..9e2f6563a0a 100644
--- a/hw/rtc/m48t59-isa.c
+++ b/hw/rtc/m48t59-isa.c
@@ -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 },
{ }
}
diff --git a/hw/rtc/m48t59.c b/hw/rtc/m48t59.c
index 821472a680e..68be2dad6f3 100644
--- a/hw/rtc/m48t59.c
+++ b/hw/rtc/m48t59.c
@@ -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 },
{ }
}
diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
index 93b632bdf4a..6f787be7af8 100644
--- a/hw/rtc/mc146818rtc.c
+++ b/hw/rtc/mc146818rtc.c
@@ -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 },
{ },
},
diff --git a/hw/s390x/ap-bridge.c b/hw/s390x/ap-bridge.c
index 4aa7d5a90db..edeb3dbef34 100644
--- a/hw/s390x/ap-bridge.c
+++ b/hw/s390x/ap-bridge.c
@@ -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 },
{ }
}
diff --git a/hw/s390x/css-bridge.c b/hw/s390x/css-bridge.c
index 9d91e5a5fec..0f87b8c5c44 100644
--- a/hw/s390x/css-bridge.c
+++ b/hw/s390x/css-bridge.c
@@ -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 },
{ }
}
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index 838b7e6484f..e6aa44531f6 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -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 },
{ }
}
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 00e9e46aef0..94edd42dd25 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -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},
diff --git a/hw/s390x/virtio-ccw-md.c b/hw/s390x/virtio-ccw-md.c
index de333282df4..0370f584505 100644
--- a/hw/s390x/virtio-ccw-md.c
+++ b/hw/s390x/virtio-ccw-md.c
@@ -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 },
{ }
},
diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
index 74e9af0b5d8..12c86eb7aaa 100644
--- a/hw/scsi/esp-pci.c
+++ b/hw/scsi/esp-pci.c
@@ -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 },
{ },
},
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index 0ad61565bf9..f4f2ef321e1 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -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 },
{ },
},
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index a39e3e0e4fa..55cd188bd57 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -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 },
{ }
},
diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c
index 17f73ce3816..1ebe0b82a79 100644
--- a/hw/scsi/mptsas.c
+++ b/hw/scsi/mptsas.c
@@ -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 },
{ },
},
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index 0456b4de0ad..70be4a7367b 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -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 },
{ }
}
diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index be5a416c1d6..10fde8eee03 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -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 },
{ }
},
diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c
index 807a58ecf4c..8298e8cc6d8 100644
--- a/hw/scsi/vhost-user-scsi.c
+++ b/hw/scsi/vhost-user-scsi.c
@@ -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 },
{ }
},
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index ae67a7682ae..34ae14f7bf9 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -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 },
{ }
}
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index a8ea57ffad3..d5825b67868 100644
--- a/hw/scsi/vmw_pvscsi.c
+++ b/hw/scsi/vmw_pvscsi.c
@@ -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 },
diff --git a/hw/sd/sdhci-pci.c b/hw/sd/sdhci-pci.c
index 2a56fbf2cda..c18b91fe63c 100644
--- a/hw/sd/sdhci-pci.c
+++ b/hw/sd/sdhci-pci.c
@@ -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 },
{ },
},
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 0e5fb4e1b58..e9f9b0a4cb9 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -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 },
{ }
},
diff --git a/hw/ssi/pnv_spi.c b/hw/ssi/pnv_spi.c
index 0bb6b0d935e..f40e8836b9c 100644
--- a/hw/ssi/pnv_spi.c
+++ b/hw/ssi/pnv_spi.c
@@ -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 },
{ }
}
diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c
index 9aff4d1a6ff..bc7a78f898c 100644
--- a/hw/tpm/tpm_crb.c
+++ b/hw/tpm/tpm_crb.c
@@ -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 },
{ }
}
diff --git a/hw/tpm/tpm_spapr.c b/hw/tpm/tpm_spapr.c
index 1cad9a88ead..ea608ba4c80 100644
--- a/hw/tpm/tpm_spapr.c
+++ b/hw/tpm/tpm_spapr.c
@@ -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 },
{ }
}
diff --git a/hw/tpm/tpm_tis_i2c.c b/hw/tpm/tpm_tis_i2c.c
index b97d768a5b5..5ce84dc7a45 100644
--- a/hw/tpm/tpm_tis_i2c.c
+++ b/hw/tpm/tpm_tis_i2c.c
@@ -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 },
{ }
}
diff --git a/hw/tpm/tpm_tis_isa.c b/hw/tpm/tpm_tis_isa.c
index c0098a26e80..dce83057a94 100644
--- a/hw/tpm/tpm_tis_isa.c
+++ b/hw/tpm/tpm_tis_isa.c
@@ -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 },
{ }
diff --git a/hw/tpm/tpm_tis_sysbus.c b/hw/tpm/tpm_tis_sysbus.c
index 19abf0b9486..2ffa85852ac 100644
--- a/hw/tpm/tpm_tis_sysbus.c
+++ b/hw/tpm/tpm_tis_sysbus.c
@@ -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 },
{ }
}
diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c
index 749519760ff..0577747f469 100644
--- a/hw/ufs/ufs.c
+++ b/hw/ufs/ufs.c
@@ -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 = {
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index d8446cf50e6..8dd2ce415eb 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -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 },
{ }
}
diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c
index 87018a3f01a..6ce7154feed 100644
--- a/hw/usb/dev-smartcard-reader.c
+++ b/hw/usb/dev-smartcard-reader.c
@@ -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 },
{ }
}
diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
index 73122aa7971..38ad3406b32 100644
--- a/hw/usb/hcd-ehci-pci.c
+++ b/hw/usb/hcd-ehci-pci.c
@@ -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 },
{ },
},
diff --git a/hw/usb/hcd-ohci-pci.c b/hw/usb/hcd-ohci-pci.c
index 3c82525a1e4..94d1077eb9e 100644
--- a/hw/usb/hcd-ohci-pci.c
+++ b/hw/usb/hcd-ohci-pci.c
@@ -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 },
{ },
},
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 2b1aee1f21f..4822c704f69 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -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 },
{ },
},
diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c
index 6167bb91000..b93c80b09d8 100644
--- a/hw/usb/hcd-xhci-pci.c
+++ b/hw/usb/hcd-xhci-pci.c
@@ -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 },
{ }
diff --git a/hw/vfio/igd.c b/hw/vfio/igd.c
index fd55b8d8840..0a13b185fe3 100644
--- a/hw/vfio/igd.c
+++ b/hw/vfio/igd.c
@@ -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 },
{ },
},
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 0db9f038464..c3d93607104 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -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 },
{ }
diff --git a/hw/virtio/virtio-md-pci.c b/hw/virtio/virtio-md-pci.c
index 9ec50676626..9278b32cf84 100644
--- a/hw/virtio/virtio-md-pci.c
+++ b/hw/virtio/virtio-md-pci.c
@@ -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 },
{ }
},
diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
index 0e14dd37d6e..a3d1a676e71 100644
--- a/hw/virtio/virtio-mem.c
+++ b/hw/virtio/virtio-mem.c
@@ -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 },
{ }
},
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 95bf7ddd972..0fa8fe49556 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -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.
diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c
index 1536e1fe032..bb8a2766b69 100644
--- a/hw/watchdog/wdt_i6300esb.c
+++ b/hw/watchdog/wdt_i6300esb.c
@@ -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 },
{ },
},
diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c
index e6272282cdd..6bd2e546f6b 100644
--- a/hw/xen/xen-bus.c
+++ b/hw/xen/xen-bus.c
@@ -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 },
{ }
},
diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c
index d6fe7d4f3e6..5ed53f8943e 100644
--- a/hw/xen/xen-legacy-backend.c
+++ b/hw/xen/xen-legacy-backend.c
@@ -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 },
{ }
}
diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index 7f9c351d967..9d16644d82e 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -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 },
{ },
diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c
index 264851ece36..2c0cec97234 100644
--- a/hw/xen/xen_pt_graphics.c
+++ b/hw/xen/xen_pt_graphics.c
@@ -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 },
{ },
},
diff --git a/net/can/can_core.c b/net/can/can_core.c
index e16e15c036e..77fe2b8ba48 100644
--- a/net/can/can_core.c
+++ b/net/can/can_core.c
@@ -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 },
{ }
}
diff --git a/net/can/can_host.c b/net/can/can_host.c
index ca5fcf1ea12..3f9bb33e474 100644
--- a/net/can/can_host.c
+++ b/net/can/can_host.c
@@ -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 },
{ }
}
diff --git a/net/colo-compare.c b/net/colo-compare.c
index 425eb6e9718..0e1844ee4cb 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -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 },
{ }
}
diff --git a/net/filter.c b/net/filter.c
index 03b3c793f76..c7cc6615dc9 100644
--- a/net/filter.c
+++ b/net/filter.c
@@ -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 },
{ }
}
diff --git a/scsi/pr-manager.c b/scsi/pr-manager.c
index 1977d99ce0d..40e1210eb21 100644
--- a/scsi/pr-manager.c
+++ b/scsi/pr-manager.c
@@ -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 },
{ }
}
diff --git a/system/qtest.c b/system/qtest.c
index b7689088a49..ade3eb32212 100644
--- a/system/qtest.c
+++ b/system/qtest.c
@@ -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 },
{ }
}
diff --git a/target/i386/sev.c b/target/i386/sev.c
index 7ef4801d5fb..7ee700d6a35 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -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 },
{ }
}
diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 90b21b9c930..aed9e265992 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -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 },
{ }
},
diff --git a/tests/unit/check-qom-interface.c b/tests/unit/check-qom-interface.c
index 4e1c4d67297..86ae5f6c3b1 100644
--- a/tests/unit/check-qom-interface.c
+++ b/tests/unit/check-qom-interface.c
@@ -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 },
{ }
}
diff --git a/tests/unit/check-qom-proplist.c b/tests/unit/check-qom-proplist.c
index f1de1618f60..ee3c6fb32b1 100644
--- a/tests/unit/check-qom-proplist.c
+++ b/tests/unit/check-qom-proplist.c
@@ -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 },
{ }
}
diff --git a/ui/dbus.c b/ui/dbus.c
index 0c0f86eaa6f..dd0336702de 100644
--- a/ui/dbus.c
+++ b/ui/dbus.c
@@ -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 },
{ }
}
diff --git a/ui/input-barrier.c b/ui/input-barrier.c
index 9dce31ea9a7..9793258aac1 100644
--- a/ui/input-barrier.c
+++ b/ui/input-barrier.c
@@ -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 },
{ }
}
diff --git a/ui/input-linux.c b/ui/input-linux.c
index 2f5adb82d24..92e1a1aa64a 100644
--- a/ui/input-linux.c
+++ b/ui/input-linux.c
@@ -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 },
{ }
}
diff --git a/util/thread-context.c b/util/thread-context.c
index 95228a3d4f6..0146154fa56 100644
--- a/util/thread-context.c
+++ b/util/thread-context.c
@@ -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 },
{ }
}
diff --git a/hw/display/apple-gfx-pci.m b/hw/display/apple-gfx-pci.m
index 2f0d24f7fee..b0694f4cb85 100644
--- a/hw/display/apple-gfx-pci.m
+++ b/hw/display/apple-gfx-pci.m
@@ -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 },
{ },
},
diff --git a/scripts/codeconverter/codeconverter/test_regexps.py b/scripts/codeconverter/codeconverter/test_regexps.py
index 08857c5008d..4526268ae80 100644
--- a/scripts/codeconverter/codeconverter/test_regexps.py
+++ b/scripts/codeconverter/codeconverter/test_regexps.py
@@ -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 },
{ }
}
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 17/58] qom/object: Fix type conflict of GLib function pointers
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (14 preceding siblings ...)
2025-04-25 15:28 ` [PULL 16/58] qom: Make InterfaceInfo[] uses const Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 18/58] hw/core: Get default_cpu_type calling machine_class_default_cpu_type() Philippe Mathieu-Daudé
` (41 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Kohei Tokunaga, Philippe Mathieu-Daudé
From: Kohei Tokunaga <ktokunaga.mail@gmail.com>
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.
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <8ca13f4e2b9eba9d1f6030b0afb442a24330e463.1745295397.git.ktokunaga.mail@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
qom/object.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/qom/object.c b/qom/object.c
index 425ee2f0ee8..664f0f24ae8 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -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)
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 18/58] hw/core: Get default_cpu_type calling machine_class_default_cpu_type()
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (15 preceding siblings ...)
2025-04-25 15:28 ` [PULL 17/58] qom/object: Fix type conflict of GLib function pointers Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 19/58] hw/core/cpu: gdb_arch_name string should not be freed Philippe Mathieu-Daudé
` (40 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, qemu-stable, Richard Henderson,
Pierrick Bouvier, Zhao Liu
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.
Cc: qemu-stable@nongnu.org
Fixes: 62b4a227a33 ("hw/core: Add machine_class_default_cpu_type()")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20250422084114.39499-1-philmd@linaro.org>
---
hw/core/machine-qmp-cmds.c | 5 +++--
target/ppc/cpu_init.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index fd8b4e0b44c..9447e345b3c 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -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);
diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index aed9e265992..b0973b6df95 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -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
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 19/58] hw/core/cpu: gdb_arch_name string should not be freed
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (16 preceding siblings ...)
2025-04-25 15:28 ` [PULL 18/58] hw/core: Get default_cpu_type calling machine_class_default_cpu_type() Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 20/58] gdbstub: Allow gdb_core_xml_file to be set at runtime Philippe Mathieu-Daudé
` (39 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Alex Bennée, Philippe Mathieu-Daudé
From: Peter Maydell <peter.maydell@linaro.org>
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()")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250317142819.900029-2-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/core/cpu.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 5b645df59f5..6ea246514ea 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -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.
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 20/58] gdbstub: Allow gdb_core_xml_file to be set at runtime
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (17 preceding siblings ...)
2025-04-25 15:28 ` [PULL 19/58] hw/core/cpu: gdb_arch_name string should not be freed Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 21/58] target/arm: Handle AArch64 in TYPE_ARM_CPU gdb_arch_name Philippe Mathieu-Daudé
` (38 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Alex Bennée, Philippe Mathieu-Daudé
From: Peter Maydell <peter.maydell@linaro.org>
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.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250317142819.900029-3-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/core/cpu.h | 5 +++++
gdbstub/gdbstub.c | 23 +++++++++++++++++++----
2 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 6ea246514ea..2a02d4f0789 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -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);
diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index 282e13e163f..565f6b33a90 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -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;
}
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 21/58] target/arm: Handle AArch64 in TYPE_ARM_CPU gdb_arch_name
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (18 preceding siblings ...)
2025-04-25 15:28 ` [PULL 20/58] gdbstub: Allow gdb_core_xml_file to be set at runtime Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 22/58] target/arm: Handle gdb_core_xml_file in TYPE_ARM_CPU Philippe Mathieu-Daudé
` (37 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Alex Bennée, Philippe Mathieu-Daudé
From: Peter Maydell <peter.maydell@linaro.org>
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?".
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250317142819.900029-4-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/arm/internals.h | 6 ++++++
target/arm/cpu.c | 3 +++
target/arm/cpu64.c | 6 ------
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/target/arm/internals.h b/target/arm/internals.h
index d24acdd672e..08f4bd16791 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -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);
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 00577f97eb6..bed0e58f3c0 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -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";
}
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index eaf5705cdc2..fbb7e7b3d64 100644
--- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c
@@ -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);
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 22/58] target/arm: Handle gdb_core_xml_file in TYPE_ARM_CPU
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (19 preceding siblings ...)
2025-04-25 15:28 ` [PULL 21/58] target/arm: Handle AArch64 in TYPE_ARM_CPU gdb_arch_name Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 23/58] target/arm: Handle AArch64 gdb read/write regs " Philippe Mathieu-Daudé
` (36 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Philippe Mathieu-Daudé
From: Peter Maydell <peter.maydell@linaro.org>
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.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250317142819.900029-5-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/arm/cpu.c | 16 +++++++++++++++-
target/arm/cpu64.c | 1 -
target/arm/tcg/cpu-v7m.c | 1 -
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index bed0e58f3c0..5e951675c60 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -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;
}
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index fbb7e7b3d64..5135ef63cb2 100644
--- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c
@@ -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);
diff --git a/target/arm/tcg/cpu-v7m.c b/target/arm/tcg/cpu-v7m.c
index 7426aac0dc4..b34b6578574 100644
--- a/target/arm/tcg/cpu-v7m.c
+++ b/target/arm/tcg/cpu-v7m.c
@@ -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[] = {
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 23/58] target/arm: Handle AArch64 gdb read/write regs in TYPE_ARM_CPU
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (20 preceding siblings ...)
2025-04-25 15:28 ` [PULL 22/58] target/arm: Handle gdb_core_xml_file in TYPE_ARM_CPU Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 24/58] target/arm: Replace target_ulong -> hwaddr in ARMMMUFaultInfo Philippe Mathieu-Daudé
` (35 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Philippe Mathieu-Daudé
From: Peter Maydell <peter.maydell@linaro.org>
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.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250317142819.900029-6-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/arm/cpu64.c | 5 -----
target/arm/gdbstub.c | 12 ++++++++++++
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index 5135ef63cb2..00629a5d1d1 100644
--- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c
@@ -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",
diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c
index 30068c22627..ce4497ad7c3 100644
--- a/target/arm/gdbstub.c
+++ b/target/arm/gdbstub.c
@@ -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);
/*
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 24/58] target/arm: Replace target_ulong -> hwaddr in ARMMMUFaultInfo
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (21 preceding siblings ...)
2025-04-25 15:28 ` [PULL 23/58] target/arm: Handle AArch64 gdb read/write regs " Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 25/58] target/arm: Replace target_ulong -> vaddr for CPUWatchpoint Philippe Mathieu-Daudé
` (34 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Pierrick Bouvier, Richard Henderson
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250415172246.79470-2-philmd@linaro.org>
---
target/arm/internals.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/target/arm/internals.h b/target/arm/internals.h
index 08f4bd16791..0818de530b2 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -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;
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 25/58] target/arm: Replace target_ulong -> vaddr for CPUWatchpoint
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (22 preceding siblings ...)
2025-04-25 15:28 ` [PULL 24/58] target/arm: Replace target_ulong -> hwaddr in ARMMMUFaultInfo Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 26/58] target/mips: Fix MIPS16e translation Philippe Mathieu-Daudé
` (33 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Pierrick Bouvier, Richard Henderson
CPUWatchpoint::vaddr/len are of type vaddr.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250415172246.79470-4-philmd@linaro.org>
---
target/arm/internals.h | 9 +++++----
target/arm/hyp_gdbstub.c | 8 ++++----
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/target/arm/internals.h b/target/arm/internals.h
index 0818de530b2..4d3d84ffebd 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -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);
diff --git a/target/arm/hyp_gdbstub.c b/target/arm/hyp_gdbstub.c
index 1e861263b3d..0512d67f8cf 100644
--- a/target/arm/hyp_gdbstub.c
+++ b/target/arm/hyp_gdbstub.c
@@ -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;
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 26/58] target/mips: Fix MIPS16e translation
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (23 preceding siblings ...)
2025-04-25 15:28 ` [PULL 25/58] target/arm: Replace target_ulong -> vaddr for CPUWatchpoint Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 27/58] exec: Rename target_words_bigendian() -> target_big_endian() Philippe Mathieu-Daudé
` (32 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Hauke Mehrtens, qemu-stable, Philippe Mathieu-Daudé
From: Hauke Mehrtens <hauke@hauke-m.de>
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.
Cc: qemu-stable@nongnu.org
Fixes: d0b24b7f50e1 ("target/mips: Use gen_op_addr_addi() when possible")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250412194003.181411-1-hauke@hauke-m.de>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/mips/tcg/mips16e_translate.c.inc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/mips/tcg/mips16e_translate.c.inc b/target/mips/tcg/mips16e_translate.c.inc
index a9af8f1e74a..97da3456ea5 100644
--- a/target/mips/tcg/mips16e_translate.c.inc
+++ b/target/mips/tcg/mips16e_translate.c.inc
@@ -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)
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 27/58] exec: Rename target_words_bigendian() -> target_big_endian()
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (24 preceding siblings ...)
2025-04-25 15:28 ` [PULL 26/58] target/mips: Fix MIPS16e translation Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 28/58] hw/usb/hcd-xhci: Unmap canceled packet Philippe Mathieu-Daudé
` (31 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Michael S. Tsirkin, Pierrick Bouvier
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)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20250417210025.68322-1-philmd@linaro.org>
---
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(-)
diff --git a/include/exec/tswap.h b/include/exec/tswap.h
index 84060a49994..49511f26117 100644
--- a/include/exec/tswap.h
+++ b/include/exec/tswap.h
@@ -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); \
diff --git a/system/memory-internal.h b/system/memory-internal.h
index 085e81a9fe4..29717b3c58f 100644
--- a/system/memory-internal.h
+++ b/system/memory-internal.h
@@ -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;
}
diff --git a/cpu-target.c b/cpu-target.c
index c99d208a7c4..d68cbab5da9 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -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;
}
diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c
index 82b68b8927d..3c84176a0c5 100644
--- a/hw/core/cpu-system.c
+++ b/hw/core/cpu-system.c
@@ -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)
diff --git a/hw/display/vga.c b/hw/display/vga.c
index b01f67c65fb..20475ebbd31 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -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);
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index f0fa36f8ce8..480c2e50365 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -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;
diff --git a/system/memory.c b/system/memory.c
index 7e2f16f4e95..67e433095b4 100644
--- a/system/memory.c
+++ b/system/memory.c
@@ -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();
diff --git a/system/qtest.c b/system/qtest.c
index ade3eb32212..301b03be2d3 100644
--- a/system/qtest.c
+++ b/system/qtest.c
@@ -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");
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 28/58] hw/usb/hcd-xhci: Unmap canceled packet
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (25 preceding siblings ...)
2025-04-25 15:28 ` [PULL 27/58] exec: Rename target_words_bigendian() -> target_big_endian() Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 29/58] hw/intc/i8259: Remove unused DEBUG_PIC define Philippe Mathieu-Daudé
` (30 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Akihiko Odaki, Philippe Mathieu-Daudé
From: Akihiko Odaki <akihiko.odaki@daynix.com>
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")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250418-xhc-v1-1-bb32dab6a67e@daynix.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/usb/hcd-xhci.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index b3785b8ba6c..292c378bfc9 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -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;
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 29/58] hw/intc/i8259: Remove unused DEBUG_PIC define
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (26 preceding siblings ...)
2025-04-25 15:28 ` [PULL 28/58] hw/usb/hcd-xhci: Unmap canceled packet Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 30/58] hw/core/loader: Fix type conflict of GLib function pointers Philippe Mathieu-Daudé
` (29 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: BALATON Zoltan, Philippe Mathieu-Daudé, Mark Cave-Ayland
From: BALATON Zoltan <balaton@eik.bme.hu>
The debug printfs were converted to traces so this define is now unused.
Fixes: 0880a87300 (i8259: convert DPRINTFs into trace)
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Message-ID: <20250423101125.B243A55C592@zero.eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/intc/i8259.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c
index 2359dd82534..b6f96bf208c 100644
--- a/hw/intc/i8259.c
+++ b/hw/intc/i8259.c
@@ -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;
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 30/58] hw/core/loader: Fix type conflict of GLib function pointers
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (27 preceding siblings ...)
2025-04-25 15:28 ` [PULL 29/58] hw/intc/i8259: Remove unused DEBUG_PIC define Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 31/58] hw/net/can: " Philippe Mathieu-Daudé
` (28 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Kohei Tokunaga, Philippe Mathieu-Daudé
From: Kohei Tokunaga <ktokunaga.mail@gmail.com>
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.
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <26dfe9191154ca65dca6ef51ce768ad2a0c30d5f.1745295397.git.ktokunaga.mail@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/core/loader.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/core/loader.c b/hw/core/loader.c
index a3aa62d132e..b792a54bb02 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -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;
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 31/58] hw/net/can: Fix type conflict of GLib function pointers
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (28 preceding siblings ...)
2025-04-25 15:28 ` [PULL 30/58] hw/core/loader: Fix type conflict of GLib function pointers Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 32/58] contrib/plugins: " Philippe Mathieu-Daudé
` (27 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel
Cc: Kohei Tokunaga, Philippe Mathieu-Daudé, Francisco Iglesias
From: Kohei Tokunaga <ktokunaga.mail@gmail.com>
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.
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Francisco Iglesias <francisco.iglesias@amd.com>
Message-ID: <4d47a75c5768c9a6dc5d8b3504e78837577ad70d.1745295397.git.ktokunaga.mail@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/net/can/xlnx-versal-canfd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/net/can/xlnx-versal-canfd.c b/hw/net/can/xlnx-versal-canfd.c
index 79ccc10098a..3eb111949f8 100644
--- a/hw/net/can/xlnx-versal-canfd.c
+++ b/hw/net/can/xlnx-versal-canfd.c
@@ -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;
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 32/58] contrib/plugins: Fix type conflict of GLib function pointers
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (29 preceding siblings ...)
2025-04-25 15:28 ` [PULL 31/58] hw/net/can: " Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 33/58] system/vl: " Philippe Mathieu-Daudé
` (26 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Kohei Tokunaga, Philippe Mathieu-Daudé
From: Kohei Tokunaga <ktokunaga.mail@gmail.com>
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.
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <0fcddfca16ca8da2bdaa7b2c114476f5b73d032b.1745295397.git.ktokunaga.mail@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
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(-)
diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c
index 7cfd3df249e..56508587d3a 100644
--- a/contrib/plugins/cache.c
+++ b/contrib/plugins/cache.c
@@ -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) {
diff --git a/contrib/plugins/cflow.c b/contrib/plugins/cflow.c
index 930ecb46fcd..b5e33f25f9b 100644
--- a/contrib/plugins/cflow.c
+++ b/contrib/plugins/cflow.c
@@ -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;
diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c
index f12bfb7a267..98404b68852 100644
--- a/contrib/plugins/hotblocks.c
+++ b/contrib/plugins/hotblocks.c
@@ -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");
diff --git a/contrib/plugins/hotpages.c b/contrib/plugins/hotpages.c
index c6e64937194..9d48ac969eb 100644
--- a/contrib/plugins/hotpages.c
+++ b/contrib/plugins/hotpages.c
@@ -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;
diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c
index 2aa9029c3f0..42bddb6566d 100644
--- a/contrib/plugins/howvec.c
+++ b/contrib/plugins/howvec.c
@@ -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)) {
diff --git a/contrib/plugins/hwprofile.c b/contrib/plugins/hwprofile.c
index 2a4cbc47d40..a9838ccc879 100644
--- a/contrib/plugins/hwprofile.c
+++ b/contrib/plugins/hwprofile.c
@@ -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);
diff --git a/tests/tcg/plugins/mem.c b/tests/tcg/plugins/mem.c
index d87d6628e09..ca4e8883dd2 100644
--- a/tests/tcg/plugins/mem.c
+++ b/tests/tcg/plugins/mem.c
@@ -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");
diff --git a/tests/tcg/plugins/syscall.c b/tests/tcg/plugins/syscall.c
index 47aad55fc1b..42801f5c863 100644
--- a/tests/tcg/plugins/syscall.c
+++ b/tests/tcg/plugins/syscall.c
@@ -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);
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 33/58] system/vl: Fix type conflict of GLib function pointers
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (30 preceding siblings ...)
2025-04-25 15:28 ` [PULL 32/58] contrib/plugins: " Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 34/58] system/memory: Remove DEVICE_HOST_ENDIAN definition Philippe Mathieu-Daudé
` (25 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Kohei Tokunaga, Philippe Mathieu-Daudé
From: Kohei Tokunaga <ktokunaga.mail@gmail.com>
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.
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <e9a50b76c54cc64fc9985186f0aef3fcc2024da6.1745295397.git.ktokunaga.mail@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
system/vl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/system/vl.c b/system/vl.c
index c17945c4939..4ab2001df75 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -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) {
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 34/58] system/memory: Remove DEVICE_HOST_ENDIAN definition
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (31 preceding siblings ...)
2025-04-25 15:28 ` [PULL 33/58] system/vl: " Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 35/58] system/datadir: Add new type constant for DTB files Philippe Mathieu-Daudé
` (24 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, David Hildenbrand, Richard Henderson
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.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250423111625.10424-1-philmd@linaro.org>
---
include/exec/cpu-common.h | 6 ------
system/memory-internal.h | 3 ---
system/memory.c | 2 +-
3 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index 9b83fd7ac88..dab1e7e5809 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -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;
diff --git a/system/memory-internal.h b/system/memory-internal.h
index 29717b3c58f..46f758fa7e4 100644
--- a/system/memory-internal.h
+++ b/system/memory-internal.h
@@ -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();
}
diff --git a/system/memory.c b/system/memory.c
index 67e433095b4..71434e7ad02 100644
--- a/system/memory.c
+++ b/system/memory.c
@@ -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,
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 35/58] system/datadir: Add new type constant for DTB files
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (32 preceding siblings ...)
2025-04-25 15:28 ` [PULL 34/58] system/memory: Remove DEVICE_HOST_ENDIAN definition Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 36/58] pc-bios: Move device tree files in their own subdir Philippe Mathieu-Daudé
` (23 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: BALATON Zoltan, Philippe Mathieu-Daudé
From: BALATON Zoltan <balaton@eik.bme.hu>
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.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <ae793d1f81e3577605759c43871722324a1ef2cb.1745402140.git.balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
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(-)
diff --git a/include/qemu/datadir.h b/include/qemu/datadir.h
index 21f9097f582..cca32af3008 100644
--- a/include/qemu/datadir.h
+++ b/include/qemu/datadir.h
@@ -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);
diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
index 60b4ef0abe7..4a9c9df3181 100644
--- a/hw/microblaze/boot.c
+++ b/hw/microblaze/boot.c
@@ -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;
diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c
index 099fda39092..6fff0d8afbc 100644
--- a/hw/ppc/ppc440_bamboo.c
+++ b/hw/ppc/ppc440_bamboo.c
@@ -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;
}
diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
index a070de23cf2..ee31bd8f349 100644
--- a/hw/ppc/sam460ex.c
+++ b/hw/ppc/sam460ex.c
@@ -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);
diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
index 17115be74d5..c9969ae48a8 100644
--- a/hw/ppc/virtex_ml507.c
+++ b/hw/ppc/virtex_ml507.c
@@ -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);
diff --git a/system/datadir.c b/system/datadir.c
index c9237cb5d4a..e450b84ce91 100644
--- a/system/datadir.c
+++ b/system/datadir.c
@@ -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:
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 36/58] pc-bios: Move device tree files in their own subdir
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (33 preceding siblings ...)
2025-04-25 15:28 ` [PULL 35/58] system/datadir: Add new type constant for DTB files Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-05-29 18:18 ` Bernhard Beschow
2025-04-25 15:28 ` [PULL 37/58] meson: Use has_header_symbol() to check getcpu() Philippe Mathieu-Daudé
` (22 subsequent siblings)
57 siblings, 1 reply; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: BALATON Zoltan, Philippe Mathieu-Daudé
From: BALATON Zoltan <balaton@eik.bme.hu>
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.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
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%)
diff --git a/MAINTAINERS b/MAINTAINERS
index 661a47db5ac..d82d962f1a4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -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
diff --git a/system/datadir.c b/system/datadir.c
index e450b84ce91..f96f8fc2646 100644
--- a/system/datadir.c
+++ b/system/datadir.c
@@ -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;
diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
similarity index 100%
rename from pc-bios/bamboo.dtb
rename to pc-bios/dtb/bamboo.dtb
diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
similarity index 100%
rename from pc-bios/bamboo.dts
rename to pc-bios/dtb/bamboo.dts
diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
similarity index 100%
rename from pc-bios/canyonlands.dtb
rename to pc-bios/dtb/canyonlands.dtb
diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
similarity index 100%
rename from pc-bios/canyonlands.dts
rename to pc-bios/dtb/canyonlands.dts
diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
new file mode 100644
index 00000000000..7a71835bca7
--- /dev/null
+++ b/pc-bios/dtb/meson.build
@@ -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
diff --git a/pc-bios/petalogix-ml605.dtb b/pc-bios/dtb/petalogix-ml605.dtb
similarity index 100%
rename from pc-bios/petalogix-ml605.dtb
rename to pc-bios/dtb/petalogix-ml605.dtb
diff --git a/pc-bios/petalogix-ml605.dts b/pc-bios/dtb/petalogix-ml605.dts
similarity index 100%
rename from pc-bios/petalogix-ml605.dts
rename to pc-bios/dtb/petalogix-ml605.dts
diff --git a/pc-bios/petalogix-s3adsp1800.dtb b/pc-bios/dtb/petalogix-s3adsp1800.dtb
similarity index 100%
rename from pc-bios/petalogix-s3adsp1800.dtb
rename to pc-bios/dtb/petalogix-s3adsp1800.dtb
diff --git a/pc-bios/petalogix-s3adsp1800.dts b/pc-bios/dtb/petalogix-s3adsp1800.dts
similarity index 100%
rename from pc-bios/petalogix-s3adsp1800.dts
rename to pc-bios/dtb/petalogix-s3adsp1800.dts
diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index 34d6616c32b..34d8cc4f338 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -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')
diff --git a/qemu.nsi b/qemu.nsi
index b186f223e14..d419986ca06 100644
--- a/qemu.nsi
+++ b/qemu.nsi
@@ -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
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 37/58] meson: Use has_header_symbol() to check getcpu()
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (34 preceding siblings ...)
2025-04-25 15:28 ` [PULL 36/58] pc-bios: Move device tree files in their own subdir Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 38/58] meson: Remove CONFIG_STATX and CONFIG_STATX_MNT_ID Philippe Mathieu-Daudé
` (21 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Akihiko Odaki, qemu-stable, Philippe Mathieu-Daudé
From: Akihiko Odaki <akihiko.odaki@daynix.com>
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.
Cc: qemu-stable@nongnu.org
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250424-buildsys-v1-1-97655e3b25d7@daynix.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
meson.build | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index bcb9d39a387..f77a9ce569e 100644
--- a/meson.build
+++ b/meson.build
@@ -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'))
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 38/58] meson: Remove CONFIG_STATX and CONFIG_STATX_MNT_ID
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (35 preceding siblings ...)
2025-04-25 15:28 ` [PULL 37/58] meson: Use has_header_symbol() to check getcpu() Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 39/58] meson: Share common C source prefixes Philippe Mathieu-Daudé
` (20 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Akihiko Odaki, qemu-stable, Philippe Mathieu-Daudé
From: Akihiko Odaki <akihiko.odaki@daynix.com>
CONFIG_STATX and CONFIG_STATX_MNT_ID are not used since commit
e0dc2631ec4 ("virtiofsd: Remove source").
Cc: qemu-stable@nongnu.org
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250424-buildsys-v1-2-97655e3b25d7@daynix.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
meson.build | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/meson.build b/meson.build
index f77a9ce569e..35dcec8ce5c 100644
--- a/meson.build
+++ b/meson.build
@@ -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())
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 39/58] meson: Share common C source prefixes
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (36 preceding siblings ...)
2025-04-25 15:28 ` [PULL 38/58] meson: Remove CONFIG_STATX and CONFIG_STATX_MNT_ID Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 40/58] meson: Use osdep_prefix for strchrnul() Philippe Mathieu-Daudé
` (19 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Akihiko Odaki, qemu-stable, Philippe Mathieu-Daudé
From: Akihiko Odaki <akihiko.odaki@daynix.com>
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.
Cc: qemu-stable@nongnu.org
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250424-buildsys-v1-3-97655e3b25d7@daynix.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
meson.build | 68 +++++++++++++++++++++++++----------------------------
1 file changed, 32 insertions(+), 36 deletions(-)
diff --git a/meson.build b/meson.build
index 35dcec8ce5c..d93dbde194f 100644
--- a/meson.build
+++ b/meson.build
@@ -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) {
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 40/58] meson: Use osdep_prefix for strchrnul()
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (37 preceding siblings ...)
2025-04-25 15:28 ` [PULL 39/58] meson: Share common C source prefixes Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 41/58] system/kvm: make functions accessible from common code Philippe Mathieu-Daudé
` (18 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Akihiko Odaki, qemu-stable, Philippe Mathieu-Daudé
From: Akihiko Odaki <akihiko.odaki@daynix.com>
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.
Cc: qemu-stable@nongnu.org
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250424-buildsys-v1-4-97655e3b25d7@daynix.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
meson.build | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index d93dbde194f..c736a6f4c4b 100644
--- a/meson.build
+++ b/meson.build
@@ -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',
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 41/58] system/kvm: make functions accessible from common code
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (38 preceding siblings ...)
2025-04-25 15:28 ` [PULL 40/58] meson: Use osdep_prefix for strchrnul() Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 42/58] accel/tcg: Correct list of included headers in tcg-stub.c Philippe Mathieu-Daudé
` (17 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Pierrick Bouvier, Philippe Mathieu-Daudé
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250424232829.141163-8-pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/system/kvm.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/system/kvm.h b/include/system/kvm.h
index 18811cad6fd..b690dda1370 100644
--- a/include/system/kvm.h
+++ b/include/system/kvm.h
@@ -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, ...) \
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 42/58] accel/tcg: Correct list of included headers in tcg-stub.c
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (39 preceding siblings ...)
2025-04-25 15:28 ` [PULL 41/58] system/kvm: make functions accessible from common code Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 43/58] target/hexagon: Include missing 'accel/tcg/getpc.h' Philippe Mathieu-Daudé
` (16 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Mark Cave-Ayland
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'")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Message-Id: <20250424094653.35932-4-philmd@linaro.org>
---
accel/stubs/tcg-stub.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c
index b2b9881bdfb..3b76b8b17c1 100644
--- a/accel/stubs/tcg-stub.c
+++ b/accel/stubs/tcg-stub.c
@@ -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)
{
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 43/58] target/hexagon: Include missing 'accel/tcg/getpc.h'
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (40 preceding siblings ...)
2025-04-25 15:28 ` [PULL 42/58] accel/tcg: Correct list of included headers in tcg-stub.c Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 44/58] linux-user/elfload: Use target_needs_bswap() Philippe Mathieu-Daudé
` (15 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Mark Cave-Ayland, Brian Cain
Since the macros.h headers call GETPC(), they need to
include "accel/tcg/getpc.h", which defines it.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Reviewed-by: Brian Cain <brian.cain@oss.qualcomm.com>
Message-Id: <20250424094653.35932-9-philmd@linaro.org>
---
target/hexagon/macros.h | 1 +
target/hexagon/mmvec/macros.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/target/hexagon/macros.h b/target/hexagon/macros.h
index e5eb31e6711..9ba9be408db 100644
--- a/target/hexagon/macros.h
+++ b/target/hexagon/macros.h
@@ -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, \
diff --git a/target/hexagon/mmvec/macros.h b/target/hexagon/mmvec/macros.h
index bcd4a1e8973..c1a88392c05 100644
--- a/target/hexagon/mmvec/macros.h
+++ b/target/hexagon/mmvec/macros.h
@@ -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))
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 44/58] linux-user/elfload: Use target_needs_bswap()
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (41 preceding siblings ...)
2025-04-25 15:28 ` [PULL 43/58] target/hexagon: Include missing 'accel/tcg/getpc.h' Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 45/58] accel/kvm: " Philippe Mathieu-Daudé
` (14 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
Check whether we need to swap at runtime using
target_needs_bswap().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250417131004.47205-2-philmd@linaro.org>
---
linux-user/elfload.c | 63 +++++++++++++++++++++++++++-----------------
1 file changed, 39 insertions(+), 24 deletions(-)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 99811af5e7b..fbfdec2f17c 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -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.
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 45/58] accel/kvm: Use target_needs_bswap()
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (42 preceding siblings ...)
2025-04-25 15:28 ` [PULL 44/58] linux-user/elfload: Use target_needs_bswap() Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 46/58] target/mips: Check CPU endianness at runtime using env_is_bigendian() Philippe Mathieu-Daudé
` (13 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
Check whether we need to swap at runtime using
target_needs_bswap().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250417131004.47205-3-philmd@linaro.org>
---
accel/kvm/kvm-all.c | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index b8c68c7819a..278a50690c9 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -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;
}
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 46/58] target/mips: Check CPU endianness at runtime using env_is_bigendian()
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (43 preceding siblings ...)
2025-04-25 15:28 ` [PULL 45/58] accel/kvm: " Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 47/58] target/xtensa: Evaluate TARGET_BIG_ENDIAN at compile time Philippe Mathieu-Daudé
` (12 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
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.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250417131004.47205-4-philmd@linaro.org>
---
target/mips/tcg/msa_helper.c | 34 ++++++++++++++++------------------
1 file changed, 16 insertions(+), 18 deletions(-)
diff --git a/target/mips/tcg/msa_helper.c b/target/mips/tcg/msa_helper.c
index 14de4a71ff6..e349344647c 100644
--- a/target/mips/tcg/msa_helper.c
+++ b/target/mips/tcg/msa_helper.c
@@ -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);
}
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 47/58] target/xtensa: Evaluate TARGET_BIG_ENDIAN at compile time
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (44 preceding siblings ...)
2025-04-25 15:28 ` [PULL 46/58] target/mips: Check CPU endianness at runtime using env_is_bigendian() Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 48/58] hw/mips: " Philippe Mathieu-Daudé
` (11 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
Rather than evaluating TARGET_BIG_ENDIAN at preprocessing
time via #ifdef'ry, do it in C at compile time
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250417131004.47205-6-philmd@linaro.org>
---
target/xtensa/translate.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 5ebd4a512c9..2af83c07c2e 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -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);
}
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 48/58] hw/mips: Evaluate TARGET_BIG_ENDIAN at compile time
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (45 preceding siblings ...)
2025-04-25 15:28 ` [PULL 47/58] target/xtensa: Evaluate TARGET_BIG_ENDIAN at compile time Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 49/58] hw/microblaze: " Philippe Mathieu-Daudé
` (10 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
Rather than evaluating TARGET_BIG_ENDIAN at preprocessing
time via #ifdef'ry, do it in C at compile time
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250417131004.47205-7-philmd@linaro.org>
---
hw/mips/jazz.c | 11 ++++-------
hw/mips/malta.c | 21 ++++++---------------
hw/mips/mipssim.c | 11 ++++-------
3 files changed, 14 insertions(+), 29 deletions(-)
diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c
index cee92e1825e..7fb0b97a388 100644
--- a/hw/mips/jazz.c
+++ b/hw/mips/jazz.c
@@ -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);
diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index 8e9cea70b13..cbdbb210568 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -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
}
/*
diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c
index b6dabf2893a..e843307b9b6 100644
--- a/hw/mips/mipssim.c
+++ b/hw/mips/mipssim.c
@@ -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);
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 49/58] hw/microblaze: Evaluate TARGET_BIG_ENDIAN at compile time
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (46 preceding siblings ...)
2025-04-25 15:28 ` [PULL 48/58] hw/mips: " Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 50/58] qapi: Rename TargetInfo structure as QemuTargetInfo Philippe Mathieu-Daudé
` (9 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Richard Henderson
Rather than evaluating TARGET_BIG_ENDIAN at preprocessing
time via #ifdef'ry, do it in C at compile time
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250417131004.47205-8-philmd@linaro.org>
---
hw/microblaze/petalogix_ml605_mmu.c | 12 ++++++------
hw/microblaze/xlnx-zynqmp-pmu.c | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c
index c887c7a99ed..bea6b689fd1 100644
--- a/hw/microblaze/petalogix_ml605_mmu.c
+++ b/hw/microblaze/petalogix_ml605_mmu.c
@@ -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;
}
diff --git a/hw/microblaze/xlnx-zynqmp-pmu.c b/hw/microblaze/xlnx-zynqmp-pmu.c
index ea1430f4081..ed40b5f2e05 100644
--- a/hw/microblaze/xlnx-zynqmp-pmu.c
+++ b/hw/microblaze/xlnx-zynqmp-pmu.c
@@ -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;
}
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 50/58] qapi: Rename TargetInfo structure as QemuTargetInfo
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (47 preceding siblings ...)
2025-04-25 15:28 ` [PULL 49/58] hw/microblaze: " Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 51/58] qemu: Introduce target_cpu_type() Philippe Mathieu-Daudé
` (8 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Pierrick Bouvier, Richard Henderson,
Markus Armbruster
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.
Suggested-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20250422145502.70770-2-philmd@linaro.org>
---
qapi/machine.json | 10 +++++-----
hw/core/machine-qmp-cmds.c | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/qapi/machine.json b/qapi/machine.json
index a9ff8076317..c8feb9fe17b 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -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:
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 9447e345b3c..a5e635152dc 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -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);
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 51/58] qemu: Introduce target_cpu_type()
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (48 preceding siblings ...)
2025-04-25 15:28 ` [PULL 50/58] qapi: Rename TargetInfo structure as QemuTargetInfo Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 52/58] cpus: Replace CPU_RESOLVING_TYPE -> target_cpu_type() Philippe Mathieu-Daudé
` (7 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Pierrick Bouvier
Introduce the target_cpu_type() helper to access the
CPU_RESOLVING_TYPE target-specific definition from
target-agnostic code.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20250417165430.58213-2-philmd@linaro.org>
---
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
diff --git a/MAINTAINERS b/MAINTAINERS
index d82d962f1a4..28b1e9ba443 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -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
diff --git a/meson.build b/meson.build
index c736a6f4c4b..185c2fb0d1b 100644
--- a/meson.build
+++ b/meson.build
@@ -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')
diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h
new file mode 100644
index 00000000000..b4cc4888cac
--- /dev/null
+++ b/include/qemu/target-info.h
@@ -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
diff --git a/target-info-stub.c b/target-info-stub.c
new file mode 100644
index 00000000000..e5d2195e896
--- /dev/null
+++ b/target-info-stub.c
@@ -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;
+}
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 52/58] cpus: Replace CPU_RESOLVING_TYPE -> target_cpu_type()
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (49 preceding siblings ...)
2025-04-25 15:28 ` [PULL 51/58] qemu: Introduce target_cpu_type() Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 53/58] cpus: Move target-agnostic methods out of cpu-target.c Philippe Mathieu-Daudé
` (6 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Pierrick Bouvier
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.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20250417165430.58213-3-philmd@linaro.org>
---
accel/accel-target.c | 6 ++++--
accel/tcg/tcg-all.c | 5 +++--
cpu-target.c | 7 ++++---
3 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/accel/accel-target.c b/accel/accel-target.c
index 33a539b4cbb..08d4e450bde 100644
--- a/accel/accel-target.c
+++ b/accel/accel-target.c
@@ -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);
}
}
diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
index 40d73649796..0ce34ac912c 100644
--- a/accel/tcg/tcg-all.c
+++ b/accel/tcg/tcg-all.c
@@ -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) {
diff --git a/cpu-target.c b/cpu-target.c
index d68cbab5da9..c2dd590d48a 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -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();
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 53/58] cpus: Move target-agnostic methods out of cpu-target.c
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (50 preceding siblings ...)
2025-04-25 15:28 ` [PULL 52/58] cpus: Replace CPU_RESOLVING_TYPE -> target_cpu_type() Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 54/58] accel: Implement accel_init_ops_interfaces() for both system/user mode Philippe Mathieu-Daudé
` (5 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Pierrick Bouvier
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.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20250417165430.58213-4-philmd@linaro.org>
---
cpu-target.c | 77 +-------------------------------------------
hw/core/cpu-common.c | 74 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 75 insertions(+), 76 deletions(-)
diff --git a/cpu-target.c b/cpu-target.c
index c2dd590d48a..b5645ff0dbb 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -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)
diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c
index 1fb6ea38922..92c40b6bf83 100644
--- a/hw/core/cpu-common.c
+++ b/hw/core/cpu-common.c
@@ -25,6 +25,9 @@
#include "qemu/log.h"
#include "qemu/main-loop.h"
#include "qemu/lockcnt.h"
+#include "qemu/error-report.h"
+#include "qemu/qemu-print.h"
+#include "qemu/target-info.h"
#include "exec/log.h"
#include "exec/gdbstub.h"
#include "system/tcg.h"
@@ -152,6 +155,21 @@ ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model)
return NULL;
}
+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);
+}
+
static void cpu_common_parse_features(const char *typename, char *features,
Error **errp)
{
@@ -183,6 +201,33 @@ static void cpu_common_parse_features(const char *typename, char *features,
}
}
+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;
+}
+
bool cpu_exec_realizefn(CPUState *cpu, Error **errp)
{
if (!accel_cpu_common_realize(cpu, errp)) {
@@ -359,3 +404,32 @@ static void cpu_register_types(void)
}
type_init(cpu_register_types)
+
+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);
+ }
+}
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 54/58] accel: Implement accel_init_ops_interfaces() for both system/user mode
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (51 preceding siblings ...)
2025-04-25 15:28 ` [PULL 53/58] cpus: Move target-agnostic methods out of cpu-target.c Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 55/58] accel: Include missing 'qemu/accel.h' header in accel-internal.h Philippe Mathieu-Daudé
` (4 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Pierrick Bouvier
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.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20250417165430.58213-5-philmd@linaro.org>
---
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%)
diff --git a/MAINTAINERS b/MAINTAINERS
index 28b1e9ba443..07711cfd381 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -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
diff --git a/accel/accel-system.h b/accel/accel-internal.h
similarity index 56%
rename from accel/accel-system.h
rename to accel/accel-internal.h
index 2d37c73c97b..03426aa21ee 100644
--- a/accel/accel-system.h
+++ b/accel/accel-internal.h
@@ -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 */
diff --git a/accel/accel-system.c b/accel/accel-system.c
index 5df49fbe831..a0f562ae9ff 100644
--- a/accel/accel-system.c
+++ b/accel/accel-system.c
@@ -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;
diff --git a/accel/accel-target.c b/accel/accel-target.c
index 08d4e450bde..7f3bbf31a8b 100644
--- a/accel/accel-target.c
+++ b/accel/accel-target.c
@@ -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);
}
diff --git a/accel/accel-user.c b/accel/accel-user.c
index 22b6a1a1a89..7d192306a65 100644
--- a/accel/accel-user.c
+++ b/accel/accel-user.c
@@ -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)
{
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 55/58] accel: Include missing 'qemu/accel.h' header in accel-internal.h
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (52 preceding siblings ...)
2025-04-25 15:28 ` [PULL 54/58] accel: Implement accel_init_ops_interfaces() for both system/user mode Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 56/58] accel: Make AccelCPUClass structure target-agnostic Philippe Mathieu-Daudé
` (3 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Pierrick Bouvier
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);
| ^
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20250417165430.58213-6-philmd@linaro.org>
---
accel/accel-internal.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/accel/accel-internal.h b/accel/accel-internal.h
index 03426aa21ee..d3a4422cbf7 100644
--- a/accel/accel-internal.h
+++ b/accel/accel-internal.h
@@ -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 */
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 56/58] accel: Make AccelCPUClass structure target-agnostic
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (53 preceding siblings ...)
2025-04-25 15:28 ` [PULL 55/58] accel: Include missing 'qemu/accel.h' header in accel-internal.h Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 57/58] accel: Move target-agnostic code from accel-target.c -> accel-common.c Philippe Mathieu-Daudé
` (2 subsequent siblings)
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Pierrick Bouvier
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);
| ^
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20250417165430.58213-7-philmd@linaro.org>
---
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
diff --git a/MAINTAINERS b/MAINTAINERS
index 07711cfd381..59d97128199 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -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
diff --git a/include/accel/accel-cpu-target.h b/include/accel/accel-cpu-target.h
index 37dde7fae3e..6feb344e29b 100644
--- a/include/accel/accel-cpu-target.h
+++ b/include/accel/accel-cpu-target.h
@@ -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 */
diff --git a/include/accel/accel-cpu.h b/include/accel/accel-cpu.h
new file mode 100644
index 00000000000..9e7eede7c3c
--- /dev/null
+++ b/include/accel/accel-cpu.h
@@ -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 */
diff --git a/accel/accel-target.c b/accel/accel-target.c
index 7f3bbf31a8b..82a29e61476 100644
--- a/accel/accel-target.c
+++ b/accel/accel-target.c
@@ -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"
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 57/58] accel: Move target-agnostic code from accel-target.c -> accel-common.c
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (54 preceding siblings ...)
2025-04-25 15:28 ` [PULL 56/58] accel: Make AccelCPUClass structure target-agnostic Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 58/58] qemu: Convert target_name() to TargetInfo API Philippe Mathieu-Daudé
2025-04-28 17:56 ` [PULL 00/58] Misc single binary patches for 2025-04-25 Stefan Hajnoczi
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Pierrick Bouvier
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.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20250417165430.58213-8-philmd@linaro.org>
---
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
diff --git a/accel/accel-common.c b/accel/accel-common.c
new file mode 100644
index 00000000000..4894b98d64a
--- /dev/null
+++ b/accel/accel-common.c
@@ -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)
diff --git a/accel/accel-target.c b/accel/accel-target.c
index 82a29e61476..7fd392fbc4a 100644
--- a/accel/accel-target.c
+++ b/accel/accel-target.c
@@ -24,135 +24,7 @@
*/
#include "qemu/osdep.h"
-#include "qemu/accel.h"
-#include "qemu/target-info.h"
-
#include "accel/accel-cpu-target.h"
-#include "accel-internal.h"
-
-static const TypeInfo accel_type = {
- .name = TYPE_ACCEL,
- .parent = TYPE_OBJECT,
- .class_size = sizeof(AccelClass),
- .instance_size = sizeof(AccelState),
- .abstract = true,
-};
-
-/* 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_cpu_type = {
.name = TYPE_ACCEL_CPU,
@@ -163,7 +35,6 @@ static const TypeInfo accel_cpu_type = {
static void register_accel_types(void)
{
- type_register_static(&accel_type);
type_register_static(&accel_cpu_type);
}
diff --git a/accel/meson.build b/accel/meson.build
index 5eaeb683385..52909314bfa 100644
--- a/accel/meson.build
+++ b/accel/meson.build
@@ -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'))
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* [PULL 58/58] qemu: Convert target_name() to TargetInfo API
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (55 preceding siblings ...)
2025-04-25 15:28 ` [PULL 57/58] accel: Move target-agnostic code from accel-target.c -> accel-common.c Philippe Mathieu-Daudé
@ 2025-04-25 15:28 ` Philippe Mathieu-Daudé
2025-04-28 17:56 ` [PULL 00/58] Misc single binary patches for 2025-04-25 Stefan Hajnoczi
57 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-25 15:28 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Pierrick Bouvier, Richard Henderson
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.
Inspired-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250424222112.36194-3-philmd@linaro.org>
---
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
diff --git a/MAINTAINERS b/MAINTAINERS
index 59d97128199..f8fee87c704 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -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 <pierrick.bouvier@linaro.org>
+M: Philippe Mathieu-Daudé <philmd@linaro.org>
+S: Supported
+F: include/qemu/target-info*.h
+F: target-info*.c
+
Xtensa Machines
---------------
sim
diff --git a/meson.build b/meson.build
index 185c2fb0d1b..8ae70dbe45a 100644
--- a/meson.build
+++ b/meson.build
@@ -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')
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 2a02d4f0789..12b2ff1f7d2 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -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;
diff --git a/include/qemu/target-info-impl.h b/include/qemu/target-info-impl.h
new file mode 100644
index 00000000000..d30805f7f28
--- /dev/null
+++ b/include/qemu/target-info-impl.h
@@ -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
diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h
index b4cc4888cac..58d41368974 100644
--- a/include/qemu/target-info.h
+++ b/include/qemu/target-info.h
@@ -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:
*
diff --git a/cpu-target.c b/cpu-target.c
index b5645ff0dbb..1c90a307593 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -91,8 +91,3 @@ bool target_big_endian(void)
{
return TARGET_BIG_ENDIAN;
}
-
-const char *target_name(void)
-{
- return TARGET_NAME;
-}
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index a5e635152dc..d82043e1c68 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -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"
diff --git a/plugins/loader.c b/plugins/loader.c
index 0d6e082e170..8f0d75c9049 100644
--- a/plugins/loader.c
+++ b/plugins/loader.c
@@ -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"
diff --git a/system/vl.c b/system/vl.c
index 4ab2001df75..520956f4a19 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -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"
diff --git a/target-info-stub.c b/target-info-stub.c
index e5d2195e896..773a10188c8 100644
--- a/target-info-stub.c
+++ b/target-info-stub.c
@@ -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;
diff --git a/target-info.c b/target-info.c
new file mode 100644
index 00000000000..84b18931e7e
--- /dev/null
+++ b/target-info.c
@@ -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;
+}
--
2.47.1
^ permalink raw reply related [flat|nested] 69+ messages in thread
* Re: [PULL 00/58] Misc single binary patches for 2025-04-25
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
` (56 preceding siblings ...)
2025-04-25 15:28 ` [PULL 58/58] qemu: Convert target_name() to TargetInfo API Philippe Mathieu-Daudé
@ 2025-04-28 17:56 ` Stefan Hajnoczi
57 siblings, 0 replies; 69+ messages in thread
From: Stefan Hajnoczi @ 2025-04-28 17:56 UTC (permalink / raw)
To: Philippe Mathieu-Daudé; +Cc: qemu-devel, Philippe Mathieu-Daudé
[-- Attachment #1: Type: text/plain, Size: 116 bytes --]
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
2025-04-25 15:28 ` [PULL 36/58] pc-bios: Move device tree files in their own subdir Philippe Mathieu-Daudé
@ 2025-05-29 18:18 ` Bernhard Beschow
2025-05-30 0:54 ` BALATON Zoltan
0 siblings, 1 reply; 69+ messages in thread
From: Bernhard Beschow @ 2025-05-29 18:18 UTC (permalink / raw)
To: qemu-devel, Philippe Mathieu-Daudé; +Cc: BALATON Zoltan
Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>From: BALATON Zoltan <balaton@eik.bme.hu>
>
>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.
>
>Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>---
> 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%)
>
>diff --git a/MAINTAINERS b/MAINTAINERS
>index 661a47db5ac..d82d962f1a4 100644
>--- a/MAINTAINERS
>+++ b/MAINTAINERS
>@@ -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
>diff --git a/system/datadir.c b/system/datadir.c
>index e450b84ce91..f96f8fc2646 100644
>--- a/system/datadir.c
>+++ b/system/datadir.c
>@@ -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;
>diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>similarity index 100%
>rename from pc-bios/bamboo.dtb
>rename to pc-bios/dtb/bamboo.dtb
>diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>similarity index 100%
>rename from pc-bios/bamboo.dts
>rename to pc-bios/dtb/bamboo.dts
>diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>similarity index 100%
>rename from pc-bios/canyonlands.dtb
>rename to pc-bios/dtb/canyonlands.dtb
>diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>similarity index 100%
>rename from pc-bios/canyonlands.dts
>rename to pc-bios/dtb/canyonlands.dts
>diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>new file mode 100644
>index 00000000000..7a71835bca7
>--- /dev/null
>+++ b/pc-bios/dtb/meson.build
>@@ -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
>+]
>+
>+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
>diff --git a/pc-bios/petalogix-ml605.dtb b/pc-bios/dtb/petalogix-ml605.dtb
>similarity index 100%
>rename from pc-bios/petalogix-ml605.dtb
>rename to pc-bios/dtb/petalogix-ml605.dtb
>diff --git a/pc-bios/petalogix-ml605.dts b/pc-bios/dtb/petalogix-ml605.dts
>similarity index 100%
>rename from pc-bios/petalogix-ml605.dts
>rename to pc-bios/dtb/petalogix-ml605.dts
>diff --git a/pc-bios/petalogix-s3adsp1800.dtb b/pc-bios/dtb/petalogix-s3adsp1800.dtb
>similarity index 100%
>rename from pc-bios/petalogix-s3adsp1800.dtb
>rename to pc-bios/dtb/petalogix-s3adsp1800.dtb
>diff --git a/pc-bios/petalogix-s3adsp1800.dts b/pc-bios/dtb/petalogix-s3adsp1800.dts
>similarity index 100%
>rename from pc-bios/petalogix-s3adsp1800.dts
>rename to pc-bios/dtb/petalogix-s3adsp1800.dts
>diff --git a/pc-bios/meson.build b/pc-bios/meson.build
>index 34d6616c32b..34d8cc4f338 100644
>--- a/pc-bios/meson.build
>+++ b/pc-bios/meson.build
>@@ -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')
>diff --git a/qemu.nsi b/qemu.nsi
>index b186f223e14..d419986ca06 100644
>--- a/qemu.nsi
>+++ b/qemu.nsi
>@@ -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
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
2025-05-29 18:18 ` Bernhard Beschow
@ 2025-05-30 0:54 ` BALATON Zoltan
2025-06-02 8:12 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 69+ messages in thread
From: BALATON Zoltan @ 2025-05-30 0:54 UTC (permalink / raw)
To: Bernhard Beschow; +Cc: qemu-devel, Philippe Mathieu-Daudé
[-- Attachment #1: Type: text/plain, Size: 4361 bytes --]
On Thu, 29 May 2025, Bernhard Beschow wrote:
> Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>> From: BALATON Zoltan <balaton@eik.bme.hu>
>>
>> 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.
>>
>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> 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%)
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index 661a47db5ac..d82d962f1a4 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -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
>> diff --git a/system/datadir.c b/system/datadir.c
>> index e450b84ce91..f96f8fc2646 100644
>> --- a/system/datadir.c
>> +++ b/system/datadir.c
>> @@ -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;
>> diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>> similarity index 100%
>> rename from pc-bios/bamboo.dtb
>> rename to pc-bios/dtb/bamboo.dtb
>> diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>> similarity index 100%
>> rename from pc-bios/bamboo.dts
>> rename to pc-bios/dtb/bamboo.dts
>> diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>> similarity index 100%
>> rename from pc-bios/canyonlands.dtb
>> rename to pc-bios/dtb/canyonlands.dtb
>> diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>> similarity index 100%
>> rename from pc-bios/canyonlands.dts
>> rename to pc-bios/dtb/canyonlands.dts
>> diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>> new file mode 100644
>> index 00000000000..7a71835bca7
>> --- /dev/null
>> +++ b/pc-bios/dtb/meson.build
>> @@ -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
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
2025-05-30 0:54 ` BALATON Zoltan
@ 2025-06-02 8:12 ` Philippe Mathieu-Daudé
2025-06-02 11:56 ` BALATON Zoltan
2025-06-03 6:39 ` Bernhard Beschow
0 siblings, 2 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-06-02 8:12 UTC (permalink / raw)
To: BALATON Zoltan, Bernhard Beschow; +Cc: qemu-devel
On 30/5/25 02:54, BALATON Zoltan wrote:
> On Thu, 29 May 2025, Bernhard Beschow wrote:
>> Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé"
>> <philmd@linaro.org>:
>>> From: BALATON Zoltan <balaton@eik.bme.hu>
>>>
>>> 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.
>>>
>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> Message-ID:
>>> <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> ---
>>> 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%)
>>>
>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>> index 661a47db5ac..d82d962f1a4 100644
>>> --- a/MAINTAINERS
>>> +++ b/MAINTAINERS
>>> @@ -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
>>> diff --git a/system/datadir.c b/system/datadir.c
>>> index e450b84ce91..f96f8fc2646 100644
>>> --- a/system/datadir.c
>>> +++ b/system/datadir.c
>>> @@ -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;
>>> diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>>> similarity index 100%
>>> rename from pc-bios/bamboo.dtb
>>> rename to pc-bios/dtb/bamboo.dtb
>>> diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>>> similarity index 100%
>>> rename from pc-bios/bamboo.dts
>>> rename to pc-bios/dtb/bamboo.dts
>>> diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>>> similarity index 100%
>>> rename from pc-bios/canyonlands.dtb
>>> rename to pc-bios/dtb/canyonlands.dtb
>>> diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>>> similarity index 100%
>>> rename from pc-bios/canyonlands.dts
>>> rename to pc-bios/dtb/canyonlands.dts
>>> diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>>> new file mode 100644
>>> index 00000000000..7a71835bca7
>>> --- /dev/null
>>> +++ b/pc-bios/dtb/meson.build
>>> @@ -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.
Should we revert?
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
2025-06-02 8:12 ` Philippe Mathieu-Daudé
@ 2025-06-02 11:56 ` BALATON Zoltan
2025-06-03 11:25 ` Philippe Mathieu-Daudé
2025-06-03 6:39 ` Bernhard Beschow
1 sibling, 1 reply; 69+ messages in thread
From: BALATON Zoltan @ 2025-06-02 11:56 UTC (permalink / raw)
To: Philippe Mathieu-Daudé; +Cc: Bernhard Beschow, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 5224 bytes --]
On Mon, 2 Jun 2025, Philippe Mathieu-Daudé wrote:
> On 30/5/25 02:54, BALATON Zoltan wrote:
>> On Thu, 29 May 2025, Bernhard Beschow wrote:
>>> Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé"
>>> <philmd@linaro.org>:
>>>> From: BALATON Zoltan <balaton@eik.bme.hu>
>>>>
>>>> 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.
>>>>
>>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>> Message-ID:
>>>> <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>> ---
>>>> 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%)
>>>>
>>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>>> index 661a47db5ac..d82d962f1a4 100644
>>>> --- a/MAINTAINERS
>>>> +++ b/MAINTAINERS
>>>> @@ -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
>>>> diff --git a/system/datadir.c b/system/datadir.c
>>>> index e450b84ce91..f96f8fc2646 100644
>>>> --- a/system/datadir.c
>>>> +++ b/system/datadir.c
>>>> @@ -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;
>>>> diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>>>> similarity index 100%
>>>> rename from pc-bios/bamboo.dtb
>>>> rename to pc-bios/dtb/bamboo.dtb
>>>> diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>>>> similarity index 100%
>>>> rename from pc-bios/bamboo.dts
>>>> rename to pc-bios/dtb/bamboo.dts
>>>> diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>>>> similarity index 100%
>>>> rename from pc-bios/canyonlands.dtb
>>>> rename to pc-bios/dtb/canyonlands.dtb
>>>> diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>>>> similarity index 100%
>>>> rename from pc-bios/canyonlands.dts
>>>> rename to pc-bios/dtb/canyonlands.dts
>>>> diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>>>> new file mode 100644
>>>> index 00000000000..7a71835bca7
>>>> --- /dev/null
>>>> +++ b/pc-bios/dtb/meson.build
>>>> @@ -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.
>
> 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
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
2025-06-02 8:12 ` Philippe Mathieu-Daudé
2025-06-02 11:56 ` BALATON Zoltan
@ 2025-06-03 6:39 ` Bernhard Beschow
2025-06-03 11:38 ` Thomas Huth
2025-06-03 12:58 ` BALATON Zoltan
1 sibling, 2 replies; 69+ messages in thread
From: Bernhard Beschow @ 2025-06-03 6:39 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, BALATON Zoltan; +Cc: qemu-devel
Am 2. Juni 2025 08:12:39 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>On 30/5/25 02:54, BALATON Zoltan wrote:
>> On Thu, 29 May 2025, Bernhard Beschow wrote:
>>> Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>>>> From: BALATON Zoltan <balaton@eik.bme.hu>
>>>>
>>>> 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.
>>>>
>>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>> Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>> ---
>>>> 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%)
>>>>
>>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>>> index 661a47db5ac..d82d962f1a4 100644
>>>> --- a/MAINTAINERS
>>>> +++ b/MAINTAINERS
>>>> @@ -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
>>>> diff --git a/system/datadir.c b/system/datadir.c
>>>> index e450b84ce91..f96f8fc2646 100644
>>>> --- a/system/datadir.c
>>>> +++ b/system/datadir.c
>>>> @@ -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;
>>>> diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>>>> similarity index 100%
>>>> rename from pc-bios/bamboo.dtb
>>>> rename to pc-bios/dtb/bamboo.dtb
>>>> diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>>>> similarity index 100%
>>>> rename from pc-bios/bamboo.dts
>>>> rename to pc-bios/dtb/bamboo.dts
>>>> diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>>>> similarity index 100%
>>>> rename from pc-bios/canyonlands.dtb
>>>> rename to pc-bios/dtb/canyonlands.dtb
>>>> diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>>>> similarity index 100%
>>>> rename from pc-bios/canyonlands.dts
>>>> rename to pc-bios/dtb/canyonlands.dts
>>>> diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>>>> new file mode 100644
>>>> index 00000000000..7a71835bca7
>>>> --- /dev/null
>>>> +++ b/pc-bios/dtb/meson.build
>>>> @@ -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.
>
>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
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
2025-06-02 11:56 ` BALATON Zoltan
@ 2025-06-03 11:25 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 69+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-06-03 11:25 UTC (permalink / raw)
To: BALATON Zoltan; +Cc: Bernhard Beschow, qemu-devel
On 2/6/25 13:56, BALATON Zoltan wrote:
> On Mon, 2 Jun 2025, Philippe Mathieu-Daudé wrote:
>> On 30/5/25 02:54, BALATON Zoltan wrote:
>>> On Thu, 29 May 2025, Bernhard Beschow wrote:
>>>> Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé"
>>>> <philmd@linaro.org>:
>>>>> From: BALATON Zoltan <balaton@eik.bme.hu>
>>>>>
>>>>> 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.
>>>>>
>>>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>>> Message-ID:
>>>>> <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>>> ---
>>>>> 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%)
>>>>>
>>>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>>>> index 661a47db5ac..d82d962f1a4 100644
>>>>> --- a/MAINTAINERS
>>>>> +++ b/MAINTAINERS
>>>>> @@ -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
>>>>> diff --git a/system/datadir.c b/system/datadir.c
>>>>> index e450b84ce91..f96f8fc2646 100644
>>>>> --- a/system/datadir.c
>>>>> +++ b/system/datadir.c
>>>>> @@ -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;
>>>>> diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>>>>> similarity index 100%
>>>>> rename from pc-bios/bamboo.dtb
>>>>> rename to pc-bios/dtb/bamboo.dtb
>>>>> diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>>>>> similarity index 100%
>>>>> rename from pc-bios/bamboo.dts
>>>>> rename to pc-bios/dtb/bamboo.dts
>>>>> diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>>>>> similarity index 100%
>>>>> rename from pc-bios/canyonlands.dtb
>>>>> rename to pc-bios/dtb/canyonlands.dtb
>>>>> diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>>>>> similarity index 100%
>>>>> rename from pc-bios/canyonlands.dts
>>>>> rename to pc-bios/dtb/canyonlands.dts
>>>>> diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>>>>> new file mode 100644
>>>>> index 00000000000..7a71835bca7
>>>>> --- /dev/null
>>>>> +++ b/pc-bios/dtb/meson.build
>>>>> @@ -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.
>>
>> 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.
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
2025-06-03 6:39 ` Bernhard Beschow
@ 2025-06-03 11:38 ` Thomas Huth
2025-06-04 9:59 ` Bernhard Beschow
2025-06-03 12:58 ` BALATON Zoltan
1 sibling, 1 reply; 69+ messages in thread
From: Thomas Huth @ 2025-06-03 11:38 UTC (permalink / raw)
To: Bernhard Beschow, Philippe Mathieu-Daudé, BALATON Zoltan; +Cc: qemu-devel
On 03/06/2025 08.39, Bernhard Beschow wrote:
>
>
> Am 2. Juni 2025 08:12:39 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>> On 30/5/25 02:54, BALATON Zoltan wrote:
>>> On Thu, 29 May 2025, Bernhard Beschow wrote:
>>>> Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>>>>> From: BALATON Zoltan <balaton@eik.bme.hu>
>>>>>
>>>>> 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.
>>>>>
>>>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>>> Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>>> ---
>>>>> 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%)
>>>>>
>>>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>>>> index 661a47db5ac..d82d962f1a4 100644
>>>>> --- a/MAINTAINERS
>>>>> +++ b/MAINTAINERS
>>>>> @@ -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
>>>>> diff --git a/system/datadir.c b/system/datadir.c
>>>>> index e450b84ce91..f96f8fc2646 100644
>>>>> --- a/system/datadir.c
>>>>> +++ b/system/datadir.c
>>>>> @@ -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;
>>>>> diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>>>>> similarity index 100%
>>>>> rename from pc-bios/bamboo.dtb
>>>>> rename to pc-bios/dtb/bamboo.dtb
>>>>> diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>>>>> similarity index 100%
>>>>> rename from pc-bios/bamboo.dts
>>>>> rename to pc-bios/dtb/bamboo.dts
>>>>> diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>>>>> similarity index 100%
>>>>> rename from pc-bios/canyonlands.dtb
>>>>> rename to pc-bios/dtb/canyonlands.dtb
>>>>> diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>>>>> similarity index 100%
>>>>> rename from pc-bios/canyonlands.dts
>>>>> rename to pc-bios/dtb/canyonlands.dts
>>>>> diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>>>>> new file mode 100644
>>>>> index 00000000000..7a71835bca7
>>>>> --- /dev/null
>>>>> +++ b/pc-bios/dtb/meson.build
>>>>> @@ -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.
>>
>> 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
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
2025-06-03 6:39 ` Bernhard Beschow
2025-06-03 11:38 ` Thomas Huth
@ 2025-06-03 12:58 ` BALATON Zoltan
1 sibling, 0 replies; 69+ messages in thread
From: BALATON Zoltan @ 2025-06-03 12:58 UTC (permalink / raw)
To: Bernhard Beschow; +Cc: Philippe Mathieu-Daudé, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 6344 bytes --]
On Tue, 3 Jun 2025, Bernhard Beschow wrote:
> Am 2. Juni 2025 08:12:39 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>> On 30/5/25 02:54, BALATON Zoltan wrote:
>>> On Thu, 29 May 2025, Bernhard Beschow wrote:
>>>> Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>>>>> From: BALATON Zoltan <balaton@eik.bme.hu>
>>>>>
>>>>> 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.
>>>>>
>>>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>>> Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>>> ---
>>>>> 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%)
>>>>>
>>>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>>>> index 661a47db5ac..d82d962f1a4 100644
>>>>> --- a/MAINTAINERS
>>>>> +++ b/MAINTAINERS
>>>>> @@ -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
>>>>> diff --git a/system/datadir.c b/system/datadir.c
>>>>> index e450b84ce91..f96f8fc2646 100644
>>>>> --- a/system/datadir.c
>>>>> +++ b/system/datadir.c
>>>>> @@ -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;
>>>>> diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>>>>> similarity index 100%
>>>>> rename from pc-bios/bamboo.dtb
>>>>> rename to pc-bios/dtb/bamboo.dtb
>>>>> diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>>>>> similarity index 100%
>>>>> rename from pc-bios/bamboo.dts
>>>>> rename to pc-bios/dtb/bamboo.dts
>>>>> diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>>>>> similarity index 100%
>>>>> rename from pc-bios/canyonlands.dtb
>>>>> rename to pc-bios/dtb/canyonlands.dtb
>>>>> diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>>>>> similarity index 100%
>>>>> rename from pc-bios/canyonlands.dts
>>>>> rename to pc-bios/dtb/canyonlands.dts
>>>>> diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>>>>> new file mode 100644
>>>>> index 00000000000..7a71835bca7
>>>>> --- /dev/null
>>>>> +++ b/pc-bios/dtb/meson.build
>>>>> @@ -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.
>>
>> 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
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
2025-06-03 11:38 ` Thomas Huth
@ 2025-06-04 9:59 ` Bernhard Beschow
2025-06-10 20:54 ` Bernhard Beschow
0 siblings, 1 reply; 69+ messages in thread
From: Bernhard Beschow @ 2025-06-04 9:59 UTC (permalink / raw)
To: Thomas Huth, Philippe Mathieu-Daudé, BALATON Zoltan; +Cc: qemu-devel
Am 3. Juni 2025 11:38:59 UTC schrieb Thomas Huth <thuth@redhat.com>:
>On 03/06/2025 08.39, Bernhard Beschow wrote:
>>
>>
>> Am 2. Juni 2025 08:12:39 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>>> On 30/5/25 02:54, BALATON Zoltan wrote:
>>>> On Thu, 29 May 2025, Bernhard Beschow wrote:
>>>>> Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>>>>>> From: BALATON Zoltan <balaton@eik.bme.hu>
>>>>>>
>>>>>> 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.
>>>>>>
>>>>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>>>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>>>> Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>>>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>>>> ---
>>>>>> 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%)
>>>>>>
>>>>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>>>>> index 661a47db5ac..d82d962f1a4 100644
>>>>>> --- a/MAINTAINERS
>>>>>> +++ b/MAINTAINERS
>>>>>> @@ -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
>>>>>> diff --git a/system/datadir.c b/system/datadir.c
>>>>>> index e450b84ce91..f96f8fc2646 100644
>>>>>> --- a/system/datadir.c
>>>>>> +++ b/system/datadir.c
>>>>>> @@ -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;
>>>>>> diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>>>>>> similarity index 100%
>>>>>> rename from pc-bios/bamboo.dtb
>>>>>> rename to pc-bios/dtb/bamboo.dtb
>>>>>> diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>>>>>> similarity index 100%
>>>>>> rename from pc-bios/bamboo.dts
>>>>>> rename to pc-bios/dtb/bamboo.dts
>>>>>> diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>>>>>> similarity index 100%
>>>>>> rename from pc-bios/canyonlands.dtb
>>>>>> rename to pc-bios/dtb/canyonlands.dtb
>>>>>> diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>>>>>> similarity index 100%
>>>>>> rename from pc-bios/canyonlands.dts
>>>>>> rename to pc-bios/dtb/canyonlands.dts
>>>>>> diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>>>>>> new file mode 100644
>>>>>> index 00000000000..7a71835bca7
>>>>>> --- /dev/null
>>>>>> +++ b/pc-bios/dtb/meson.build
>>>>>> @@ -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.
>>>
>>> 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
>
> Thomas
>
^ permalink raw reply [flat|nested] 69+ messages in thread
* Re: [PULL 36/58] pc-bios: Move device tree files in their own subdir
2025-06-04 9:59 ` Bernhard Beschow
@ 2025-06-10 20:54 ` Bernhard Beschow
0 siblings, 0 replies; 69+ messages in thread
From: Bernhard Beschow @ 2025-06-10 20:54 UTC (permalink / raw)
To: Thomas Huth, Philippe Mathieu-Daudé, BALATON Zoltan; +Cc: qemu-devel
Am 4. Juni 2025 09:59:44 UTC schrieb Bernhard Beschow <shentey@gmail.com>:
>
>
>Am 3. Juni 2025 11:38:59 UTC schrieb Thomas Huth <thuth@redhat.com>:
>>On 03/06/2025 08.39, Bernhard Beschow wrote:
>>>
>>>
>>> Am 2. Juni 2025 08:12:39 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>>>> On 30/5/25 02:54, BALATON Zoltan wrote:
>>>>> On Thu, 29 May 2025, Bernhard Beschow wrote:
>>>>>> Am 25. April 2025 15:28:20 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>>>>>>> From: BALATON Zoltan <balaton@eik.bme.hu>
>>>>>>>
>>>>>>> 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.
>>>>>>>
>>>>>>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>>>>>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>>>>> Message-ID: <57f179bd3904c1f2ca062ca4d4ff9592bb4f4daa.1745402140.git.balaton@eik.bme.hu>
>>>>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>>>>> ---
>>>>>>> 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%)
>>>>>>>
>>>>>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>>>>>> index 661a47db5ac..d82d962f1a4 100644
>>>>>>> --- a/MAINTAINERS
>>>>>>> +++ b/MAINTAINERS
>>>>>>> @@ -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
>>>>>>> diff --git a/system/datadir.c b/system/datadir.c
>>>>>>> index e450b84ce91..f96f8fc2646 100644
>>>>>>> --- a/system/datadir.c
>>>>>>> +++ b/system/datadir.c
>>>>>>> @@ -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;
>>>>>>> diff --git a/pc-bios/bamboo.dtb b/pc-bios/dtb/bamboo.dtb
>>>>>>> similarity index 100%
>>>>>>> rename from pc-bios/bamboo.dtb
>>>>>>> rename to pc-bios/dtb/bamboo.dtb
>>>>>>> diff --git a/pc-bios/bamboo.dts b/pc-bios/dtb/bamboo.dts
>>>>>>> similarity index 100%
>>>>>>> rename from pc-bios/bamboo.dts
>>>>>>> rename to pc-bios/dtb/bamboo.dts
>>>>>>> diff --git a/pc-bios/canyonlands.dtb b/pc-bios/dtb/canyonlands.dtb
>>>>>>> similarity index 100%
>>>>>>> rename from pc-bios/canyonlands.dtb
>>>>>>> rename to pc-bios/dtb/canyonlands.dtb
>>>>>>> diff --git a/pc-bios/canyonlands.dts b/pc-bios/dtb/canyonlands.dts
>>>>>>> similarity index 100%
>>>>>>> rename from pc-bios/canyonlands.dts
>>>>>>> rename to pc-bios/dtb/canyonlands.dts
>>>>>>> diff --git a/pc-bios/dtb/meson.build b/pc-bios/dtb/meson.build
>>>>>>> new file mode 100644
>>>>>>> index 00000000000..7a71835bca7
>>>>>>> --- /dev/null
>>>>>>> +++ b/pc-bios/dtb/meson.build
>>>>>>> @@ -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.
>>>>
>>>> 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/20250610204131.2862-1-shentey@gmail.com/>
Best regards,
Bernhard
>
>Best regards,
>Bernhard
>>
>> Thomas
>>
^ permalink raw reply [flat|nested] 69+ messages in thread
end of thread, other threads:[~2025-06-10 20:55 UTC | newest]
Thread overview: 69+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-25 15:27 [PULL 00/58] Misc single binary patches for 2025-04-25 Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 01/58] target/hexagon: Explode MO_TExx -> MO_TE | MO_xx Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 02/58] target/hexagon: Replace MO_TE -> MO_LE Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 03/58] target/i386: Replace MO_TE* -> MO_LE* Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 04/58] cpus: Introduce CPUClass::list_cpus() callback Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 05/58] target/i386: Register CPUClass:list_cpus Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 06/58] target/ppc: " Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 07/58] target/sparc: " Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 08/58] target/s390x: " Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 09/58] cpus: Remove #ifdef check on cpu_list definition Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 10/58] hw/pci-host/designware: Use deposit/extract API Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 11/58] hw/misc/edu: Convert type_init() -> DEFINE_TYPES() Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 12/58] qom: Have class_base_init() take a const data argument Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 14/58] qom: Constify TypeInfo::class_data Philippe Mathieu-Daudé
2025-04-25 15:27 ` [PULL 15/58] qom: Constify TypeInfo::interfaces Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 16/58] qom: Make InterfaceInfo[] uses const Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 17/58] qom/object: Fix type conflict of GLib function pointers Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 18/58] hw/core: Get default_cpu_type calling machine_class_default_cpu_type() Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 19/58] hw/core/cpu: gdb_arch_name string should not be freed Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 20/58] gdbstub: Allow gdb_core_xml_file to be set at runtime Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 21/58] target/arm: Handle AArch64 in TYPE_ARM_CPU gdb_arch_name Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 22/58] target/arm: Handle gdb_core_xml_file in TYPE_ARM_CPU Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 23/58] target/arm: Handle AArch64 gdb read/write regs " Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 24/58] target/arm: Replace target_ulong -> hwaddr in ARMMMUFaultInfo Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 25/58] target/arm: Replace target_ulong -> vaddr for CPUWatchpoint Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 26/58] target/mips: Fix MIPS16e translation Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 27/58] exec: Rename target_words_bigendian() -> target_big_endian() Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 28/58] hw/usb/hcd-xhci: Unmap canceled packet Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 29/58] hw/intc/i8259: Remove unused DEBUG_PIC define Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 30/58] hw/core/loader: Fix type conflict of GLib function pointers Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 31/58] hw/net/can: " Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 32/58] contrib/plugins: " Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 33/58] system/vl: " Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 34/58] system/memory: Remove DEVICE_HOST_ENDIAN definition Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 35/58] system/datadir: Add new type constant for DTB files Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 36/58] pc-bios: Move device tree files in their own subdir Philippe Mathieu-Daudé
2025-05-29 18:18 ` Bernhard Beschow
2025-05-30 0:54 ` BALATON Zoltan
2025-06-02 8:12 ` Philippe Mathieu-Daudé
2025-06-02 11:56 ` BALATON Zoltan
2025-06-03 11:25 ` Philippe Mathieu-Daudé
2025-06-03 6:39 ` Bernhard Beschow
2025-06-03 11:38 ` Thomas Huth
2025-06-04 9:59 ` Bernhard Beschow
2025-06-10 20:54 ` Bernhard Beschow
2025-06-03 12:58 ` BALATON Zoltan
2025-04-25 15:28 ` [PULL 37/58] meson: Use has_header_symbol() to check getcpu() Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 38/58] meson: Remove CONFIG_STATX and CONFIG_STATX_MNT_ID Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 39/58] meson: Share common C source prefixes Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 40/58] meson: Use osdep_prefix for strchrnul() Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 41/58] system/kvm: make functions accessible from common code Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 42/58] accel/tcg: Correct list of included headers in tcg-stub.c Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 43/58] target/hexagon: Include missing 'accel/tcg/getpc.h' Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 44/58] linux-user/elfload: Use target_needs_bswap() Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 45/58] accel/kvm: " Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 46/58] target/mips: Check CPU endianness at runtime using env_is_bigendian() Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 47/58] target/xtensa: Evaluate TARGET_BIG_ENDIAN at compile time Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 48/58] hw/mips: " Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 49/58] hw/microblaze: " Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 50/58] qapi: Rename TargetInfo structure as QemuTargetInfo Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 51/58] qemu: Introduce target_cpu_type() Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 52/58] cpus: Replace CPU_RESOLVING_TYPE -> target_cpu_type() Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 53/58] cpus: Move target-agnostic methods out of cpu-target.c Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 54/58] accel: Implement accel_init_ops_interfaces() for both system/user mode Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 55/58] accel: Include missing 'qemu/accel.h' header in accel-internal.h Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 56/58] accel: Make AccelCPUClass structure target-agnostic Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 57/58] accel: Move target-agnostic code from accel-target.c -> accel-common.c Philippe Mathieu-Daudé
2025-04-25 15:28 ` [PULL 58/58] qemu: Convert target_name() to TargetInfo API Philippe Mathieu-Daudé
2025-04-28 17:56 ` [PULL 00/58] Misc single binary patches for 2025-04-25 Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).