]> git.ipfire.org Git - thirdparty/qemu.git/log
thirdparty/qemu.git
2 weeks agohw/pci-host/aspeed_pcie: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:32 +0000 (02:50 +0000)] 
hw/pci-host/aspeed_pcie: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline 6 standalone TypeInfo variables (aspeed_pcie_phy_info, aspeed_2700_pcie_phy_info
aspeed_pcie_root_port_info, aspeed_pcie_rc_info, aspeed_pcie_cfg_info and
aspeed_2700_pcie_cfg_info directly into the 'aspeed_pcie_types[]'
array, removing the need for separate declarations.

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/20260601024959.2347639-22-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/fsi/aspeed_apb2opb: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:31 +0000 (02:50 +0000)] 
hw/fsi/aspeed_apb2opb: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

This file contains two independent subsystems (aspeed_apb2opb and
fsi_opb), each with its own type_init() call. Both are converted to
separate DEFINE_TYPES() blocks to preserve the original registration
boundary.

Inline the standalone 'aspeed_apb2opb_info' and 'fsi_opb_info'
TypeInfo variables directly into their respective types arrays,
removing the need for separate declarations.

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/20260601024959.2347639-21-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/timer/aspeed_timer: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:29 +0000 (02:50 +0000)] 
hw/timer/aspeed_timer: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline 6 standalone TypeInfo variables (aspeed_timer_info as abstract
base, aspeed_2400_timer_info, aspeed_2500_timer_info,
aspeed_2600_timer_info, aspeed_1030_timer_info, aspeed_2700_timer_info)
directly into the 'aspeed_timer_types[]' array, removing the need for
separate declarations.

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/20260601024959.2347639-20-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/nvram/aspeed_otp: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:28 +0000 (02:50 +0000)] 
hw/nvram/aspeed_otp: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline the standalone 'aspeed_otp_info' TypeInfo variable directly
into the 'aspeed_otp_types[]' array, removing the need for a separate
declaration.

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/20260601024959.2347639-19-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/watchdog/wdt_aspeed: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:26 +0000 (02:50 +0000)] 
hw/watchdog/wdt_aspeed: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline 6 standalone TypeInfo variables (aspeed_wdt_info as abstract
base, aspeed_2400_wdt_info, aspeed_2500_wdt_info, aspeed_2600_wdt_info,
aspeed_1030_wdt_info, aspeed_2700_wdt_info) directly into the
'aspeed_wdt_types[]' array, removing the need for separate declarations.

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/20260601024959.2347639-18-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/rtc/aspeed_rtc: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:25 +0000 (02:50 +0000)] 
hw/rtc/aspeed_rtc: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline the standalone 'aspeed_rtc_info' TypeInfo variable directly
into the 'aspeed_rtc_types[]' array, removing the need for a separate
declaration.

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/20260601024959.2347639-17-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/intc/aspeed_vic: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:23 +0000 (02:50 +0000)] 
hw/intc/aspeed_vic: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline the standalone 'aspeed_vic_info' TypeInfo variable directly
into the 'aspeed_vic_types[]' array, removing the need for a separate
declaration.

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/20260601024959.2347639-16-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/intc/aspeed_intc: convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:22 +0000 (02:50 +0000)] 
hw/intc/aspeed_intc: convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline 9 standalone TypeInfo variables (aspeed_intc_info as abstract
base, aspeed_2700_intc_info, aspeed_2700_intcio_info,
aspeed_2700_intcioexp1_info, aspeed_2700_intcioexp2_info,
aspeed_2700ssp_intc_info, aspeed_2700ssp_intcio_info,
aspeed_2700tsp_intc_info, aspeed_2700tsp_intcio_info) directly into
the 'aspeed_intc_types[]' array, removing the need for separate
declarations.

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/20260601024959.2347639-15-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/gpio/aspeed_sgpio: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:20 +0000 (02:50 +0000)] 
hw/gpio/aspeed_sgpio: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline 2 standalone TypeInfo variables (aspeed_sgpio_info and
aspeed_sgpio_ast2700_info) directly into the 'aspeed_sgpio_types[]'
array, removing the need for separate declarations.

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/20260601024959.2347639-14-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/gpio/aspeed_gpio: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:19 +0000 (02:50 +0000)] 
hw/gpio/aspeed_gpio: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline 7 standalone TypeInfo variables (aspeed_gpio_info as abstract
base, aspeed_2400_gpio_info, aspeed_2500_gpio_info,
aspeed_2600_1_8v_gpio_info, aspeed_2600_3_3v_gpio_info,
aspeed_1030_gpio_info, aspeed_2700_gpio_info)
directly into the 'aspeed_gpio_types[]'
array, removing the need for separate declarations.

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/20260601024959.2347639-13-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/arm/aspeed_ast1700: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:17 +0000 (02:50 +0000)] 
hw/arm/aspeed_ast1700: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline the standalone TypeInfo variable directly into the
'aspeed_ast1700_types[]' array, removing the need for a separate
declaration.

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/20260601024959.2347639-12-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/adc/aspeed_adc: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:16 +0000 (02:50 +0000)] 
hw/adc/aspeed_adc: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline 7 standalone TypeInfo variables (aspeed_adc_engine_info,
aspeed_adc_info as abstract base, aspeed_2400_adc_info,
aspeed_2500_adc_info, aspeed_2600_adc_info, aspeed_1030_adc_info,
aspeed_2700_adc_info) directly into the 'aspeed_adc_types[]' array,
removing the need for separate declarations. Note that aspeed_2400 and
aspeed_2500 variants carry only .name and .parent with no class_init.

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/20260601024959.2347639-11-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/misc/aspeed_xdma: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:14 +0000 (02:50 +0000)] 
hw/misc/aspeed_xdma: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline 4 standalone TypeInfo variables (aspeed_xdma_info as abstract
base, aspeed_2400_xdma_info, aspeed_2500_xdma_info,
aspeed_2600_xdma_info) directly into the 'aspeed_xdma_types[]'
array, removing the need for separate declarations.

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/20260601024959.2347639-10-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/misc:aspeed_sli: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:13 +0000 (02:50 +0000)] 
hw/misc:aspeed_sli: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline 3 standalone TypeInfo variables (aspeed_sli_info as abstract
base, aspeed_2700_sli_info, aspeed_2700_sliio_info) directly into the
'aspeed_sli_types[]' array, removing the need for separate
declarations.

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/20260601024959.2347639-9-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/misc/aspeed_sdmc: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:11 +0000 (02:50 +0000)] 
hw/misc/aspeed_sdmc: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline 5 standalone TypeInfo variables (aspeed_sdmc_info as abstract
base, aspeed_2400_sdmc_info, aspeed_2500_sdmc_info,
aspeed_2600_sdmc_info, aspeed_2700_sdmc_info) directly into the
'aspeed_sdmc_types[]' array, removing the need for separate
declarations.

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/20260601024959.2347639-8-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/misc/aspeed_scu: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:10 +0000 (02:50 +0000)] 
hw/misc/aspeed_scu: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline 7 standalone TypeInfo variables (aspeed_scu_info as abstract
base, aspeed_2400_scu_info, aspeed_2500_scu_info, aspeed_2600_scu_info,
aspeed_1030_scu_info, aspeed_2700_scu_info, aspeed_2700_scuio_info)
directly into the 'aspeed_scu_types[]' array, removing the need for
separate declarations.

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/20260601024959.2347639-7-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/misc/aspeed_sbc: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:08 +0000 (02:50 +0000)] 
hw/misc/aspeed_sbc: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline 3 standalone TypeInfo variables (aspeed_2600_sbc_info,
aspeed_ast10x0_sbc_info, aspeed_sbc_info) directly into the
'aspeed_sbc_types[]' array, removing the need for separate
declarations.

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/20260601024959.2347639-6-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/misc/aspeed_pwm: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:07 +0000 (02:50 +0000)] 
hw/misc/aspeed_pwm: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline the standalone 'aspeed_pwm_info' TypeInfo variable directly
into the 'aspeed_pwm_types[]' array, removing the need for a separate
declaration.

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/20260601024959.2347639-5-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/misc/aspeed_ltpi: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:05 +0000 (02:50 +0000)] 
hw/misc/aspeed_ltpi: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline the standalone 'aspeed_ltpi_info' TypeInfo variable directly
into the 'aspeed_ltpi_types[]' array, removing the need for a separate
declaration.

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/20260601024959.2347639-4-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/misc/aspeed_lpc: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:04 +0000 (02:50 +0000)] 
hw/misc/aspeed_lpc: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline the standalone 'aspeed_lpc_info' TypeInfo variable directly
into the 'aspeed_lpc_types[]' array, removing the need for a separate
declaration.

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/20260601024959.2347639-3-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agohw/misc/aspeed_hace: Convert to DEFINE_TYPES() with inlined TypeInfo
Jamin Lin [Mon, 1 Jun 2026 02:50:02 +0000 (02:50 +0000)] 
hw/misc/aspeed_hace: Convert to DEFINE_TYPES() with inlined TypeInfo

Replace the legacy type_register_static()/type_init() registration
pattern with the modern DEFINE_TYPES() macro.

Inline 6 standalone TypeInfo variables (aspeed_hace_info as abstract
base, aspeed_2400_hace_info, aspeed_2500_hace_info,
aspeed_2600_hace_info, aspeed_1030_hace_info, aspeed_2700_hace_info)
directly into the 'aspeed_hace_types[]' array, removing the need for
separate declarations.

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/20260601024959.2347639-2-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2 weeks agoMerge tag 'qom-tests-pr-v2' of https://gitlab.com/marcandre.lureau/qemu into staging
Stefan Hajnoczi [Sat, 6 Jun 2026 18:47:04 +0000 (14:47 -0400)] 
Merge tag 'qom-tests-pr-v2' of https://gitlab.com/marcandre.lureau/qemu into staging

