Commit Graph

19224 Commits

Author SHA1 Message Date
Anton Johansson
9067113cdf target-info: Add target_riscv64()
Adds a helper function to tell if the binary is targeting riscv64 or
not.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Chao Liu <chao.liu.zevorn@gmail.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20260520-hw-riscv-cpu-int-v3-7-d1123ea63d9c@rev.ng>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2026-05-27 08:50:37 +02:00
Anton Johansson
40838c8251 hw/riscv: Add macros and globals for simplifying machine definitions
Adds macros and global interfaces for defining machines available only
in qemu-system-riscv32, qemu-system-riscv64, or both.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20260520-hw-riscv-cpu-int-v3-3-d1123ea63d9c@rev.ng>
[PMD: Constify InterfaceInfo]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2026-05-27 08:05:01 +02:00
Anton Johansson
a045f6a8e8 hw/riscv: Register generic riscv[32|64] QOM interfaces
Defines generic 32- and 64-bit riscv machine interfaces for machines to
implement.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20260520-hw-riscv-cpu-int-v3-1-d1123ea63d9c@rev.ng>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2026-05-27 08:03:27 +02:00
Stefan Hajnoczi
3f89b5de5b Merge tag 'pull-target-arm-20260526' of https://gitlab.com/pm215/qemu into staging
target-arm queue:
 * hw/timer/mss_timer: Remove dead code in timer_write()
 * OMAP: Remove various pieces of dead code
 * target/arm: Set debug in attrs in translate_for_debug()
 * target/arm/ptw: Flip sense of get_phys_addr_* return values
 * tests/functional/aarch64: Bump up timeout on vbsa
 * target/arm: Fix minor FEAT_AFP corner case bugs
 * target/arm: Implement FEAT_FAMINMAX
 * target/arm: Implement FEAT_FPMR
 * target/arm: Some initial patches towards other FP8 features

# -----BEGIN PGP SIGNATURE-----
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmoVrdcZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3nJnEACJLdcU+Q+5EoGw+PT16tyB
# anoeeMdjR8h7lGtOOfclaVwno+UzzfKEnqX5Y1MXiKpD+QcuJ/VNy431Pj0pgEiF
# BOqWVLiF7jJsxHzxJ5y+OniHwoDvyZKNKv7nbgoHJY2LSUZlIA5plgr1Pj27NA4S
# KFWgBIWu3uJlx7t9epUl9qbmSSHj54zXDt8N7tGhitR4be/vEjRnE/IIHbtQ0jhg
# 3A68nBchBXHawjeghCmWFqh8zFlqNo9oFZoaE4/oe3qmCesh1Pg5eQ1RRvjSY9VJ
# uW3m/6oLY5v5KwV2UY5etLHvWPrIjzIzkv7gnOKF2H+3yygEhSzBJDlYViSHVwS+
# pGTaW8LvSFCkhnBocN5VELC7V0XJDxlCLoaOrBYUY/wOt7tvC2qWzson+siTaiLT
# VfJoRkAkf5YasK78HHfsfxdz95X3sqLR1Ks6uuVq6cH+0vdLxJ9ac8c8lu/TjwLm
# qFfHoo5ryQFryRyKqUhS/TQA3Bx5qHvq1uDMu2o3BrFSzU6Rj4nR01LgrEdVacp+
# w8KjAISu7RJVwQ64u3QkP+RB5HbaLRln4FeOl4GDK4WxABKrgjkFjVwSStNVOjzQ
# 7kvT48wFdQ/Mv6IL9tUPJzGhqJvrevOrM+QzbInmyzbCbcWuK0+dI+yVBf6w5AhE
# a1q5vtYSMBY7a6H2WeDuBw==
# =Zmy0
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 26 May 2026 10:27:35 EDT
# gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:                issuer "peter.maydell@linaro.org"
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [full]
# gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [full]
# gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [full]
# gpg:                 aka "Peter Maydell <peter@archaic.org.uk>" [unknown]
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* tag 'pull-target-arm-20260526' of https://gitlab.com/pm215/qemu: (54 commits)
  target/arm: Move vectors_overlap to vec_internal.h
  target/arm: Split vector-type.h from cpu.h
  target/arm: Implement FSCALE for SME
  target/arm: Implement FSCALE for AdvSIMD
  target/arm: Add isar_feature_aa64_f8cvt
  target/arm: Implement ID_AA64FPFR0
  target/arm: Enable FEAT_FPMR for -cpu max
  linux-user/aarch64: Implement FPMR signal frames
  target/arm: Dump FPMR when present
  tests/functional/aarch64/rme: update images to support FEAT_FP8
  target/arm: Trap direct acceses to FPMR
  target/arm: Add FPMR_EL to TBFLAGS
  target/arm: Clear FPMR on ResetSVEState
  target/arm: Enable EnFPM bits for FEAT_FPMR
  target/arm: Update SCTLR bits for FEAT_FPMR
  target/arm: Introduce FPMR
  target/arm: Update HCRX bits for Arm ARM M.a.a
  target/arm: Update SCR bits for Arm ARM M.a.a
  target/arm: Enable FEAT_FAMINMAX for -cpu max
  target/arm: Implement FEAT_FAMINMAX for SVE
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2026-05-26 13:20:15 -04:00
Stefan Hajnoczi
e28b83116a Merge tag 'pull-aspeed-20260526' of https://github.com/legoater/qemu into staging
aspeed queue:

* Fix AST2600 RNG register definitions
* Add a USB EHCI functional test to the AST2600 SDK machine test
* Add a new anacapa-bmc machine (Meta/Facebook AST2600)
* Refactor SRAM to support AST1040 memory layout
* Add a new AST1040 Bridge IC SoC model and EVB machine
* Convert all Aspeed device models to use the Resettable
  interface

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEoPZlSPBIlev+awtgUaNDx8/77KEFAmoVVnkACgkQUaNDx8/7
# 7KFSkQ//figTgjfm4AkuWIHj6Q2Z5V1RxCxUiIuncJ7u5xbyaVE2dYfi+r4dgbL2
# HKSgTMd/dV0IlgereEMd8y5I9ufUNoW44j9+mtgBog9m9swZ7XN8QHo4vMWW3FyA
# dXFlWPlPteAPuHJz6mZixaA9mg0nHo1WxXSAbU96DZJwPA5Axui3pNT2EbEr2ry1
# dfobhGzvWj0P0QuBxT4DNoD+UFqXbMAP1TvJu03XRVeYLiTXaPYAR/b8juW+Ktop
# kDVBFVSl4swibvFL/zQiBl70d5DdrdNyc1z3bjv1VAqlmqPzVjbRNvLx7fT1nLhr
# AxxYFIf2u4tP1PzmggWPkvon2cL2Q0wjxGV9bwKIS5swI/Kyiq7IMj/cyADCDM2+
# oqolpexxvo+qioEwdOmHwUuH3xdjezLYQww26fu0SMcNP5pLCK/HHboDoX9NIWUH
# oj+lcaRS4ZlIzJVzC+E022z3ox+6urm05/ELfWWrPU4kXYhpNb2EcADbvs2HQVHH
# 9ysW1dmm9q8eE8DlexY8V8ZD1iiSXsNpJEshtX5bSGg+hWfGl/W69dw1cpUyv9lG
# bV2Yz8KqMGo9RNoqAG0z87jIIzypS+f9R49XoWb29p4bIYlMLrC+gOLlBGpjcTDJ
# fQlKQeoUoeP16xPiOC80k/aAgD6pH39oFC+hPiDIixyZTqfw/fo=
# =RhXN
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 26 May 2026 04:14:49 EDT
# gpg:                using RSA key A0F66548F04895EBFE6B0B6051A343C7CFFBECA1
# gpg: Good signature from "Cédric Le Goater <clg@redhat.com>" [full]
# gpg:                 aka "Cédric Le Goater <clg@kaod.org>" [full]
# Primary key fingerprint: A0F6 6548 F048 95EB FE6B  0B60 51A3 43C7 CFFB ECA1

* tag 'pull-aspeed-20260526' of https://github.com/legoater/qemu: (37 commits)
  hw/i2c/aspeed_i2c: convert to use Resettable interface
  hw/adc/aspeed_adc: convert to use Resettable interface
  hw/rtc/aspeed_rtc: convert to use Resettable interface
  hw/fsi/aspeed_apb2opb: convert to use Resettable interface
  hw/net/ftgmac100: convert to use Resettable interface
  hw/watchdog/wdt_aspeed: convert to use Resettable interface
  hw/i3c/aspeed_i3c: convert to use Resettable interface
  hw/intc/aspeed_intc: convert to use Resettable interface
  hw/intc/aspeed_vic: convert to use Resettable interface
  hw/ssi/aspeed_smc: convert to use Resettable interface
  hw/sd/aspeed_sdhci: convert to use Resettable interface
  hw/gpio/aspeed_gpio: convert to use Resettable interface
  hw/timer/aspeed_timer: convert to use Resettable interface
  hw/pci-host/aspeed_pcie: convert to use Resettable interface
  hw/misc/aspeed_ltpi: convert to use Resettable interface
  hw/misc/aspeed_scu: convert to use Resettable interface
  hw/misc/aspeed_sdmc: convert to use Resettable interface
  hw/misc/aspeed_lpc: convert to use Resettable interface
  hw/misc/aspeed_xdma: convert to use Resettable interface
  hw/misc/aspeed_sbc: convert to use Resettable interface
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2026-05-26 13:19:51 -04:00
Peter Maydell
9ae6151bd5 hw/dma/omap_dma: Drop model argument to omap_dma_init()
The model argument to omap_dma_init() is always omap_dma_3_1, and all
we do with it now is assert this; drop the argument and the enum.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260512203414.3633237-13-peter.maydell@linaro.org
2026-05-26 10:11:22 +01:00
Peter Maydell
5ff65fac2d hw/dma/omap_dma: Remove support for dma_3_0 and dma_3_2
The omap_dma device has support for modelling different variants
of the DMA block, as enumerated by the omap_dma_model enum:
3_0, 3_1 and 3_2. However, our one remaining OMAP SoC always
passes omap_dma_3_1 into the omap_dma_init() function, so the
handling for 3_0 and 3_2 is never used.