Fix various QOM object life-cycle issues

This series adds a new "qom-tests" qtest command that exercises basic QOM
object life-cycle: it instantiates all non-abstract object types, gets/sets
their properties, and unrefs them. This quickly surfaces leaks and crashes
that could otherwise be triggered at runtime via QMP qom commands.

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmojrOsACgkQ2ujhCXWW
# nOUHSg/9EvbthHQZb0b9uKHoGrR9xCc2eGY/xnR6cNzl0jUvOQ9Hnqzm54Wmxw4s
# S5vql/3AISgYVl8ScTv5YZlwrXLCIM7FYCCbMIR4gcCjNfEBuxF3zmMQZSLdVFVx
# gUZ0d07sWVsT+jtPoehloWJAnIjsFDA/BlVFusN4MLtfmCRJV7QSbXsI3aN2mgZT
# vq2j8Ia8atRxf3mxkfKZwarTAz9tzIlHOD87gkHZJFv2lJfx2PgC9j5xmd8O5uXV
# cWZsZQldopa+hlZOGi++SfwbnFmYLHYPiVr/ZgM+gdMOrFaQxx1+SIrw8HDYLDK+
# o3I4YpE/sTUJoBMl9BA6nUJzxPlg1akziMUoI5us2uXUsU+QQvEL8zgpMYmqz4BW
# 5jhweo9SG7ZMQ21U4QLTX94HC/uPoq0WeBJuY+dHf57SApBdhMjq4l+pwTeUwk5c
# nGO4gT0aPSsjscYsJqpZeOXGLgjlvO/Lv7+2DpoP0mLWYy6CLHg/RuFGIG7IPlIu
# J17bSkD+g5HNBUCgABExqd+6FgfPHOPqlOYHTh93juYDvrrztLjevTZpgLzfMzi+
# qnBlx/688QCjp00wgGGjYY8afBFhGTn5Okm64F1KVmd0rzdCLQuVhLdV1zn31jwF
# 39EfdkguGr800AFKYaYOTfuPNzWSwH04m4c0EXZYfxg7/LBplzc=
# =8fwy
# -----END PGP SIGNATURE-----
# gpg: Signature made Sat 06 Jun 2026 01:15:23 EDT
# gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* tag 'qom-tests-pr-v2' of https://gitlab.com/marcandre.lureau/qemu: (23 commits)
  qtest: add "qom-tests" command
  hw/i2c/pmbus: fix undefined behavior in pmbus_direct_mode2data
  target/riscv: use hash table as set for user_options
  target/riscv: fix general_user_opts hash table leak
  hw/ppc/spapr: free host_model and host_serial on finalization
  hw/loongarch/virt: free flash devices and OEM strings on finalization
  hw/tpm: free PPI buffer on finalization
  hw/i386/pc: free pcspk on finalization
  hw/i386/nitro_enclave: add instance finalize
  target/i386/kvm/tdx: free strings in tdx_guest_finalize
  target/i386/sev: add finalize functions and fix leaking setters
  net/filter: free old values in property setters
  hw/core/machine: free shim_filename on finalization
  system/ioport: minor code simplification
  backends/cryptodev-lkcf: skip cleanup when not initialized
  hw/intc/apic: move checks to realize()
  hw/xlnx_dp: reject NULL 'dpdma' property rather than crash
  hw/ipmi: reject NULL 'bmc' property rather than crash
  hw/pci-host/q35: handle NULL bus in pci-hole64 getters
  hw/pci-host/i440fx: handle NULL bus in pci-hole64 getters
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 weeks agoMerge tag 's390x-20260605' of https://gitlab.com/cohuck/qemu into staging
Stefan Hajnoczi [Sat, 6 Jun 2026 18:46:04 +0000 (14:46 -0400)] 
Merge tag 's390x-20260605' of https://gitlab.com/cohuck/qemu into staging

s390x updates:
- several fixes, mostly pci related, also in the STSI implementation
- fix up some file patterns in MAINTAINERS
- stop looking for ESA/390 (pre-64 bit zArch) hosts

# -----BEGIN PGP SIGNATURE-----
#
# iIgEABYKADAWIQRpo7U29cv8ZSCAJsHeiLtWQd5mwQUCaiLhyBIcY29odWNrQHJl
# ZGhhdC5jb20ACgkQ3oi7VkHeZsGWiwD9FBIWXkKmaiGHf9ZExaUQIOJQhwz6E3rY
# mePjnFxbxXcBALq/ODbmy38XDHLzXTzPFIiSXA6Y5xM02IA2zqd0GOQO
# =okD7
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 05 Jun 2026 10:48:40 EDT
# gpg:                using EDDSA key 69A3B536F5CBFC65208026C1DE88BB5641DE66C1
# gpg:                issuer "cohuck@redhat.com"
# gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [unknown]
# gpg:                 aka "Cornelia Huck <cohuck@kernel.org>" [unknown]
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full]
# gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full]
# gpg:                 aka "Cornelia Huck <cohuck@redhat.com>" [unknown]
# gpg: WARNING: The key's User ID is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF
#      Subkey fingerprint: 69A3 B536 F5CB FC65 2080  26C1 DE88 BB56 41DE 66C1

* tag 's390x-20260605' of https://gitlab.com/cohuck/qemu:
  buildsys: Stop checking for ESA/390 host
  MAINTAINERS: Fix tcg/s390x/ path
  MAINTAINERS: Fix s390x storage key/attribute device paths
  s390x/pci: Fix interrupt forwarding disable for interpreted devices
  hw/s390x/ccw: Mark virtio-pci disable-legacy property as optional
  target/s390x: Make container ids in SysIB_15x 1-based
  hw/s390x: Fix memory leaks after removing elements with QTAILQ_REMOVE

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 weeks agoqtest: add "qom-tests" command
Marc-André Lureau [Fri, 24 Apr 2026 16:28:11 +0000 (20:28 +0400)] 
qtest: add "qom-tests" command

Add a new "qom-tests" to exercise basic object lifecycle. Instantiate
all non-abstract objects, get and set properties and unref.

This should quickly find leaks and other related issues that are
eventually triggerable at run-time with QMP qom commands.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agohw/i2c/pmbus: fix undefined behavior in pmbus_direct_mode2data
Marc-André Lureau [Mon, 27 Apr 2026 16:50:43 +0000 (20:50 +0400)] 
hw/i2c/pmbus: fix undefined behavior in pmbus_direct_mode2data

The intermediate result of (Y * 10^-R - b) / m can be negative when
the bias (b) is large and the raw register value is small (e.g. zero
on an uninitialized device). Assigning that negative double to uint32_t
is undefined behavior, caught by UBSan/clang.

Use a double intermediate and clamp negative results to zero (suggested
by Daniel Berrangé)

Fixes: 3746d5c15e70 ("hw/i2c: add support for PMBus")
Reviewed-by: Titus Rwantare <titusr@google.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agotarget/riscv: use hash table as set for user_options
Marc-André Lureau [Mon, 4 May 2026 10:24:53 +0000 (14:24 +0400)] 
target/riscv: use hash table as set for user_options

The values stored in user_options are never retrieved, only key
presence is checked. Use g_hash_table_add() instead of
g_hash_table_insert() and drop the unused value parameter.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agotarget/riscv: fix general_user_opts hash table leak
Marc-André Lureau [Mon, 27 Apr 2026 12:31:30 +0000 (16:31 +0400)] 
target/riscv: fix general_user_opts hash table leak

The global general_user_opts hash table is recreated on every
riscv_cpu_init() call, leaking the previous one.

Furthermore, the CPU settings should be associated with their instance
and not global.

Add a finalize() to free associated instances.

Fixes: d167a2247ede ("target/riscv: move 'pmu-mask' and 'pmu-num' to riscv_cpu_properties[]")
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agohw/ppc/spapr: free host_model and host_serial on finalization
Marc-André Lureau [Mon, 27 Apr 2026 12:26:25 +0000 (16:26 +0400)] 
hw/ppc/spapr: free host_model and host_serial on finalization

The host_model and host_serial strings are allocated via g_strdup in
property setters but never freed when the machine is destroyed.

Fixes: 27461d69a0f ("ppc: add host-serial and host-model machine attributes (CVE-2019-8934)")
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agohw/loongarch/virt: free flash devices and OEM strings on finalization
Marc-André Lureau [Mon, 27 Apr 2026 12:21:42 +0000 (16:21 +0400)] 
hw/loongarch/virt: free flash devices and OEM strings on finalization

Flash devices created in virt_initfn() via qdev_new() hold an extra
reference that is only dropped on sysbus_realize_and_unref(). When the
machine is destroyed before realization, the flash objects leak. Also,
the oem_id and oem_table_id strings from g_strndup() are never freed.

Fixes: 445c9c645 ("hw/loongarch/virt: Allow user to customize OEM ID and OEM table ID")
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agohw/tpm: free PPI buffer on finalization
Marc-André Lureau [Mon, 27 Apr 2026 12:08:30 +0000 (16:08 +0400)] 
hw/tpm: free PPI buffer on finalization

The PPI buffer is allocated with qemu_memalign() in instance_init but
never freed when the device is destroyed.

Fixes: 46cd2c1050f0 ("hw/tpm: add PPI support to tpm-tis-device for ARM64 virt")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
2 weeks agohw/i386/pc: free pcspk on finalization
Marc-André Lureau [Mon, 27 Apr 2026 11:00:46 +0000 (15:00 +0400)] 
hw/i386/pc: free pcspk on finalization

Add pc_machine_finalize() to unref the pcspk device when it was never
realized. Once realized, the bus owns it and no action is needed.

Fixes: 6b8d1416482f ("audio: create pcspk device early")
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agohw/i386/nitro_enclave: add instance finalize
Marc-André Lureau [Mon, 27 Apr 2026 10:52:50 +0000 (14:52 +0400)] 
hw/i386/nitro_enclave: add instance finalize

Property setter strings (vsock, id, parent_role, parent_id) were
never freed because nitro_enclave_machine_info had no
instance_finalize.

Fixes: f1826463d2e8 ("machine/nitro-enclave: New machine type for AWS Nitro Enclaves")
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agotarget/i386/kvm/tdx: free strings in tdx_guest_finalize
Marc-André Lureau [Mon, 27 Apr 2026 10:52:07 +0000 (14:52 +0400)] 
target/i386/kvm/tdx: free strings in tdx_guest_finalize

tdx_guest_finalize was empty, so mrconfigid, mrowner, and
mrownerconfig set by property setters were never freed.

Fixes: d05a0858cf87 ("i386/tdx: Support user configurable mrconfigid/mrowner/mrownerconfig")
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agotarget/i386/sev: add finalize functions and fix leaking setters
Marc-André Lureau [Mon, 27 Apr 2026 10:48:06 +0000 (14:48 +0400)] 
target/i386/sev: add finalize functions and fix leaking setters

None of the three SEV types (sev-common, sev-guest, sev-snp-guest)
had instance_finalize functions, so all string fields allocated
during init or by property setters were leaked on object destruction.

Add sev_common_finalize, sev_guest_finalize, and
sev_snp_guest_finalize to free the allocated fields.

Also fix sev_common_set_sev_device, sev_guest_set_dh_cert_file,
and sev_guest_set_session_file to free the old value before
replacing it.