Remove the support for the other versions; this lets us
delete entirely two large functions that were specific
to 3.2 DMA to the LCD controller, and all their associated
fields in the omap_dma_lcd_channel_s struct.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260512203414.3633237-8-peter.maydell@linaro.org
2026-05-26 10:11:08 +01:00
Peter Maydell
043b8e4707 hw/arm/omap: Remove unused wakeup irq
The OMAP code creates a qemu_irq whose set function is
omap_mpu_wakeup(), and passes that irq into omap_mpuio_init(), which
saves it in its omap_mpuio_s::wakeup field.  However nothing ever
touches that qemu_irq again, so omap_mpu_wakeup() is never called.

Remove all this as dead code.  This lets us remove a direct call to
cpu_interrupt(cpu, CPU_INTERRUPT_EXITTB) from within board/SoC code,
which is pretty ugly and might not even do the right thing these
days.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260512203414.3633237-7-peter.maydell@linaro.org
2026-05-26 10:11:08 +01:00
Peter Maydell
89d188f193 hw/arm/omap: Delete unused #defines
Delete some #defines which we no longer use because they are
for OMAP SoCs which we dropped support for.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260512203414.3633237-6-peter.maydell@linaro.org
2026-05-26 10:11:08 +01:00
Peter Maydell
3a0583e509 hw/arm/omap: Remove stray unused prototype
When we removed the support for most of the OMAP SoCs, we missed
deleting a function prototype that was for a function defined in
removed code.  Delete it now.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260512203414.3633237-4-peter.maydell@linaro.org
2026-05-26 10:11:08 +01:00
Peter Maydell
0fec063f3d hw/arm/omap: Remove unused omap_mpuio functions
The omap1.c file includes some functions which used to be used by the
other OMAP SoC variants which we removed a while ago, but which we
missed when doing that removal.  They have no callers, so we can
delete them.

This code was the last user of hw_error() in this file, so we
can also remove the hw-error.h include.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260512203414.3633237-3-peter.maydell@linaro.org
2026-05-26 10:11:08 +01:00
Peter Maydell
40e7e6d6e8 hw/arm/omap: Remove omap_mpu_model remnants
The omap1.c code has handling for an mpu_model field which is
an enum of which OMAP SoC model it is. We removed most of our
OMAP support some time ago, and now the only OMAP SoC we
implement is the OMAP310, which sets s->mpu_model = omap310
in omap310_mpu_init().

That makes all the handling for other settings of mpu_model dead
code; remove them.  This includes the omap GPIO device's mpu_model
property which we set but which the device makes no use of, and the
omap-id-e20 memory region (because the OMAP310 satisfies
cpu_is_omap15xx(), so never executed the old if() block).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260512203414.3633237-2-peter.maydell@linaro.org
2026-05-26 10:11:08 +01:00
Jamin Lin
e31f57e96b hw/misc/aspeed_scu: Add AST1040 A0 silicon revision ID
Add the AST1040 A0 silicon revision definition and register it
in the supported Aspeed silicon revision table.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260525053036.3305181-6-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2026-05-26 07:13:49 +02:00
Jamin Lin
8c6cf9ef47 hw/arm/aspeed: Consolidate secure SRAM into SRAM array
Some Aspeed SoCs contain multiple SRAM regions with different
sizes and MMIO mappings, such as internal SRAM and secure SRAM.

The current implementation models secure SRAM separately from the
generic SRAM representation, which complicates future multi-SRAM
support and expansion.

Increase ASPEED_SRAM_NUM to 2 and migrate secure SRAM to use the
common SRAM array representation. Rename the secure SRAM memmap
entry to ASPEED_DEV_SRAM1 and update AST10x0 to initialize both
SRAM regions through sram[] and sram_size[].

This unifies SRAM-like regions under a common representation and
prepares for future SoCs with additional SRAM regions.

No functional change.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260525053036.3305181-5-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2026-05-26 07:13:49 +02:00
Jamin Lin
598a9ecf25 hw/arm/aspeed: Rename SRAM memmap entry for multi-SRAM support
Some Aspeed SoCs contain multiple SRAM regions with different
MMIO mappings, such as internal SRAM and secure SRAM.

Prepare for future multi-SRAM support by renaming the SRAM
memmap entry from ASPEED_DEV_SRAM to ASPEED_DEV_SRAM0.
This makes the numbering explicit and aligns with the
array-based SRAM representation introduced previously.

No functional change.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260525053036.3305181-4-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2026-05-26 07:13:49 +02:00
Jamin Lin
43eaa304c1 hw/arm/aspeed: Convert SRAM size definition to array type
Prepare the Aspeed SoC model for future platforms that may contain
multiple SRAM regions with different sizes and MMIO mappings.

The current implementation stores SRAM size information in a single
sram_size field, which limits extensibility when additional SRAM
instances are introduced.

Convert sram_size into an array-based definition and update all
existing users to reference sram_size[0]. This aligns with the
previous SRAM MemoryRegion array conversion and provides a scalable
foundation for supporting multiple SRAM regions in future SoCs.