Fixes: a9b4942f485 ("target/i386: add Secure Encrypted
       Virtualization (SEV) object")
Fixes: 7b34df44260 ("i386/sev: Introduce 'sev-snp-guest' object")
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agonet/filter: free old values in property setters
Marc-André Lureau [Mon, 27 Apr 2026 10:47:51 +0000 (14:47 +0400)] 
net/filter: free old values in property setters

netfilter_set_position and netfilter_set_netdev_id overwrote their
respective fields with g_strdup without freeing the previous value,
leaking memory on each property write.

Fixes: fdccce459621 ("init/cleanup of netfilter object")
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agohw/core/machine: free shim_filename on finalization
Marc-André Lureau [Mon, 27 Apr 2026 10:47:34 +0000 (14:47 +0400)] 
hw/core/machine: free shim_filename on finalization

machine_set_shim allocates shim_filename via g_strdup, but
machine_finalize did not free it.

Fixes: a5bd044b1579 ("x86/loader: add -shim option")
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agosystem/ioport: minor code simplification
Marc-André Lureau [Mon, 4 May 2026 06:32:07 +0000 (10:32 +0400)] 
system/ioport: minor code simplification

Drop needless memset() and replace g_malloc0() with g_new().

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agobackends/cryptodev-lkcf: skip cleanup when not initialized
Marc-André Lureau [Fri, 24 Apr 2026 21:00:35 +0000 (01:00 +0400)] 
backends/cryptodev-lkcf: skip cleanup when not initialized

cryptodev_lkcf_cleanup() locks a mutex that is only initialized
during the init vfunc (called at realize time). When the backend
is destroyed without ever being realized, the mutex is uninitialized
and the lock aborts.

Return early from cleanup when the backend was never started.

Note: it looks like cryptodev init/cleanup callbacks should rather be
regular complete/finalize overrides (calling the parent method).

Fixes: 39fff6f3e8b3 ("cryptodev: Add a lkcf-backend for cryptodev")
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agohw/intc/apic: move checks to realize()
Marc-André Lureau [Fri, 24 Apr 2026 21:00:23 +0000 (01:00 +0400)] 
hw/intc/apic: move checks to realize()

apic_common_set_id() dereferences s->cpu to check for x2APIC support
when the APIC ID is >= 255. On a standalone APIC object that has not
been attached to a CPU, s->cpu is NULL, causing a segfault.

To solve this, move validation during realize().

Fixes: b5ee0468e9d2 ("apic: add support for x2APIC mode")
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agohw/xlnx_dp: reject NULL 'dpdma' property rather than crash
Marc-André Lureau [Sun, 3 May 2026 07:53:12 +0000 (11:53 +0400)] 
hw/xlnx_dp: reject NULL 'dpdma' property rather than crash

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agohw/ipmi: reject NULL 'bmc' property rather than crash
Marc-André Lureau [Sun, 3 May 2026 07:53:12 +0000 (11:53 +0400)] 
hw/ipmi: reject NULL 'bmc' property rather than crash

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agohw/pci-host/q35: handle NULL bus in pci-hole64 getters
Marc-André Lureau [Fri, 24 Apr 2026 15:04:58 +0000 (19:04 +0400)] 
hw/pci-host/q35: handle NULL bus in pci-hole64 getters

When called on an unrealized Q35 host bridge (e.g. from
qmp_qom_list_properties), h->bus is NULL since the root bus is only
created during realize. Guard against this in both the
pci_hole64_start and pci_hole64_end getters.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agohw/pci-host/i440fx: handle NULL bus in pci-hole64 getters
Marc-André Lureau [Fri, 24 Apr 2026 15:04:53 +0000 (19:04 +0400)] 
hw/pci-host/i440fx: handle NULL bus in pci-hole64 getters

When called on an unrealized i440FX host bridge (e.g. from
qmp_qom_list_properties), h->bus is NULL since the root bus is only
created during realize. Guard against this in both
pci_hole64_start and pci_hole64_end getters, reporting an error.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 weeks agohw/pci-bridge: handle missing parent in prop_pxb_uid_get
Marc-André Lureau [Fri, 24 Apr 2026 15:04:47 +0000 (19:04 +0400)] 
hw/pci-bridge: handle missing parent in prop_pxb_uid_get

When called on an unrealized pxb bus (e.g. from
qmp_qom_list_properties), bus->parent_dev is NULL. The pxb_bus_num()
callback dereferences it unconditionally. Check for this to avoid a
NULL dereference.

Fixes: 97b9cb066e5f ("hw/pci-bridge: Add acpi_uid property to TYPE_PXB_BUS")
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agochardev/char-socket: handle NULL addr in char_socket_get_addr
Marc-André Lureau [Fri, 24 Apr 2026 15:04:41 +0000 (19:04 +0400)] 
chardev/char-socket: handle NULL addr in char_socket_get_addr

When called on an unrealized chardev (e.g. from
qmp_qom_list_properties), s->addr is NULL. Return an error instead of
assert().

Fixes: 123676e9894f ("char-socket: add 'addr' property")
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agohw/pci: handle missing bus in prop_pci_busnr_get
Marc-André Lureau [Fri, 24 Apr 2026 15:04:35 +0000 (19:04 +0400)] 
hw/pci: handle missing bus in prop_pci_busnr_get

When called on an unrealized device (e.g. from
qmp_qom_list_properties), pci_get_bus() returns NULL since the device
has no parent bus. Check for this to avoid a NULL dereference in
pci_bus_num().

Fixes: df9ac7254fd9 ("hw/pci: Add a busnr property to pci_props and use for acpi/gi")
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 weeks agobuildsys: Stop checking for ESA/390 host
Philippe Mathieu-Daudé [Tue, 19 May 2026 17:12:39 +0000 (19:12 +0200)] 
buildsys: Stop checking for ESA/390 host

We still build QEMU tools on 32-bit hosts (see commit
cf634dfcd8f), however no OS supported by QEMU still runs
on ESA/390 (Linux dropped support in release 4.1 in 2015).

Remove the configure check, directly checking for the 64-bit
z/Architecture.

Also per commit 3704993f545 from 2020:

  "we don't support s390, only 64-bit s390x hosts".

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260519171240.97420-4-philmd@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2 weeks agoMAINTAINERS: Fix tcg/s390x/ path
Philippe Mathieu-Daudé [Tue, 19 May 2026 17:12:38 +0000 (19:12 +0200)] 
MAINTAINERS: Fix tcg/s390x/ path

This folder was renamed in commit 3704993f545 ("tcg/s390x: Rename
from tcg/s390").

Reported-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260519171240.97420-3-philmd@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2 weeks agoMAINTAINERS: Fix s390x storage key/attribute device paths
Philippe Mathieu-Daudé [Tue, 19 May 2026 17:12:37 +0000 (19:12 +0200)] 
MAINTAINERS: Fix s390x storage key/attribute device paths

Fixes: 56e34834029 ("MAINTAINERS: split out s390x sections")
Reported-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260519171240.97420-2-philmd@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2 weeks agos390x/pci: Fix interrupt forwarding disable for interpreted devices
Farhan Ali [Thu, 21 May 2026 18:29:46 +0000 (11:29 -0700)] 
s390x/pci: Fix interrupt forwarding disable for interpreted devices

Remove the FH_MASK_ENABLE check when disabling interrupt forwarding
during device reset. This check was broken for the default case in
the switch statement above, preventing proper cleanup of interrupt
forwarding.

The pbdev->aif check in s390_pci_kvm_aif_disable() already guards
against double-disabling of interrupt forwarding.

Cc: qemu-stable@nongnu.org
Reported-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Omar Elghoul <oelghoul@linux.ibm.com>
Message-ID: <20260521182946.1607-1-alifm@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2 weeks agohw/s390x/ccw: Mark virtio-pci disable-legacy property as optional
Jaehoon Kim [Wed, 20 May 2026 18:33:58 +0000 (13:33 -0500)] 
hw/s390x/ccw: Mark virtio-pci disable-legacy property as optional

The s390-ccw-virtio-11.0 compatibility property for TYPE_VIRTIO_PCI
"disable-legacy" causes QEMU to abort when instantiating
vhost-user-fs-pci devices:

  Unexpected error in object_property_find_err() at
  ../qom/object.c:1284:
  qemu-system-s390x: -device vhost-user-fs-pci: can't apply
  global virtio-pci.disable-legacy=off: Property
  'vhost-user-fs-pci.disable-legacy' not found

The issue occurs because some vhost-user devices like
vhost-user-fs-pci only implement the non-transitional variant
and do not define a generic device type. Non-transitional
devices have disable-legacy hardcoded to "on" and do not
expose it as a property, while only generic device types have
the "disable-legacy" property. This affects users running
older machine versions (11.0 and earlier) even when using the
latest QEMU version.

Mark the global property as optional so it only applies to
devices that actually have the property, allowing vhost-user
devices without a generic variant to be instantiated
successfully on older machine versions.

Fixes: 26103c13cff0 ("hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+)")
Signed-off-by: Jaehoon Kim <jhkim@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-ID: <20260520183403.223983-1-jhkim@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2 weeks agotarget/s390x: Make container ids in SysIB_15x 1-based
Alexandra Winter [Mon, 11 May 2026 13:49:09 +0000 (15:49 +0200)] 
target/s390x: Make container ids in SysIB_15x 1-based

The Container Id in a container-type TLE of SysIB_15x is defined as 8-bit
unsigned nonzero integer. Make stsi fc 15 emulation architecture compliant,
by starting the container ids at 1 for the lowest numbered container.

The qemu misbehaviour without this patch becomes obvious due to a recently
proposed kernel fix. Older linux kernels pass the container ids from stsi
fc15 unchanged to sysfs, i.e. starting at 1 on s390 hardware. This resulted
in off-by-one values when compared to the values from HMC. A Linux kernel
fix is being proposed to correct the sysfs topology ids by -1, so they
start at 0, e.g. when displayed by 'lscpu -ye'. In case a KVM guest with a
fixed kernel runs on a host with a qemu without this fix, this can result
in container ids erroneously being shown as 255.
Example (Fixed guest on unfixed qemu):
$ lscpu -ye
CPU NODE DRAWER BOOK SOCKET CORE L1d:L1i:L2 ONLINE CONFIGURED POLARIZATION ADDRESS
  0    0    255  255    255    0 0:0:0         yes yes        vert-medium  0
  1    0    255  255      0    1 1:1:1         yes yes        vert-medium  1
After this fix:
$ lscpu -ye
CPU NODE DRAWER BOOK SOCKET CORE L1d:L1i:L2 ONLINE CONFIGURED POLARIZATION ADDRESS
  0    0      0    0      0    0 0:0:0         yes yes        vert-medium  0
  1    0      0    0      1    1 1:1:1         yes yes        vert-medium  1

Fixes: f4f54b582f ("target/s390x/cpu topology: handle STSI(15) and build the SYSIB")
Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Acked-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Gautam Gala <ggala@linux.ibm.com>
Message-ID: <20260511134909.43802-1-wintera@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2 weeks agohw/s390x: Fix memory leaks after removing elements with QTAILQ_REMOVE
Thomas Huth [Mon, 11 May 2026 06:38:25 +0000 (08:38 +0200)] 
hw/s390x: Fix memory leaks after removing elements with QTAILQ_REMOVE

The elements that get removed with QTAILQ_REMOVE are never referenced
afterwards anymore, so the corresponding memory should get freed.

Fixes: 37fa32de70 ("s390x/pci: Honor DMA limits set by vfio")
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-ID: <20260511063825.53633-1-thuth@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2 weeks agolcitool: remove Cirrus CI support
Stefan Hajnoczi [Tue, 2 Jun 2026 16:24:55 +0000 (12:24 -0400)] 
lcitool: remove Cirrus CI support

Remove GitLab CI integration for Cirrus CI now that nothing uses it
anymore.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20260602162457.828969-3-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 weeks agogitlab: remove x64-freebsd-14-build Cirrus job
Stefan Hajnoczi [Tue, 2 Jun 2026 16:24:54 +0000 (12:24 -0400)] 
gitlab: remove x64-freebsd-14-build Cirrus job

Cirrus has shut down and the x64-freebsd-14-build is failing:
https://gitlab.com/qemu-project/qemu/-/jobs/14656732122

Remove the x64-freebsd-14-build job to get the CI pipeline passing
again. The next commit will be to remove Cirrus integration from the
GitLab YAML and lcitool since it is no longer used.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@mailo.com>
Message-id: 20260602162457.828969-2-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 weeks agotests/unit: add test-envlist covering setenv/unsetenv name matching
Denis V. Lunev [Wed, 20 May 2026 21:26:28 +0000 (23:26 +0200)] 
tests/unit: add test-envlist covering setenv/unsetenv name matching

util/envlist had no test coverage. Add tests/unit/test-envlist
exercising the public envlist API and pinning down the prefix-match
hazard fixed in the previous commit:

  - envlist_unsetenv("FOO") must not remove an entry named "FOOBAR";
  - envlist_setenv("FOO=...") must not replace an existing "FOOBAR=..."
    entry placed earlier in the list (envlist_setenv() inserts at the
    head, so the first prefix match wins under the old strncmp rule).

Also cover the rest of the contract: head-insertion order observed
through envlist_to_environ(), replacement of an existing variable,
the count argument of envlist_to_environ(), and the documented EINVAL
paths (NULL inputs, setenv without '=', unsetenv with '=').

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20260520212628.479772-3-den@openvz.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 weeks agoutil/envlist: fix prefix-match in envlist_unsetenv() name lookup
Denis V. Lunev [Wed, 20 May 2026 21:26:27 +0000 (23:26 +0200)] 
util/envlist: fix prefix-match in envlist_unsetenv() name lookup

envlist_unsetenv() looked up the entry to remove with
strncmp(entry->ev_var, env, strlen(env)). The comparison length is
the requested name's length, so any stored entry whose name *starts*
with that name compares equal. envlist_setenv() inserts at the head
of the list, so the first hit wins: with FOO=... stored first and
FOOBAR=... stored afterward, envlist_unsetenv("FOO") iterates from
the head, matches FOOBAR=... on the prefix, and drops it instead of
FOO=...

linux-user and bsd-user reach this code via the -U command-line
switch, so the bug is reachable from a normal qemu-user invocation.

envlist_setenv() used the same strncmp pattern but with
envname_len = (eq_sign - env + 1), so the '=' byte sat inside the
compared window and acted as an implicit boundary. setenv was
therefore not buggy -- but the safety lived in the byte layout of
ev_var rather than in the entry, so a future edit could easily
drift the two sites apart again.

Store the name length on each entry at insertion time and compare
with explicit length equality plus memcmp via a small helper. Use
the helper at both lookup sites so the boundary becomes a
structural property of the entry: envlist_unsetenv() stops
prefix-matching, and envlist_setenv()'s self-search no longer
depends on the '=' byte serving as a sentinel.

Fixes: 04a6dfebb6b5 ("linux-user: Add generic env variable handling")
Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20260520212628.479772-2-den@openvz.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 weeks agohw/cxl/events: Fix handling of component ID in event records generation to not assume...
Shiju Jose [Fri, 6 Mar 2026 10:14:22 +0000 (10:14 +0000)] 
hw/cxl/events: Fix handling of component ID in event records generation to not assume it is a string

Fix handling of component ID in event records generation to not assume it
is a string. Component ID in CXL events is 16 bytes data, but event record
generation copy 15 bytes only from the qmp "component-id" field using
strncpy. Replace strncpy with memcpy and copy the entire component ID
data.

Fixes: ea9b6d647f2f("hw/cxl/events: Add injection of General Media Events")
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260306101423.986-4-shiju.jose@huawei.com>

2 weeks agohw/cxl: Add fixes in Post Package Repair (PPR)
Shiju Jose [Fri, 6 Mar 2026 10:14:21 +0000 (10:14 +0000)] 
hw/cxl: Add fixes in Post Package Repair (PPR)

Add following fixes to the commit: hw/cxl: Add support for Maintenance
command and Post Package Repair (PPR).

In cxl_perform_ppr(), remove and free the maintenance entry from QLIST
if match is found and PPR operation is performed.

Fixes: 5e5a86bab830("hw/cxl: Add support for Maintenance command and Post Package Repair (PPR)")
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260306101423.986-3-shiju.jose@huawei.com>

2 weeks agohw/cxl: Fix handling of component ID to not assume it is a string
Shiju Jose [Fri, 6 Mar 2026 10:14:20 +0000 (10:14 +0000)] 
hw/cxl: Fix handling of component ID to not assume it is a string

Add following fixes,
1. Coverity reports a warning (CID 1645325) for use of strncpy() in
handling of component ID. In cxl_create_mem_sparing_event_records(),
fix handling of component ID to not assume it is a string by replacing
strncpy with memcpy to solve this warning and copy the entire component
ID data, which is 16 bytes.

2. In cxl_maintenance_insert(),
 - replace strncpy with memcpy to copy full data because component ID,
   which is 16 bytes data.
 - remove memset which is not required.

Closes ("https://lore.kernel.org/qemu-devel/CAFEAcA_CsVe4TUVm3o_-BA4hXvi2xAThGX5T97amgTQKW_kiYA@mail.gmail.com/")

Fixes: 5e5a86bab830("hw/cxl: Add support for Maintenance command and Post Package Repair (PPR)")
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260306101423.986-2-shiju.jose@huawei.com>

2 weeks agovhost-user.rst: fix typo
Alexandr Moshkov [Mon, 30 Mar 2026 09:52:22 +0000 (14:52 +0500)] 
vhost-user.rst: fix typo

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
Reviewed-by: Raphael Norwitz <rnorwitz@nvidia.com>
Message-Id: <20260330095226.158386-2-dtalexundeer@yandex-team.ru>

2 weeks agovhost-user-device: Add shared memory BAR
Albert Esteve [Wed, 4 Mar 2026 16:52:23 +0000 (17:52 +0100)] 
vhost-user-device: Add shared memory BAR

Add shared memory BAR support to vhost-user-device-pci
to enable direct file mapping for VIRTIO Shared
Memory Regions.

The implementation creates a consolidated shared
memory BAR that contains all VIRTIO Shared
Memory Regions as subregions. Each region is
configured with its proper shmid, size, and
offset within the BAR. The number and size of
regions are retrieved via VHOST_USER_GET_SHMEM_CONFIG
message sent by vhost-user-base during realization
after virtio_init().

Specifically, it uses BAR 4 to avoid conflicts, as
it is currently unused.

The shared memory BAR is only created when the
backend supports VHOST_USER_PROTOCOL_F_SHMEM and
has configured shared memory regions. This maintains
backward compatibility with backends that do not
support shared memory functionality.

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260304165223.2166175-8-aesteve@redhat.com>

2 weeks agoqmp: add shmem feature map
Albert Esteve [Wed, 4 Mar 2026 16:52:22 +0000 (17:52 +0100)] 
qmp: add shmem feature map

Add new vhost-user protocol
VHOST_USER_PROTOCOL_F_SHMEM feature to
feature map.

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260304165223.2166175-7-aesteve@redhat.com>

2 weeks agovhost_user.rst: Add GET_SHMEM_CONFIG message
Albert Esteve [Wed, 4 Mar 2026 16:52:21 +0000 (17:52 +0100)] 
vhost_user.rst: Add GET_SHMEM_CONFIG message

Add GET_SHMEM_CONFIG vhost-user frontend
message to the spec documentation.

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Alyssa Ross <hi@alyssa.is>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260304165223.2166175-6-aesteve@redhat.com>

2 weeks agovhost_user: Add frontend get_shmem_config command
Albert Esteve [Wed, 4 Mar 2026 16:52:20 +0000 (17:52 +0100)] 
vhost_user: Add frontend get_shmem_config command

The frontend can use this command to retrieve
VirtIO Shared Memory Regions configuration from
the backend. The response contains the number of
shared memory regions, their size, and shmid.

This is useful when the frontend is unaware of
specific backend type and configuration,
for example, in the `vhost-user-device` case.

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260304165223.2166175-5-aesteve@redhat.com>

2 weeks agovhost_user.rst: Add SHMEM_MAP/_UNMAP to spec
Albert Esteve [Wed, 4 Mar 2026 16:52:19 +0000 (17:52 +0100)] 
vhost_user.rst: Add SHMEM_MAP/_UNMAP to spec

Add SHMEM_MAP/_UNMAP request to the vhost-user
spec documentation.

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Alyssa Ross <hi@alyssa.is>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260304165223.2166175-4-aesteve@redhat.com>

2 weeks agovhost_user.rst: Align VhostUserMsg excerpt members
Albert Esteve [Wed, 4 Mar 2026 16:52:18 +0000 (17:52 +0100)] 
vhost_user.rst: Align VhostUserMsg excerpt members

Add missing members to the VhostUserMsg excerpt in
the vhost-user spec documentation.

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260304165223.2166175-3-aesteve@redhat.com>

2 weeks agovhost-user: Add VirtIO Shared Memory map request
Albert Esteve [Wed, 4 Mar 2026 16:52:17 +0000 (17:52 +0100)] 
vhost-user: Add VirtIO Shared Memory map request

Add SHMEM_MAP/UNMAP requests to vhost-user for dynamic management of
VIRTIO Shared Memory mappings.

This implementation introduces VirtioSharedMemoryMapping as a unified
QOM object that manages both the mapping metadata and MemoryRegion
lifecycle. This object provides reference-counted lifecycle management
with automatic cleanup of file descriptors and memory regions
through QOM finalization.

This request allows backends to dynamically map file descriptors into a
VIRTIO Shared Memory Region identified by their shmid. Maps are created
using memory_region_init_ram_from_fd() with configurable read/write
permissions, and the resulting MemoryRegions are added as subregions to
the shmem container region. The mapped memory is then advertised to the
guest VIRTIO drivers as a base address plus offset for reading and
writting according to the requested mmap flags.

The backend can unmap memory ranges within a given VIRTIO Shared Memory
Region to free resources. Upon receiving this message, the frontend
removes the MemoryRegion as a subregion and automatically unreferences
the VirtioSharedMemoryMapping object, triggering cleanup if no other
references exist.

Error handling has been improved to ensure consistent behavior across
handlers that manage their own vhost_user_send_resp() calls. Since
these handlers clear the VHOST_USER_NEED_REPLY_MASK flag, explicit
error checking ensures proper connection closure on failures,
maintaining the expected error flow.

Note the memory region commit for these operations needs to be delayed
until after we reply to the backend to avoid deadlocks. Otherwise,
the MemoryListener would send a VHOST_USER_SET_MEM_TABLE message
before the reply.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260304165223.2166175-2-aesteve@redhat.com>

2 weeks agotests: acpi: x86/q35: update expected WDAT blob
Igor Mammedov [Tue, 3 Mar 2026 09:25:17 +0000 (10:25 +0100)] 
tests: acpi: x86/q35: update expected WDAT blob

replace blank table with a new one:

  +[000h 0000   4]                    Signature : "WDAT"    [Watchdog Action Table]
  +[004h 0004   4]                 Table Length : 00000134
  +[008h 0008   1]                     Revision : 01
  +[009h 0009   1]                     Checksum : 31
  +[00Ah 0010   6]                       Oem ID : "BOCHS "
  +[010h 0016   8]                 Oem Table ID : "BXPC    "
  +[018h 0024   4]                 Oem Revision : 00000001
  +[01Ch 0028   4]              Asl Compiler ID : "BXPC"
  +[020h 0032   4]        Asl Compiler Revision : 00000001
  +
  +[024h 0036   4]                Header Length : 00000020
  +[028h 0040   2]                  PCI Segment : 00FF
  +[02Ah 0042   1]                      PCI Bus : FF
  +[02Bh 0043   1]                   PCI Device : FF
  +[02Ch 0044   1]                 PCI Function : FF
  +[02Dh 0045   3]                     Reserved : 000000
  +[030h 0048   4]                 Timer Period : 00000258
  +[034h 0052   4]                    Max Count : 000003FF
  +[038h 0056   4]                    Min Count : 00000004
  +[03Ch 0060   1]        Flags (decoded below) : 81
  +                                     Enabled : 1
  +                         Stopped When Asleep : 1
  +[03Dh 0061   3]                     Reserved : 000000
  +[040h 0064   4]         Watchdog Entry Count : 0000000A
  +
  +[044h 0068   1]              Watchdog Action : 01
  +[045h 0069   1]                  Instruction : 02
  +[046h 0070   2]                     Reserved : 0000
  +
  +[048h 0072  12]              Register Region : [Generic Address Structure]
  +[048h 0072   1]                     Space ID : 01 [SystemIO]
  +[049h 0073   1]                    Bit Width : 10
  +[04Ah 0074   1]                   Bit Offset : 00
  +[04Bh 0075   1]         Encoded Access Width : 02 [Word Access:16]
  +[04Ch 0076   8]                      Address : 0000000000000660
  +
  +[054h 0084   4]                        Value : 00000001
  +[058h 0088   4]                Register Mask : 000001FF
  +
  +[05Ch 0092   1]              Watchdog Action : 08
  +[05Dh 0093   1]                  Instruction : 00
  +[05Eh 0094   2]                     Reserved : 0000
  +
  +[060h 0096  12]              Register Region : [Generic Address Structure]
  +[060h 0096   1]                     Space ID : 01 [SystemIO]
  +[061h 0097   1]                    Bit Width : 10
  +[062h 0098   1]                   Bit Offset : 00
  +[063h 0099   1]         Encoded Access Width : 02 [Word Access:16]
  +[064h 0100   8]                      Address : 0000000000000668
  +
  +[06Ch 0108   4]                        Value : 00000000
  +[070h 0112   4]                Register Mask : 00000800
  +
  +[074h 0116   1]              Watchdog Action : 09
  +[075h 0117   1]                  Instruction : 82
  +[076h 0118   2]                     Reserved : 0000
  +
  +[078h 0120  12]              Register Region : [Generic Address Structure]
  +[078h 0120   1]                     Space ID : 01 [SystemIO]
  +[079h 0121   1]                    Bit Width : 10
  +[07Ah 0122   1]                   Bit Offset : 00
  +[07Bh 0123   1]         Encoded Access Width : 02 [Word Access:16]
  +[07Ch 0124   8]                      Address : 0000000000000668
  +
  +[084h 0132   4]                        Value : 00000000
  +[088h 0136   4]                Register Mask : 00000800
  +
  +[08Ch 0140   1]              Watchdog Action : 0A
  +[08Dh 0141   1]                  Instruction : 00
  +[08Eh 0142   2]                     Reserved : 0000
  +
  +[090h 0144  12]              Register Region : [Generic Address Structure]
  +[090h 0144   1]                     Space ID : 01 [SystemIO]
  +[091h 0145   1]                    Bit Width : 10
  +[092h 0146   1]                   Bit Offset : 00
  +[093h 0147   1]         Encoded Access Width : 02 [Word Access:16]
  +[094h 0148   8]                      Address : 0000000000000668
  +
  +[09Ch 0156   4]                        Value : 00000800
  +[0A0h 0160   4]                Register Mask : 00000800
  +
  +[0A4h 0164   1]              Watchdog Action : 0B
  +[0A5h 0165   1]                  Instruction : 82
  +[0A6h 0166   2]                     Reserved : 0000
  +
  +[0A8h 0168  12]              Register Region : [Generic Address Structure]
  +[0A8h 0168   1]                     Space ID : 01 [SystemIO]
  +[0A9h 0169   1]                    Bit Width : 10
  +[0AAh 0170   1]                   Bit Offset : 00
  +[0ABh 0171   1]         Encoded Access Width : 02 [Word Access:16]
  +[0ACh 0172   8]                      Address : 0000000000000668
  +
  +[0B4h 0180   4]                        Value : 00000800
  +[0B8h 0184   4]                Register Mask : 00000800
  +
  +[0BCh 0188   1]              Watchdog Action : 06
  +[0BDh 0189   1]                  Instruction : 03
  +[0BEh 0190   2]                     Reserved : 0000
  +
  +[0C0h 0192  12]              Register Region : [Generic Address Structure]
  +[0C0h 0192   1]                     Space ID : 01 [SystemIO]
  +[0C1h 0193   1]                    Bit Width : 10
  +[0C2h 0194   1]                   Bit Offset : 00
  +[0C3h 0195   1]         Encoded Access Width : 02 [Word Access:16]
  +[0C4h 0196   8]                      Address : 0000000000000672
  +
  +[0CCh 0204   4]                        Value : 00000000
  +[0D0h 0208   4]                Register Mask : 000003FF
  +
  +[0D4h 0212   1]              Watchdog Action : 05
  +[0D5h 0213   1]                  Instruction : 01
  +[0D6h 0214   2]                     Reserved : 0000
  +
  +[0D8h 0216  12]              Register Region : [Generic Address Structure]
  +[0D8h 0216   1]                     Space ID : 01 [SystemIO]
  +[0D9h 0217   1]                    Bit Width : 10
  +[0DAh 0218   1]                   Bit Offset : 00
  +[0DBh 0219   1]         Encoded Access Width : 02 [Word Access:16]
  +[0DCh 0220   8]                      Address : 0000000000000672
  +
  +[0E4h 0228   4]                        Value : 00000000
  +[0E8h 0232   4]                Register Mask : 000003FF
  +
  +[0ECh 0236   1]              Watchdog Action : 20
  +[0EDh 0237   1]                  Instruction : 00
  +[0EEh 0238   2]                     Reserved : 0000
  +
  +[0F0h 0240  12]              Register Region : [Generic Address Structure]
  +[0F0h 0240   1]                     Space ID : 01 [SystemIO]
  +[0F1h 0241   1]                    Bit Width : 10
  +[0F2h 0242   1]                   Bit Offset : 00
  +[0F3h 0243   1]         Encoded Access Width : 02 [Word Access:16]
  +[0F4h 0244   8]                      Address : 0000000000000666
  +
  +[0FCh 0252   4]                        Value : 00000002
  +[100h 0256   4]                Register Mask : 00000002
  +
  +[104h 0260   1]              Watchdog Action : 21
  +[105h 0261   1]                  Instruction : 82
  +[106h 0262   2]                     Reserved : 0000
  +
  +[108h 0264  12]              Register Region : [Generic Address Structure]
  +[108h 0264   1]                     Space ID : 01 [SystemIO]
  +[109h 0265   1]                    Bit Width : 10
  +[10Ah 0266   1]                   Bit Offset : 00
  +[10Bh 0267   1]         Encoded Access Width : 02 [Word Access:16]
  +[10Ch 0268   8]                      Address : 0000000000000666
  +
  +[114h 0276   4]                        Value : 00000002
  +[118h 0280   4]                Register Mask : 00000002
  +
  +[11Ch 0284   1]              Watchdog Action : 21
  +[11Dh 0285   1]                  Instruction : 82
  +[11Eh 0286   2]                     Reserved : 0000
  +
  +[120h 0288  12]              Register Region : [Generic Address Structure]
  +[120h 0288   1]                     Space ID : 01 [SystemIO]
  +[121h 0289   1]                    Bit Width : 10
  +[122h 0290   1]                   Bit Offset : 00
  +[123h 0291   1]         Encoded Access Width : 02 [Word Access:16]
  +[124h 0292   8]                      Address : 0000000000000666
  +
  +[12Ch 0300   4]                        Value : 00000004
  +[130h 0304   4]                Register Mask : 00000004

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Ani Sinha <anisinha@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260303092532.2410177-7-imammedo@redhat.com>

2 weeks agotests: acpi: x86/q35: add WDAT table test case
Igor Mammedov [Tue, 3 Mar 2026 09:25:16 +0000 (10:25 +0100)] 
tests: acpi: x86/q35: add WDAT table test case

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Ani Sinha <anisinha@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260303092532.2410177-6-imammedo@redhat.com>

2 weeks agotests: acpi: x86/q35: whitelist new WDAT table
Igor Mammedov [Tue, 3 Mar 2026 09:25:15 +0000 (10:25 +0100)] 
tests: acpi: x86/q35: whitelist new WDAT table

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Ani Sinha <anisinha@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260303092532.2410177-5-imammedo@redhat.com>

2 weeks agox86: q35: generate WDAT ACPI table
Igor Mammedov [Tue, 3 Mar 2026 09:25:14 +0000 (10:25 +0100)] 
x86: q35: generate WDAT ACPI table

It will generate WDAT table [1] customized for TCO watchdog.
This allows Windows guests (Windows Server 2008/Vista+) to
use TCO watchdog using built-in generic driver, which
alleviates need to install vendor specific drivers.

Given that enabling it might change guest behaviour
(both Windows/Linux) the feature is disabled by default.

Users that need it can enable the feature with
following CLI option.
    -machine wdat=on

1)
   "Hardware Watchdog Timers Design Specification"
    https://uefi.org/acpi 'Watchdog Action Table (WDAT)'

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Ani Sinha <anisinha@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260303092532.2410177-4-imammedo@redhat.com>

2 weeks agox86: q35: add 'wdat' property
Igor Mammedov [Tue, 3 Mar 2026 09:25:13 +0000 (10:25 +0100)] 
x86: q35: add 'wdat' property

Used for enabling WDAT based watchdog for builtin iTCO watchdog.
Usage:
    -M q35,wdat={on|off}
By default it is disabled.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ani Sinha <anisinha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260303092532.2410177-3-imammedo@redhat.com>

2 weeks agoacpi: add API to build WDAT instructions
Igor Mammedov [Tue, 3 Mar 2026 09:25:12 +0000 (10:25 +0100)] 
acpi: add API to build WDAT instructions

Add definitions for WDAT[1] actions/instructions
and build_append_wdat_ins() API to build table entries.

1)
"Hardware Watchdog Timers Design Specification"
  https://uefi.org/acpi 'Watchdog Action Table (WDAT)'

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Ani Sinha <anisinha@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260303092532.2410177-2-imammedo@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2 weeks agohw/i386/pc: Add a proper owner for the ioport memory regions
Thomas Huth [Tue, 17 Feb 2026 14:18:27 +0000 (15:18 +0100)] 
hw/i386/pc: Add a proper owner for the ioport memory regions

Without a proper owner, the memory regions show up in /machine/unattached
in the QOM tree, which is something that should be avoided.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260217141827.534426-1-thuth@redhat.com>

2 weeks agovirtio-rtc: Add basic virtio-rtc support
Kuan-Wei Chiu [Sat, 28 Feb 2026 18:22:46 +0000 (18:22 +0000)] 
virtio-rtc: Add basic virtio-rtc support

Introduce the core device and PCI bindings for the virtio-rtc device
(VIRTIO_ID_CLOCK).

This implementation provides a read-only clock that returns the host's
time (QEMU_CLOCK_HOST) to the guest. It handles fundamental control
requests, reporting a single supported clock of type
VIRTIO_RTC_CLOCK_UTC, and responds to standard read requests.

- Virtio RTC Spec:
https://github.com/oasis-tcs/virtio-spec/tree/master/device-types/rtc
- Linux Virtio RTC driver:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/virtio/virtio_rtc_driver.c?h=v7.0-rc1

Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260228182246.700714-3-visitorckw@gmail.com>

2 weeks agostandard-headers: Add virtio_rtc.h from Linux 7.0-rc1
Kuan-Wei Chiu [Sat, 28 Feb 2026 18:22:45 +0000 (18:22 +0000)] 
standard-headers: Add virtio_rtc.h from Linux 7.0-rc1