No functional change.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260525053036.3305181-3-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2026-05-26 07:13:49 +02:00
Jamin Lin
de0a0d2036 hw/arm/aspeed: Convert SRAM MemoryRegion to array type
Several kinds of RAM are supported across Aspeed SoCs, including
SRAM, SDRAM, HyperRAM, secure SRAM, and generic SRAM. In addition,
different SoCs may expose multiple SRAM regions at different MMIO
addresses.

The current implementation models SRAM with a single MemoryRegion
instance, which makes future expansion cumbersome when additional
SRAM types or regions are introduced.

Prepare for future SoC designs by converting the SRAM MemoryRegion
from a single object into an array-based structure. This change
introduces ASPEED_SRAM_NUM and converts existing SRAM users to
reference sram[0].

No functional change.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260525053036.3305181-2-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2026-05-26 07:13:49 +02:00
Akihiko Odaki
297a85fcca ui/input: Remove unused QKeyCode helpers and keymaps
Their users have migrated to Linux key codes.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260520-input-v3-29-7c9e4c7abe34@rsg.ci.i.u-tokyo.ac.jp>
2026-05-25 02:01:35 +04:00
Akihiko Odaki
a96de9002b ui/console: Remove qemu_text_console_put_qcode()
It is no longer used.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260520-input-v3-28-7c9e4c7abe34@rsg.ci.i.u-tokyo.ac.jp>
2026-05-25 02:01:35 +04:00
Akihiko Odaki
9c6833808a ui/kbd-state: Use Linux key codes
QemuInputEvent now stores Linux key codes for key events. Use those
codes directly instead of translating between internal key code
representations.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260520-input-v3-7-7c9e4c7abe34@rsg.ci.i.u-tokyo.ac.jp>
2026-05-25 01:00:54 +04:00
Akihiko Odaki
eb0608e88e ui/console: Add qemu_text_console_put_linux()
Add a text console helper that accepts Linux input key codes and use it
as the common implementation for qemu_text_console_put_qcode(). This lets
callers that already use Linux key codes avoid converting them back to
QKeyCode.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260520-input-v3-6-7c9e4c7abe34@rsg.ci.i.u-tokyo.ac.jp>
2026-05-25 01:00:54 +04:00
Akihiko Odaki
184c07600d ui/input: Use Linux key codes for internal key events
Linux input key codes are a better internal representation than
QKeyCode:

- With Linux input key codes as the internal representation, keys
  previously lost solely because the middle layer between event sources
  and sinks used QKeyCode will be preserved, since Linux key codes
  cover all keys that those sources and sinks use. For example,
  KEY_KPJPCOMMA cannot be represented with QKeyCode, but it is widely
  supported by event sources and sinks since it is included in linux,
  atset1, atset2, usb, x11, osx, qnum (derived from atset1),
  xorgxquartz, and xorgevdev (derived from linux).

- They make it possible to pass through Linux host key codes to Linux
  guests to preserve all key inputs.

- They simplify consumers by avoiding QKeyCode aliases, namely
  asterisk/kp_multiply and sysrq/print.