Add virtio_rtc.h from the upstream Linux kernel using
scripts/update-linux-headers.sh.

Source:
- Linux commit 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f (v7.0-rc1)
- Author: Linus Torvalds <torvalds@linux-foundation.org>
- Date:   Sun Feb 22 13:18:59 2026 -0800

Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260228182246.700714-2-visitorckw@gmail.com>

2 weeks agoamd_iommu: Generate XT interrupts when xt support is enabled
Sairaj Kodilkar [Mon, 2 Mar 2026 11:51:30 +0000 (17:21 +0530)] 
amd_iommu: Generate XT interrupts when xt support is enabled

When MMIO 0x18[IntCapXTEn]=1, interrupts originating from the IOMMU itself are
sent based on the programming in XT IOMMU Interrupt Control Registers in MMIO
0x170-0x180 instead of the programming in the IOMMU's MSI capability registers.
The guest programs these registers with appropriate vector and destination
ID instead of writing to PCI MSI capability.

Current AMD vIOMMU is capable of generating interrupts only through PCI
MSI capability and does not care about xt mode. Because of this AMD
vIOMMU cannot generate event log interrupts when the guest has enabled
xt mode.

Introduce a new flag "intcapxten" which is set when guest writes control
register [IntCapXTEn] (bit 51) and use vector and destination field in
the XT MMIO register (0x170) to support XT mode.

Signed-off-by: Sairaj Kodilkar <sarunkod@amd.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260302115130.5903-4-sarunkod@amd.com>

2 weeks agoamd_iommu: Turn on XT support only when guest has enabled it
Sairaj Kodilkar [Mon, 2 Mar 2026 11:51:29 +0000 (17:21 +0530)] 
amd_iommu: Turn on XT support only when guest has enabled it

Current code uses 32 bit destination ID irrespective of the fact that
guest has enabled x2APIC support through control register[XTEn] and
completely depends on command line parameter xtsup=on. This is not a
correct hardware behaviour and can cause problems in the guest which has
not enabled XT mode.

Introduce new flag "xten", which is enabled when guest writes 1 to the
control register bit 50 (XTEn). Also, add a new subsection in
`VMStateDescription` for backward compatibility during vm migration.

Signed-off-by: Sairaj Kodilkar <sarunkod@amd.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260302115130.5903-3-sarunkod@amd.com>

2 weeks agoamd_iommu: Use switch case to determine mmio register name
Sairaj Kodilkar [Mon, 2 Mar 2026 11:51:28 +0000 (17:21 +0530)] 
amd_iommu: Use switch case to determine mmio register name

This makes it easier to add new MMIO registers for tracing and removes
the unnecessary complexity introduced by amdvi_mmio_(low/high) array.

Signed-off-by: Sairaj Kodilkar <sarunkod@amd.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260302115130.5903-2-sarunkod@amd.com>

2 weeks agovhost: accept in order feature flag
Eugenio Pérez [Wed, 4 Mar 2026 17:35:35 +0000 (18:35 +0100)] 
vhost: accept in order feature flag

Let's accept the feature flag with all the infrastructure to process it
in place.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260304173535.2702587-8-eperezma@redhat.com>

2 weeks agovhost: add in_order feature to shadow virtqueue
Eugenio Pérez [Wed, 4 Mar 2026 17:35:34 +0000 (18:35 +0100)] 
vhost: add in_order feature to shadow virtqueue

Some vdpa devices benefit from the in order feature.  Add support to SVQ
so QEMU can migrate these.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260304173535.2702587-7-eperezma@redhat.com>

2 weeks agovhost: factor out the detach buf logic in SVQ
Eugenio Pérez [Wed, 4 Mar 2026 17:35:33 +0000 (18:35 +0100)] 
vhost: factor out the detach buf logic in SVQ

This code path is modified to handle in order devices.  Abstract here so
we can generalize on the caller.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260304173535.2702587-6-eperezma@redhat.com>

2 weeks agovhost: factor out the get of last used desc in SVQ
Eugenio Pérez [Wed, 4 Mar 2026 17:35:32 +0000 (18:35 +0100)] 
vhost: factor out the get of last used desc in SVQ

This code path is modified to handle in order devices.  Abstract here so
we can generalize on the caller.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260304173535.2702587-5-eperezma@redhat.com>

2 weeks agovhost: factor out the descriptor next fetching
Eugenio Pérez [Wed, 4 Mar 2026 17:35:31 +0000 (18:35 +0100)] 
vhost: factor out the descriptor next fetching

The next field will not be used if IN_ORDER is enabled.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260304173535.2702587-4-eperezma@redhat.com>

2 weeks agovhost: move svq next desc array to descs state struct
Eugenio Pérez [Wed, 4 Mar 2026 17:35:30 +0000 (18:35 +0100)] 
vhost: move svq next desc array to descs state struct

It's the right place for it as it is part of the descriptor state.  We
save the memory management of the array, and make the code changes of
the next patches easier.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260304173535.2702587-3-eperezma@redhat.com>

2 weeks agovirtio: Allow to fill a whole virtqueue in order
Eugenio Pérez [Wed, 4 Mar 2026 17:35:29 +0000 (18:35 +0100)] 
virtio: Allow to fill a whole virtqueue in order

As the while steps < max_steps is already one less than the vq size, the
right maximum max_steps variable is queue length, not the maximum
possible remainder of % vq->vring.num.

Fixes: b44135daa37 ("virtio: virtqueue_ordered_fill - VIRTIO_F_IN_ORDER support")
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260304173535.2702587-2-eperezma@redhat.com>

2 weeks agonet/vhost-vdpa: enable vqs before DRIVER_OK if no cvq
Eugenio Pérez [Wed, 4 Mar 2026 17:38:57 +0000 (18:38 +0100)] 
net/vhost-vdpa: enable vqs before DRIVER_OK if no cvq

VDUSE do not forward the enable message to the userland device at the
moment, leaving the dataplane disabled.  As there is no functional
difference if the device have no CVQ, enable them before DRIVER_OK in
that case.

For devices with a control vq, keep the enabling of the dataplane after
CVQ so QEMU can restore the device configuration.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Fixes: 6c4825476a43 ("vdpa: move vhost_vdpa_set_vring_ready to the caller")
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260304173857.2705296-1-eperezma@redhat.com>

2 weeks agoq35: Fix incorrect values for PCIEXBAR masks
Alexey Gerasimenko [Fri, 13 Mar 2026 16:47:16 +0000 (16:47 +0000)] 
q35: Fix incorrect values for PCIEXBAR masks

There are two small issues in PCIEXBAR address mask handling:
- wrong bit positions for address mask bits (see PCIEXBAR description
  in Q35 datasheet)
- incorrect usage of 64ADR_MASK

Due to this, attempting to write a valid PCIEXBAR address may cause it
to shift to another address, causing memory layout corruption where
emulated MMIO regions may overlap real (passed through) MMIO ranges. Fix
this by providing correct values.

Fixes: df2d8b3ed4 ("q35: Introduce q35 pc based chipset emulator")
Signed-off-by: Alexey Gerasimenko <x1917x@gmail.com>
Signed-off-by: Thierry Escande <thierry.escande@vates.tech>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260313164649.794591-4-thierry.escande@vates.tech>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2 weeks agovhost-user: Fix stale error logs and return values in teardown paths
Kuan-Wei Chiu [Sun, 15 Mar 2026 23:10:47 +0000 (23:10 +0000)] 
vhost-user: Fix stale error logs and return values in teardown paths