This matches the approach used by virtio and Xen.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260520-input-v3-4-7c9e4c7abe34@rsg.ci.i.u-tokyo.ac.jp>
2026-05-25 01:00:54 +04:00
Akihiko Odaki
56729b7aaf ui/input: Store QKeyCode directly in QemuInputKeyEvent
Since commit af07e5ff02 ("ui: convert key events to QKeyCodes
immediately"), all internal key events are expected to be represented as
QKeyCode. Replace KeyValue in QemuInputKeyEvent with QKeyCode to enforce
that and simplify key code retrieval.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260520-input-v3-3-7c9e4c7abe34@rsg.ci.i.u-tokyo.ac.jp>
2026-05-25 01:00:54 +04:00
Akihiko Odaki
d0cc63dcce ui/input: Remove QAPI wrappers from QemuInputEvent
QAPI represents union members with wrapper structs and pointer
indirections. They are useful at the QMP boundary, but unnecessary for
QEMU's internal input events and make handlers more verbose.

Define QemuInputEvent as a plain internal tagged union and convert input
handlers, queues, and replay code to access payloads directly.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260520-input-v3-2-7c9e4c7abe34@rsg.ci.i.u-tokyo.ac.jp>
2026-05-25 01:00:54 +04:00
Akihiko Odaki
a0f5963a30 ui/input: Introduce QemuInputEvent typedef
Add QemuInputEvent as the input subsystem's name for InputEvent and use
it in input handler, queue, and replay interfaces.

This prepares for decoupling QEMU's internal input event representation
from the QAPI InputEvent type.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260520-input-v3-1-7c9e4c7abe34@rsg.ci.i.u-tokyo.ac.jp>
2026-05-25 01:00:54 +04:00
Stefan Hajnoczi
db34a713c3 Merge tag 'pull-fpu-20260522' of https://gitlab.com/rth7680/qemu into staging
fpu: Export partsN_{scalbn,muladd}
fpu: Export floatN_minmax
fpu: Simplifications to muladd, addsub
fpu: Introduce exp_scalbn
fpu: Introduce FloatExceptionFlags
fpu: Use float_status accessors everywhere
fpu: Compress float_status with bitfields
fpu: Fixes for E4M3 vs NaNs
target/alpha: Remove CONFIG_SOFTFLOAT_INLINE
target/alpha: Use FloatExceptionFlags
target/s390x: Move float{32,64}_s390_divide_to_integer

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmoQn7MdHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV90UAgAi5CiZ1Tty9NFzDto
# CHhpqSybOworRgxb02vMYU+OvM11VBRbqaIjiIX7B6SFiEEefxv00+n2qRM1P5+T
# Sk4UwMA6r07yxL45sAXvUzL0+qjAHxulBAVClUNWA5bCcG0/2tb8R3yI+ZJ8PgFi
# M1+AdbPNo9vNJdh27sLa3i9Atz6Z28GzksB/zLv+WJGEeE5d/UQCtaGjXRYoQAoV
# vDsNHdU8tym9NZl3FpsuPfZeuQkSbpm72vYa9F4m7lvcZO878JsgdiFcd8BM/EnT
# HVmSsltwTdttm1wILsp9XklCMzKZvC/q2m+cmwzRUpv2U0rION6pq0B32sItYXi+
# tFY8vA==
# =j/fN
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 22 May 2026 14:25:55 EDT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* tag 'pull-fpu-20260522' of https://gitlab.com/rth7680/qemu: (30 commits)
  fpu: Export floatN_minmax
  fpu: Fix NaN encoding for E4M3 in parts64_uncanon
  fpu: Introduce float_status.e4m3_nan_is_snan
  fpu: Reorg float_status
  fpu: Add accessors for rebias_{underflow,overflow}
  fpu: Use get_float_default_nan_pattern in partsN_default_nan
  fpu: Use get_default_nan_mode everywhere
  fpu: Use {get,set}_flush_inputs_to_zero everywhere
  fpu: Use accessors for ftz_before_rounding
  fpu: Use {get,set}_flush_to_zero everywhere
  fpu: Use accessors for tininess_before_rounding
  fpu: Use get_float_infzeronan_rule in partsN_pick_nan_muladd
  fpu: Use get_float_3nan_prop_rule in partsN_pick_nan_muladd
  fpu: Use get_float_2nan_prop_rule in partsN_pick_nan
  fpu: Use get_floatx80_behaviour everywhere
  fpu: Use of {get,set}_floatx80_rounding_precision everywhere
  fpu: Use {get,set}_float_rounding_mode everywhere
  fpu: Introduce FloatSNaNRule
  fpu: Introduce frac_msb_is_snan
  target/alpha: Use FloatExceptionFlags
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2026-05-24 07:45:07 -04:00
Stefan Hajnoczi
fcabc76ddf Merge tag 'pull-riscv-to-apply-20260522' of https://github.com/alistair23/qemu into staging
RISC-V PR for 11.1.

* Remove spike as default machine
* Deprecate the shakti_c machine
* Set MISA.[C|X] based on the selected extensions
* Update Maintainers for OpenSBI Firmware
* Update OpenSBI to v1.8.1
* Avoid RISCVCPU copy in PMU FDT setup
* A collection of specification compliance improvements
* Fix Svnapot 64KB pages
* Handle source overlap of vector widening reduction instructions
* Check interrupt in SiFive UART after txctrl register is written
* Fix medeleg[11] read-only zero bit for M-mode ECALL
* Fix tail handling for vmv.s.x and vfmv.s.f
* Update the local AIA interrupt mask
* Add KVM support for Zicbop and BFloat16 extensions
* Fix the IOMMU FSC SV32 capability check
* Avoid caching PCI device IDs in the IOMMU
* Implement Microchip mpfs ioscb PLLs and sysreg clock dividers
* Remove the internal CPU riscv_cpu_* arrays
* Fix IOCOUNTINH.CY toggle detection
* Fix the read of pmpaddr(0-63) CSRs
* Make hpmcounterh return the upper 32-bits
* Minor fixes and enhancements of RISC-V AIA devices
* Re-process IOMMU command queue after clearing CMD_ILL

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEaukCtqfKh31tZZKWr3yVEwxTgBMFAmoPnQkACgkQr3yVEwxT
# gBMudxAAvN8XD1zauMzk62tkXCmVA5fjqtTqu4Ytp8Pe3P7ZX9FZP6Alcw+G+zEd
# QQdIeHTzxzs77LO5VLKlLS807W5by9eMQDPOWvCRk2rQWJfgbxYq//dJNOPpJfR1
# ptDsvnxonfn8lh34Bm7nI+UaznRVSr3mSts8LN5R9GANLHRPYbJbtSRb2qSGBPzP
# ynNvuD0tmt9gXf+j9O9qr5DkoRoiZdoRTGdQ9a/eWlxP/eNvPzq0c74ToPpz3Obv
# 6z/ICImKZGL36W8B73FbGy30EySihdPTcLSQHqsUZ+mYtj+6WGtIbIoZkaugnfml
# M8DuukT6sO8GdZy7cFnxhThsnZ+HEylzpjHHWYJlvY9uUniM0wrCavCc0lvUm71A
# Mi0yASlmv6kXotxtmz+UZF6/h7vTJHXvEo/g9cwshSVjxYDhHf8GtIYVegLTTeoP
# z1UfpdepH6fe9E8cf6DUSwr1syODSf0qjiKVMVMxb/OMEk3qEB0uwbG+X1Ecs9s1
# SQo6cp5TdiSjzP87MyMDeTeaS6FQrkVEkXXgcpFf1W/R0zRuj/JW89sGCJvS7Tqk
# +bH4pNnzXTBNxuGrb3zZSC0yWdroSiqyT+9g/JlQMY9tBvnoY8p7Ck7g07nLhVSf
# Cj4C0SXRMSj8eHn2+pDqjZn1RUfG2mRAD+8yYWqZ2GvU2X/yhx8=
# =SSwl
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 21 May 2026 20:02:17 EDT
# gpg:                using RSA key 6AE902B6A7CA877D6D659296AF7C95130C538013
# gpg: Good signature from "Alistair Francis <alistair@alistair23.me>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 6AE9 02B6 A7CA 877D 6D65  9296 AF7C 9513 0C53 8013

* tag 'pull-riscv-to-apply-20260522' of https://github.com/alistair23/qemu: (48 commits)
  hw/riscv: riscv-iommu: Re-process command queue after clearing CMD_ILL
  hw/intc: riscv_aplic: add trace events of APLIC read/write function
  hw/intc: riscv_imsic: Add reset API to IMSIC
  hw/intc: riscv_aplic: Add reset API to APLIC
  hw/intc: riscv_aplic: Fix level trigger IRQ in direct delivery mode
  target/riscv: Make hpmcounterh return the upper 32-bits
  hw/riscv/virt-acpi-build: Fix off-by-one error in RIMT ID mapping
  target/riscv/csr.c: fix read of pmpaddr(0-63) CSRs
  hw/riscv/riscv-iommu: Fix IOCOUNTINH.CY toggle detection
  target/riscv/cpu: remove riscv_cpu_* arrays
  target/riscv/tcg: use isa_edata_arr[] to create user props
  target/riscv: do not set defaults in cpu prop callback
  target/riscv/tcg: use cfg_offset as cpu_set_multi_ext cb opaque
  target/riscv/tcg: use isa_edata_arr[] to enable max exts
  target/riscv/kvm: use isa_edata_arr[] for unavailable props
  target/riscv/tcg: use isa_edata_arr[] in riscv_cpu_update_misa_x()
  target/riscv: remove riscv_cpu_named_features[]
  target/riscv/cpu.c: remove riscv_cpu_enable_named_feat()
  target/riscv/tcg: use only isa_edata_arr[] in cpu_cfg_ext_get_name()
  target/riscv/tcg: treat all exts equally in cpu_disable_priv_spec_isa_exts
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2026-05-24 07:44:52 -04:00
Stefan Hajnoczi
4c4b309510 Merge tag 'misc-next-pull-request' of https://gitlab.com/berrange/qemu into staging
Misc patches for iotests, qom, crypt & io

 * Fix client side anoymous TLS credentials
 * Fix return value semantics for qio_channel_flush
 * Add ID validation of internal QOM constructor
 * Fix ability to create internal QOM objects
   without a parent
 * Merge user creatable object constructor into
   main QOM file
 * Print reason for skipping I/O tests
 * Remove redundant meson suits for I/O tests
 * Add optional suites for many block drivers I/O tests
 * Run I/O tests for 10 block drivers in GitLab CI
 * Fix sudo check for LUKS I/O test
 * Mark I/O test 151, 181, 185, 308 as flaky

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE2vOm/bJrYpEtDo4/vobrtBUQT98FAmoPDUkACgkQvobrtBUQ
# T9+ZGQ/+PUFHFBgKHqb8kVNpKE1MJ+FDiwgRKHq0oSHdyO+lTzbAUZOM/2B/VSTu
# vJijLHEGalCRjMoZgRcRVtXaJGKoem7tXTe/giX+CiULSAD8cHcZ657imzPmjEPk
# +oEPgTRpbPTWbxgUS6Y5lztYgJz84Tkhs/lTr3Y8mOHUcVPJXYe0OClP+DXQJvu4
# I12EkKUA7+FA1UiwYR0Hkq5ZfED48VygVnCVpb12ggri3BrwAuk9SNaAGbz0EbNm
# uYrmneLVAey/Y3XW9NxJ056KNF10Mpcmj2lhJuUu9lyfw/jNeicwESC6MNEMK0Pq
# ttq9t3J+osotwElrFnrh7tWusGDloJArpcZbL6xNQ5r3vDrlnviUeUJZOfs7wDLZ
# LOFhi0xJLN3Gk9Cms+xcaTmQRf5/1DBZUTxG3vFqqjNzNOzuJOPseviXw5lDau2g
# sTVPX77VpOCV8JJoetZuoloBOxiLB4fbt4uY812t4Ru5vrt2o7F36aeBekgRB9lZ
# SvS+fuj5rLiPjvLoI76HQ8uzEDtJGp7h3LoIDO47pQJRZ7jfc6kbLioZptmxlfSf
# i5LEa/hido+o11QvnEZ8aMfdUoQZAJsHtNLrzPwOl1NnFBYmX/GBk2vO6xrmoqUO
# aykd/gWzH/NhZ3eq+cZlI4iEQSOaLFySzq39jdz77bBAzhI38nI=
# =Onca
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 21 May 2026 09:48:57 EDT
# gpg:                using RSA key DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full]
# gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>" [full]
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF

* tag 'misc-next-pull-request' of https://gitlab.com/berrange/qemu: (29 commits)
  qom: drop user_creatable_add_type method
  qom: allow object_new_with_prop* to trigger module loading
  qom: fix ability to create objects without a parent
  qom: add object_new_with_props_from_qdict
  qom: move object_set_prop_keyval into object.c
  qom: have object_set_props_keyval return bool
  qom: shorten name of object_set_properties_from_keyval
  qom: make errp last param in methods taking va_list
  qom: validate ID format when creating objects
  hw/vfio-user: use a valid object ID for iothread
  qom: add trace events for object/property lifecycle
  gitlab: remove I/O tests from build-tcg-disabled job
  gitlab: add jobs for thorough block tests
  iotests: mark 151, 181, 185 & 308 as flaky tests
  iotests: fix check for sudo access in LUKS I/O test
  iotests: validate dmsetup result in test 128
  iotests: use 'driver' as collective term for either format or protocol
  iotests: add nbd and luks to the I/O test suites
  docs/devel/testing: expand documentation for 'make check-block'
  iotests: add a meson suite / make target per block I/O tests format
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2026-05-24 07:44:37 -04:00
Richard Henderson
512f5147c8 fpu: Export floatN_minmax
Allow target access to routines using the minmax flags.
Make the existing min/max wrappers inline.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-05-22 11:21:37 -07:00
Richard Henderson
41044b5475 fpu: Introduce float_status.e4m3_nan_is_snan
Introduce a separate control from float_snan_rule
that applies only to the OCP E4M3 format.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-05-21 19:18:56 -07:00
Richard Henderson
8c86fe2451 fpu: Reorg float_status
Use bitfields to compress float_status from 18 bytes down to 8 bytes.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-05-21 19:18:56 -07:00
Richard Henderson
bffa0bd6af fpu: Add accessors for rebias_{underflow,overflow}
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-05-21 19:18:56 -07:00
Richard Henderson
eb2d6a7349 fpu: Use get_float_default_nan_pattern in partsN_default_nan
Move get_float_default_nan_pattern to softfloat-specialize.c.inc,
since there are no external users.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-05-21 19:18:56 -07:00
Richard Henderson
0dea2bdd4b fpu: Use accessors for ftz_before_rounding
Drop FloatFTZDetection and use #defines, like we do for
tininess_before_rounding.  Rename get_float_ftz_detection
to get_ftz_before_rounding and move to softfloat.c, as
there are no external users.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-05-21 19:18:56 -07:00
Richard Henderson
1126ebe189 fpu: Use accessors for tininess_before_rounding
Rename get_float_detect_tininess to get_tininess_before_rounding
and move to softfloat.c, as there are no external users.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-05-21 19:18:56 -07:00
Richard Henderson
87ab6f0ae8 fpu: Use get_floatx80_behaviour everywhere
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-05-21 19:18:56 -07:00
Richard Henderson
acb6d59857 fpu: Introduce FloatSNaNRule
Merge snan_bit_is_one and no_signaling_nans into one control.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-05-21 19:18:56 -07:00
Richard Henderson
a9717332d7 fpu: Introduce FloatExceptionFlags
We have, in the past, used any of uint8_t, uint16_t or int
to hold the set of exception flags.  Use a typedef instead.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-05-21 19:18:56 -07:00
Richard Henderson
f0eb9fe01b target/s390x: Move float{32,64}_s390_divide_to_integer
Now that we've exposed enough infrastructure, this can be
implemented in the backend that needs it.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-05-21 19:18:56 -07:00
Richard Henderson
21da8ac79d fpu: Return struct from parts{64,128}_muladd
At the same time, export.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-05-21 19:18:56 -07:00
Richard Henderson
5f36d09bf6 fpu: Return struct from parts{64,128}_scalbn
At the same time, export.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-05-21 19:18:45 -07:00
Guenter Roeck
7623bf5664 hw: misc: Implement Microchip mpfs ioscb PLLs and sysreg clock dividers
Minimal clock register configuration required to boot Linux
without backtraces in the clock code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260514-reference-overhand-749149e36a88@spud>
[ Changes by AF:
 - Fixup checkpatch errors
]
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2026-05-22 09:45:47 +10:00
Stefan Hajnoczi
b049647658 Merge tag 'next-pull-request' of https://gitlab.com/peterx/qemu into staging
Migration and mem pull request

- Peter's fix on 2nd migration crashing if the 1st migration cancelled early
- Phil's patch to remove VMS_MULTIPLY_ELEMENTS across tree
- Peter's fix on possible division by zero in recent query-migrate change
- Aadeshveer's cleanup for current_migration references
- Fabiano's fix of auto-converge test
- Maciej's maintainer file update for CPR
- Fabiano's migration qtest refactor to stick with -incoming defer
- Bin's cleanup / fix series all over migration (part of)
- hongmianquan's cpr optimization to use ghash for fd bookkeeping
- Yong's email address update

# -----BEGIN PGP SIGNATURE-----
#
# iIcEABYKADAWIQS5GE3CDMRX2s990ak7X8zN86vXBgUCag4ohxIccGV0ZXJ4QHJl
# ZGhhdC5jb20ACgkQO1/MzfOr1wbcVwD44j47Luc9/YKyug1h33kAIxLmuE3muwry
# Se9mtlhwAgEA1YzFtLxlshi3OqTJ++7AZt/jWv5J9yETXohqowFETAk=
# =KHDN
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 20 May 2026 17:32:55 EDT
# gpg:                using EDDSA key B9184DC20CC457DACF7DD1A93B5FCCCDF3ABD706
# gpg:                issuer "peterx@redhat.com"
# gpg: Good signature from "Peter Xu <xzpeter@gmail.com>" [full]
# gpg:                 aka "Peter Xu <peterx@redhat.com>" [full]
# Primary key fingerprint: B918 4DC2 0CC4 57DA CF7D  D1A9 3B5F CCCD F3AB D706

* tag 'next-pull-request' of https://gitlab.com/peterx/qemu: (29 commits)
  MAINTAINERS: Update email of Yong Huang
  migration/cpr: use hashtable for cpr fds
  migration/multifd: cache channel count in multifd_send_sync_main
  migration/multifd: cache migrate_multifd_channels() in send/recv hot paths
  migration/multifd: fix off-by-one in recv channel ID validation
  migration/savevm: use stack-allocated bitmap in configuration_validate_capabilities
  migration/vmstate: avoid per-element heap churn in vmsd ptr marker field
  migration/global_state: replace strcpy("") with explicit NUL termination
  tests/qtest/migration: Unify URIs
  tests/qtest/migration: Stop passing URI into migrate_start
  tests/qtest/migration: Use defer in dirty_limit test
  tests/qtest/migration: Use defer for auto-converge
  tests/qtest/migration: Use defer for cpr-tests
  tests/qtest/migration: Use defer for all tests
  tests/qtest/migration: Remove multifd compression hook
  tests/qtest/migration: Set compression method in compression-tests
  tests/qtest/migration: Defer by default in precopy_common
  tests/qtest/migration: Use a default TCP URI for precopy
  tests/qtest/migration: Use precopy_unix_common for ignore-shared test
  tests/qtest/migration: Group unix migration tests
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2026-05-21 08:59:54 -04:00
Daniel P. Berrangé
7b0376d24c qom: drop user_creatable_add_type method
This can be replaced by object_new_with_props_from_qdict, which does
functionally the same job, but the caller does not own the returned
reference, instead the parent object owns it.

In one case we can use object_new_with_props_from_qdict_owned instead
since the object is not intended to have any parent.

Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2026-05-21 12:39:54 +01:00
Daniel P. Berrangé
4d6a50a96e qom: fix ability to create objects without a parent
object_new_with_propv allowed id/parent to be optional, in which case
the caller was expected to own the returned object. Unfortunately a
trailing object_unref() meant that the returned object was already
freed.

It is confusing to have a single method with two different ownership
scenarios for the returned object.

Make id/parent mandatory in object_new_with_propv once more, and add
a new object_new_with_propv_parentless that does not accept id/parent
at all and lets the caller own the returned reference.

The helper method has abstracted the way properties are represented
and set in order to facilitate the subsequent commit.

Unit tests are added to address the root cause that allowed the bug
to slip through in commit 6134d752.

Fixes: 6134d7522e ("qom: don't require user creatable objects to be registered")
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2026-05-21 12:39:54 +01:00
Daniel P. Berrangé
608562c5a8 qom: add object_new_with_props_from_qdict
This will be used to replace user_creatable_add_type with an impl
that shares most code with object_new_with_props, and is not tied
to the user creatable interface.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2026-05-21 12:39:54 +01:00
Daniel P. Berrangé
655256b340 qom: move object_set_prop_keyval into object.c
This matches the location of the object_set_props and object_set_propv
methods, since this method is not inherently tied to the user creatable
interface. As part of this, object_set_props_from_qdict is also exposed
as a public API since it is still called from object_interfaces.c.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2026-05-21 12:39:54 +01:00
Daniel P. Berrangé
24984a97eb qom: have object_set_props_keyval return bool
This matches the convention established by the object_set_props and
object_set_propv methods.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2026-05-21 12:39:54 +01:00
Daniel P. Berrangé
66964fa3f3 qom: shorten name of object_set_properties_from_keyval
This matches the convention established by the object_set_props and
object_set_propv methods.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2026-05-21 12:39:54 +01:00
Daniel P. Berrangé
23f3d3d3bb qom: make errp last param in methods taking va_list
object_new_with_props can't put 'errp' last due to the use of
variadic arguments. That constraint does not apply to the use
of va_list with object_new_with_propv, so follow normal practice
with 'errp' placement.

The same rationale applies to object_set_propv.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2026-05-21 12:39:54 +01:00