Commit bc85aae42045 ("vhost-user: return failure if backend crash when
live migration") refactored the set_guest_notifiers error handling but
introduced two regressions across multiple vhost devices.

By moving the function call directly into the if condition, the
subsequent error_report prints the stale ret variable instead of the
actual error code. Additionally, the refactoring hardcoded a return
value of -1 rather than propagating the true error status to the
caller.

Fix these issues by storing the set_guest_notifiers result in a local
err variable.

Fixes: bc85aae42045 ("vhost-user: return failure if backend crash when live migration")
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260315231047.310029-1-visitorckw@gmail.com>

2 weeks agohw/pci: Replace assert with bounds check and return
Aditya Gupta [Thu, 26 Mar 2026 19:04:38 +0000 (00:34 +0530)] 
hw/pci: Replace assert with bounds check and return

As reported in https://gitlab.com/qemu-project/qemu/-/work_items/3334,
callers of 'pci_host_config_{read,write}_common' can pass length as 8,
causing an assert failure

The original issue with pnv_phb3 triggering the assert was fixed in a
previous commit

Instead of asserting on invalid length, check if the length is valid
(<=4), otherwise return (with the failure error code in read)

Reported-by: Zexiang Zhang <chan9yan9@gmail.com>
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260326190438.734239-3-adityag@linux.ibm.com>

2 weeks agoppc/pnv_phb3: Error out on invalid config access
Aditya Gupta [Thu, 26 Mar 2026 19:04:37 +0000 (00:34 +0530)] 
ppc/pnv_phb3: Error out on invalid config access

PHB in Power8 supports 8 byte registers, and hence the ops structure
allows accessing of 8 bytes in 'pnv_phb3_reg_ops'

Both 'pnv_phb3_reg_read' & 'pnv_phb3_reg_write' pass the arguments as is
to 'pnv_phb3_config_{read,write}', if offset is PHB_CONFIG_DATA.

This when called with size as 8, causes following assert failure in
'pci_host_config_read_common' & 'pci_host_config_write_common':

    assert(len <= 4);

Validate that size is <=4, before jumping to pci_host_config_{read,write}_common

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3334
Reported-by: Zexiang Zhang <chan9yan9@gmail.com>
Fixes: 9ae1329ee2fe ("ppc/pnv: Add models for POWER8 PHB3 PCIe Host bridge")
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260326190438.734239-2-adityag@linux.ibm.com>

2 weeks agovhost-user-blk: do not force VIRTIO_BLK_F_SIZE_MAX
Max Makarov [Tue, 31 Mar 2026 13:47:21 +0000 (16:47 +0300)] 
vhost-user-blk: do not force VIRTIO_BLK_F_SIZE_MAX

vhost_user_blk_get_features() unconditionally advertises
VIRTIO_BLK_F_SIZE_MAX regardless of what the backend reports in
its config. The built-in QSD vhost-user-blk backend sets
size_max=0, creating a contradictory state where the feature bit
tells the guest that size_max is valid but the value is zero.

The in-process virtio-blk device does not advertise
VIRTIO_BLK_F_SIZE_MAX (it also sets size_max=0 in config), so
guests never see this contradiction with native virtio-blk.

Linux tolerates size_max=0 because blk_validate_limits() silently
corrects max_segment_size=0 to BLK_MAX_SEGMENT_SIZE (65536).
Windows viostor, however, trusts the feature bit and uses the raw
size_max=0 in its scatter-gather calculations, producing
zero-length segments that hang I/O. The disk appears empty to
Windows (no GPT, no partitions), causing INACCESSIBLE_BOOT_DEVICE.

Stop force-adding VIRTIO_BLK_F_SIZE_MAX in the frontend. The
feature remains in user_feature_bits[], so backends that properly
advertise it with a valid config value will still work.

Signed-off-by: Max Makarov <maxpain@linux.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260331134721.96047-1-maxpain@linux.com>

2 weeks agovhost-user-blk-server: do not advertise VIRTIO_BLK_F_SIZE_MAX with size_max=0
Max Makarov [Tue, 31 Mar 2026 15:28:56 +0000 (18:28 +0300)] 
vhost-user-blk-server: do not advertise VIRTIO_BLK_F_SIZE_MAX with size_max=0

The QSD vhost-user-blk backend advertises VIRTIO_BLK_F_SIZE_MAX but
sets size_max=0 in config, creating a contradictory state. The feature
bit tells the guest that size_max is valid, but the value is zero.

Windows viostor trusts the feature bit, reads size_max=0, and uses it
in scatter-gather calculations producing zero-length segments that hang
I/O. The disk appears empty (no GPT, no partitions), causing
INACCESSIBLE_BOOT_DEVICE BSOD. Linux tolerates this because
blk_validate_limits() silently corrects max_segment_size=0 to
BLK_MAX_SEGMENT_SIZE (65536).

This affects any VMM using QSD as a vhost-user-blk backend (QEMU,
Cloud Hypervisor, etc.), since both pass through SIZE_MAX from the
backend to the guest via feature intersection.

Remove VIRTIO_BLK_F_SIZE_MAX from the backend feature bits. The
size_max config field remains zero but is now ignored by guests since
the feature is not negotiated.

Signed-off-by: Max Makarov <maxpain@linux.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260331152856.1802-1-maxpain@linux.com>

2 weeks agoamd_iommu: Reject non-decreasing NextLevel in fetch_pte()
Alejandro Jimenez [Mon, 30 Mar 2026 21:28:17 +0000 (21:28 +0000)] 
amd_iommu: Reject non-decreasing NextLevel in fetch_pte()

The AMD-Vi specification requires that the NextLevel field for a page table
entry must not be greater or equal to the current page table entry level.
Enforce this to avoid infinite page walk loops on corrupted or buggy guest
page tables.

The initial implementation of fetch_pte() did not implement this check, but
was not vulnerable since the page walk code explicitly decremented the level
instead of retrieving it from the page table entry.

Cc: qemu-stable@nongnu.org
Reviewed-by: Sairaj Kodilkar <sarunkod@amd.com>
Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260330212817.992673-3-alejandro.j.jimenez@oracle.com>

2 weeks agoamd_iommu: Follow root pointer before page walk and use 1-based levels
Alejandro Jimenez [Mon, 30 Mar 2026 21:28:16 +0000 (21:28 +0000)] 
amd_iommu: Follow root pointer before page walk and use 1-based levels

DTE[Mode] and PTE NextLevel encode page table levels as 1-based values, but
fetch_pte() currently uses a 0-based level counter, making the logic
harder to follow and requiring conversions between DTE mode and level.

Switch the page table walk logic to use 1-based level accounting in
fetch_pte() and the relevant macro helpers. To further simplify the page
walking loop, split the root page table access from the walk i.e. rework
fetch_pte() to follow the DTE Page Table Root Pointer and retrieve the top
level pagetable entry before entering the loop, then iterate only over the
PDE/PTE entries.

The reworked algorithm fixes a page walk bug where the page size was
calculated for the next level before checking if the current PTE was already
a leaf/hugepage. That caused hugepage mappings to be reported as 4K pages,
leading to performance degradation and failures in some setups.

Fixes: a74bb3110a5b ("amd_iommu: Add helpers to walk AMD v1 Page Table format")
Cc: qemu-stable@nongnu.org
Reported-by: David Hoppenbrouwers <qemu@demindiro.com>
Reviewed-By: David Hoppenbrouwers <qemu@demindiro.com>
Reviewed-by: Sairaj Kodilkar <sarunkod@amd.com>
Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260330212817.992673-2-alejandro.j.jimenez@oracle.com>

2 weeks agovhost-user.rst: Explicitly allow front-end to write to kick FDs
Jorge E. Moreira [Sat, 11 Apr 2026 02:12:05 +0000 (19:12 -0700)] 
vhost-user.rst: Explicitly allow front-end to write to kick FDs

Migration of back-end state happens while the device is suspended (i.e
all vrings are stopped). To resume normal operation on the destination,
the vrings need to be started again with a kick (either a write on the
FD or the VHOST_USER_VRING_KICK in-band message if negotiated). While
these notifications are typically sent by the driver, it has no reason
to send them in the destination if it already sent them in the source as
the driver is unaware that a migration took place. Therefore it should
be the responsibility of the vhost-user front-end to ensure these vrings
are started. This is particularly necessary for queues where data only
flows from device to driver, such as those used by the vsock and input
devices.

This behavior is already used by some qemu vhost-user front-ends (e.g
vhost-user-blk) and by front-ends implemented on other VMMs(e.g CrosVm).
Adding it to the vhost-user documentation makes it explicit that this
strategy is permitted and suggest it to vhost-user front-end authors.
Explicitly documenting it is necessary because vring kicks appear
designed to originate in the driver, so having some originate in the
front-end can be counterintuitive and cause developers to waste time
looking for other alternatives or face pushback during code review.

Signed-off-by: Jorge E. Moreira <jemoreira@google.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260411021205.3592118-1-jemoreira@google.com>

2 weeks agoMAINTAINERS: Update CXL maintainers entry including adding linux-cxl list
Jonathan Cameron [Wed, 15 Apr 2026 14:30:39 +0000 (15:30 +0100)] 
MAINTAINERS: Update CXL maintainers entry including adding linux-cxl list

The CXL maintainers entry needs an update.
For a while convention has been to +CC linux-cxl@vger.kernel.org to get
better coverage for CXL aspects so formalize that with an L entry.

Drop Fan as he has not been at Samsung for a while now.
Switch my email address over to my kernel.org one.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260415143040.22223-1-Jonathan.Cameron@huawei.com>

2 weeks agolibvduse: fix buffer overflow in vduse_queue_read_indirect_desc()
Stefano Garzarella [Fri, 17 Apr 2026 13:26:45 +0000 (15:26 +0200)] 
libvduse: fix buffer overflow in vduse_queue_read_indirect_desc()

vduse_queue_read_indirect_desc() copies an indirect descriptor table
into a buffer in chunks when the table crosses a memory region
boundary. The destination is a struct vring_desc pointer but is
advanced by a byte count, so each increment moves the pointer by
read_len elements instead of read_len bytes, writing beyond the
buffer.

Use a char pointer for the destination so that the arithmetic
advances correctly.

While at it, change the source from a struct vring_desc pointer
to a void pointer: when the table is split across regions,
iova_to_va() can return a pointer into the middle of a descriptor,
so casting it to a struct vring_desc pointer is wrong. The pointer is
only used as a memcpy() source, so a void pointer is fine.

Fixes: CVE-2026-6425
Fixes: a6caeee811 ("libvduse: Add VDUSE (vDPA Device in Userspace) library")
Cc: qemu-stable@nongnu.org
Reported-by: DARKNAVY <vr@darknavy.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260417132645.121192-3-sgarzare@redhat.com>

2 weeks agolibvhost-user: fix buffer overflow in virtqueue_read_indirect_desc()
Stefano Garzarella [Fri, 17 Apr 2026 13:26:44 +0000 (15:26 +0200)] 
libvhost-user: fix buffer overflow in virtqueue_read_indirect_desc()

virtqueue_read_indirect_desc() copies an indirect descriptor table
into a buffer in chunks when the table crosses a memory region
boundary. The destination is a struct vring_desc pointer but is
advanced by a byte count, so each increment moves the pointer by
read_len elements instead of read_len bytes, writing beyond the
buffer.

Use a char pointer for the destination so that the arithmetic
advances correctly.

While at it, change the source from a struct vring_desc pointer
to a void pointer: when the table is split across regions,
vu_gpa_to_va() can return a pointer into the middle of a descriptor,
so casting it to a struct vring_desc pointer is wrong. The pointer is
only used as a memcpy() source, so a void pointer is fine.

Fixes: CVE-2026-6425
Fixes: 293084a719 ("libvhost-user: Support across-memory-boundary access")
Cc: qemu-stable@nongnu.org
Reported-by: DARKNAVY <vr@darknavy.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260417132645.121192-2-sgarzare@redhat.com>