Commit Graph
13259 Commits
Author SHA1 Message Date
Jamin Lin 90f3384c72 tests/functional/arm/aspeed: Add AST1080 test with ASPEED MCU FW Hub v01.00
Add a functional test for the ASPEED AST1080 EVB using the
Zephyr firmware from ASPEED MCU FW Hub v01.00.

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/20261015063625.186708-9-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2026-10-31 06:52:19 +01:00
Jamin Lin e8212ed5be tests/functional/arm/test_aspeed_ast1040: Update AST1040 image to aspeed-mcu-fw-hub v01.00
Previously, ASPEED hosted the AST1040 pre-built image in the Zephyr GitHub repository
as a temporary solution for QEMU functional tests.

ASPEED now provides official AST1040/AST1080 pre-built images in the aspeed-mcu-fw-hub
repository, starting with release v01.00.

Update the AST1040 functional test to use the official pre-built image from
aspeed-mcu-fw-hub instead of the Zephyr repository.

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/20261028023154.48395-14-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2026-10-31 06:52:19 +01:00
Jamin Lin 490ced3466 tests/qtest/aspeed_smc: Add AST1040 SMC tests
Add SMC qtests for the AST1040 EVB using a 4 MiB W25Q33PW flash
connected to FMC CS0.

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/20261028023154.48395-13-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2026-10-31 06:52:19 +01:00
Kevin Wolf 0a7dca50fd virtio-blk-test: Test truncated serial
Only 20 bytes are written to the passed buffer and the returned string
doesn't have a NUL terminator.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20261029231001.194240-5-kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2026-10-30 15:31:33 -04:00
Kevin Wolf b5fabdc072 virtio-blk-test: Add a basic GET_ID test case
This covers the simple common case with no surprises: A serial that is
shorter than 20 characters and can fit in the request buffer.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20261029231001.194240-3-kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2026-10-30 15:31:33 -04:00
Richard Henderson 9703b6cf41 Merge tag 'pull-ufs-20261030' of https://gitlab.com/jeuk20.kim/qemu into staging
UFS command fixes and fault injection tests

- Add REPORT LUNS support for well-known LUNs
- Fix PRDT validation and SYNCHRONIZE CACHE handling
- Add fault injection and reset/task management tests

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEUBfYMVl8eKPZB+73EuIgTA5dtgIFAmrkT5cACgkQEuIgTA5d
# tgKmBA/9Ep14GJ7zPs5D7Bgfn5c+01AAByp0b/QJZU4NWuYpDp3NeqEAhD5sBn7f
# 61IQw3bIjXGhlHqPU40prGM7uszCEzmfqDC1UkItfxQNUB7pnBcfEq9dG6tJzUDb
# +Ehg3R2d2pJ4v9ZlSW45x+p755HDG1GbJ6DpkqHst7mzPWyzKoNKeOX+M/hmHBQ8
# wvcpVnAwpZdEujK6qQRBNxnk4DrQhpMqKAVHglyePxNcwDjNsooLcnaLtifK6XdQ
# cPiFEZSaPm8GmLuZzUvMVs1ad2QanTWw+gNeim9un+r2WMHCxx/q9LYoeOVQ6FYe
# 8h0Ue3Zsv+6ySnYUVC1z7TLB4I5UC28CxL0Au8t2K4kUQ5VWKtb3uZ9vCcxz584y
# vtGkQ0UHsiDkFqqTbsgrxUuplMuDUG76TgZmbeksy1ms/8TGY7/PDz70C8fdyr0N
# ynlCRKjeGHzVWdUrI3QA6FySmpKShAXUJywQyqlFFtglgea7CrjMYPd6CyGRBWEs
# eSAq9EgpjSkJ3hvTD1zOdzRwiP1nrExkwdATPiucxGUGSR4bNlI6RV0TKT2PTpUU
# 6CHgLttcp2011drah4AZVJX1QZiZZ3y5CPOvlFqMKNSrfzgRU6Z5KUpIjJRI2HWq
# 5WVvEyeBOj5JQLeM7a1tLwUOJB3bQBoswA3TlSXrUtR+h8eR1Zw=
# =ebX7
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 30 Oct 2026 03:04:39 AM CDT
# gpg:                using RSA key 5017D831597C78A3D907EEF712E2204C0E5DB602
# gpg: Good signature from "Jeuk Kim <jeuk20.kim@samsung.com>" [unknown]
# gpg:                 aka "Jeuk Kim <jeuk20.kim@gmail.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 5017 D831 597C 78A3 D907  EEF7 12E2 204C 0E5D B602

* tag 'pull-ufs-20261030' of https://gitlab.com/jeuk20.kim/qemu:
  tests/qtest/ufs-test: Add QOM fault injection task abort test
  tests/qtest/ufs-test: Add MCQ runtime register and TMR handling test
  tests/qtest/ufs-test: Add HCE reset unit test
  tests/qtest/ufs-test: Add TMR and async MCQ SCSI submission helpers
  docs/system/ufs: Update task management request support status
  hw/ufs: Add ssu-timeout mode for power management recovery testing
  hw/ufs: Handle task management requests for fault-injected held requests
  hw/ufs: Add experimental fault injection properties for holding requests
  hw/ufs: Check the PRDT size against the transfer length of the CDB
  hw/ufs: Pass SYNCHRONIZE CACHE(16) to scsi-hd as SYNCHRONIZE CACHE(10)
  hw/ufs: Fail SCSI commands that move data without a PRDT
  hw/ufs: Add support for REPORT_LUNS SCSI command for Well Known LUNs

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-10-30 05:41:15 -05:00
Stanley Jhu cc145a4158 tests/qtest/ufs-test: Add QOM fault injection task abort test
Add ufs_test_fault_injection_abort() to validate runtime QOM fault
injection modes via x-fault-inject-tag and x-fault-inject-mode
(abort-success with held-request tag overwrite rejection, two-stage
UFS_ABORT_TASK + SQRTC.ICU and LUN matching, in-transition completion,
timeout with UTMRLCLR clear-on-zero verification, abort-failed
rejection, and ssu-timeout WLUN START_STOP filtering).

Signed-off-by: Stanley Jhu <stanleyjhu@google.com>
Reviewed-by: Jeuk Kim <jeuk20.kim@samsung.com>
Signed-off-by: Jeuk Kim <jeuk20.kim@samsung.com>
2026-10-30 17:00:58 +09:00
Stanley Jhu a5e4946ba0 tests/qtest/ufs-test: Add MCQ runtime register and TMR handling test
Add ufs_test_tmr_handling() to verify UTMRL UFS_QUERY_TASK execution
(both interrupt-driven I=1 and polling I=0 UTMRDs), SQCTI/CQIACR
register access, SQRTC/SQRTS queue stop/start and self-clearing ICU
transitions across running, stopped, and disabled SQ states, nullified
SQE (CT = 0xF) completion with UFS_OCS_ABORTED, and CQIS.TEPS
write-1-to-clear synchronization with IS.CQES.

Signed-off-by: Stanley Jhu <stanleyjhu@google.com>
Reviewed-by: Jeuk Kim <jeuk20.kim@samsung.com>
Signed-off-by: Jeuk Kim <jeuk20.kim@samsung.com>
2026-10-30 17:00:58 +09:00
Stanley Jhu 415c4cf108 tests/qtest/ufs-test: Add HCE reset unit test
Add ufs_test_hce_reset() to verify HCE 1->0->1 controller reset
behavior, checking that UTMRLRSR and dynamic MCQ queue configuration and
operational registers reset to 0 while host-configured registers (IE,
UTMRLBA/UTMRLBAU, MCQCONFIG) and static capability offsets (SQDAO/CQDAO)
are preserved and subsequent I/O succeeds.

Signed-off-by: Stanley Jhu <stanleyjhu@google.com>
Reviewed-by: Jeuk Kim <jeuk20.kim@samsung.com>
Signed-off-by: Jeuk Kim <jeuk20.kim@samsung.com>
2026-10-30 17:00:58 +09:00
Stanley Jhu 4da9629dd6 tests/qtest/ufs-test: Add TMR and async MCQ SCSI submission helpers
Add ufs_send_tmr() and ufs_mcq_send_scsi_cmd_async() helper functions
in preparation for UTMRL task management and QOM fault injection unit
tests.

Signed-off-by: Stanley Jhu <stanleyjhu@google.com>
Reviewed-by: Jeuk Kim <jeuk20.kim@samsung.com>
Signed-off-by: Jeuk Kim <jeuk20.kim@samsung.com>
2026-10-30 17:00:58 +09:00
Daejun Park f9e0f4d949 hw/ufs: Check the PRDT size against the transfer length of the CDB
scsi-hd moves as many bytes as the SG list of a request holds, and
ufs-lu builds that list from the whole PRDT. When the PRDT is larger
than the transfer length in the CDB, a WRITE writes more blocks than
the CDB names and a READ reads more. A one-block WRITE(10) at LBA 0
with an 8 KiB PRDT also wrote LBA 1, and its response reported no
residual. A UFS device transfers what the CDB asks for and reports the
rest of the Expected Data Transfer Length as a residual.

The commands that scsi-hd emulates had their residual computed against
the PRDT too: an INQUIRY with an allocation length of 36, a 4 KiB PRDT
and an Expected Data Transfer Length of 4096 reported an overflow of
4294959176 bytes. It now reports an underflow of 4060.

When the PRDT is smaller than the transfer length, scsi-hd moved what it
holds and the request completed without an error, for example a
two-block WRITE(10) with a 4 KiB PRDT. Such a request now fails with OCS
MISMATCH DATA BUFFER SIZE, as one without a PRDT does. As in
virtio-scsi, the PRDT is compared with the transfer length of the CDB,
which for commands that return data is the allocation length, and before
scsi-hd checks the CDB.

The new ufs_fit_data_buffer() in ufs.c, where the SG list is built from
the PRDT, cuts a longer list and reports a shorter one; ufs-lu passes it
the transfer length that scsi_req_new() parsed. The HID qtest wrote
eight blocks from a one-block buffer, so give it eight blocks. The new
long-prdt and short-prdt qtests failed before this change.

Fixes: 2a8b36a496 ("hw/ufs: Support for UFS logical unit")
Cc: qemu-stable@nongnu.org
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Reviewed-by: Stanley Jhu <stanleyjhu@google.com>
Reviewed-by: Jeuk Kim <jeuk20.kim@samsung.com>
Signed-off-by: Jeuk Kim <jeuk20.kim@samsung.com>
2026-10-30 17:00:58 +09:00
Daejun Park ad2f77a00b hw/ufs: Pass SYNCHRONIZE CACHE(16) to scsi-hd as SYNCHRONIZE CACHE(10)
scsi-hd implements SYNCHRONIZE CACHE(10) only and fails the 16-byte
variant with INVALID COMMAND OPERATION CODE. Linux sends SYNCHRONIZE
CACHE(16) to zoned disks (sd_zbc sets use_16_for_sync), so once a
logical unit can be zoned, every flush from such a guest fails. With
the zoned logical units and without this change, a Linux 7.3-rc7
guest logged

  sd 2:0:0:1: [sdb] tag#9 Add. Sense: Invalid command operation code
  critical target error, dev sdb, sector 0 op 0x1:(WRITE) flags 0x800

and fsync() on the disk failed with EREMOTEIO.

scsi-hd flushes the whole medium for SYNCHRONIZE CACHE(10) and does not
look at its LBA range. Hand the 16-byte command to scsi-hd as the
10-byte one and keep the IMMED bit. This keeps the UFS change inside
hw/ufs; if scsi-disk learns SYNCHRONIZE CACHE(16), the translation can
go.

Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Reviewed-by: Jeuk Kim <jeuk20.kim@samsung.com>
Signed-off-by: Jeuk Kim <jeuk20.kim@samsung.com>
2026-10-30 17:00:58 +09:00
Daejun Park 4992210c84 hw/ufs: Fail SCSI commands that move data without a PRDT
A command whose CDB transfers data, sent with a PRDT length of 0,
reaches scsi-hd without an SG list. The SCSI layer then calls the
transfer_data callback of the bus, which ufs_scsi_info does not set, and
QEMU dies with SIGSEGV. A guest triggers this with, for example, an
INQUIRY whose PRDT is empty; the new no-prdt qtest crashed QEMU before
this change.

Check the transfer direction that scsi_req_new() parsed, and fail such a
command with OCS MISMATCH DATA BUFFER SIZE before it reaches scsi-hd:
the PRDT describes less data than the command moves. virtio-scsi
likewise fails a command that has no matching buffer
(VIRTIO_SCSI_S_OVERRUN). A request that only reports a pending unit
attention moves no data and goes through, so that the guest still sees
the unit attention.

Handing scsi-hd an empty SG list instead is not enough: READ and WRITE
then complete synchronously in dma_blk_io() and trip the assertion in
scsi_dma_complete().

Fixes: 2a8b36a496 ("hw/ufs: Support for UFS logical unit")
Cc: qemu-stable@nongnu.org
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Reviewed-by: Jeuk Kim <jeuk20.kim@samsung.com>
Signed-off-by: Jeuk Kim <jeuk20.kim@samsung.com>
2026-10-30 14:52:17 +09:00
Richard Henderson 61436f5ff1 Merge tag 'pbouvier/pr/dockerfiles-20261029' of https://gitlab.com/p-b-o/qemu into staging
Changes:
- [PATCH v5 0/2] releases: build and run any QEMU release easily! (Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>)
  Link: https://lore.kernel.org/qemu-devel/20261029000853.15166-1-pierrick.bouvier@oss.qualcomm.com

# -----BEGIN PGP SIGNATURE-----
#
# iQGzBAABCgAdFiEEN8FWlNi6l2Sxlz/btEQ30ZwoYt8FAmrjo/AACgkQtEQ30Zwo
# Yt8GDgv6A6oyrAf61UXz5b1wPcKLZ+Sp1ftgqd3rrvL8FBdeU3jzpZyLQ2b4H8lB
# seg4jLO2gJjOiKc8HVt4U1YiL8WtuThWlEId6JKZtmoSg2NYTAPKLg6JpvQvPU/F
# 7kn28P8nK8Ig10rynMFQ24P7fbdNPGHTBVcFvJEYIL2jgZfg2qlB9edQujASDz3n
# Ww73+G38fX3qSvmXYy/dSDePu1ZoOTqQ/+/6s6Twf4K0D5PXKWc231RM8HwCSYK+
# qF1Ayoj+D9LD7MXH5E6ZW1GnVH5nagSUrcW3Y8VJAJsuBXl0wYvEzBmgKDJqXggy
# TIrK7hbr2D2cN31xOZjKa5rkFnPFcSz4GO5FS3atIMGmmRvXPGQ1Hgsm5HF04zeW
# MU/R/pCetpnKC0drB58WST73aHRuTyXo/HEjNP7+2CZYDqqOjs8T9WSsdT/gn4oT
# mPLl3ckG0Rl76CVNAoYKgMTMvOz3laLxu9+oCkFlz0544RR3rpvpaIhHQm3GRm+7
# 1PF5bwXU
# =BJ6I
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 29 Oct 2026 02:52:16 PM CDT
# gpg:                using RSA key 37C15694D8BA9764B1973FDBB44437D19C2862DF
# gpg: Good signature from "Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 37C1 5694 D8BA 9764 B197  3FDB B444 37D1 9C28 62DF

* tag 'pbouvier/pr/dockerfiles-20261029' of https://gitlab.com/p-b-o/qemu:
  scripts: add build_release_container.sh
  tests/docker/dockerfiles: add release.docker

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-10-29 17:09:01 -05:00
Richard Henderson 8cb1f6929a Merge tag 'qtest-20261029-pull-request' of https://gitlab.com/farosas/qemu into staging
QTest pull request

- Lift limit of 256 intercepted IRQs
- Fixes to socket_accept

# -----BEGIN PGP SIGNATURE-----
#
# iQJEBAABCAAuFiEEqhtIsKIjJqWkw2TPx5jcdBvsMZ0FAmrjtQoQHGZhcm9zYXNA
# c3VzZS5kZQAKCRDHmNx0G+wxnUSOD/9LV7iBwq42IGxOiKnkjbLKAjHlBruYR4/e
# hkWgfIjNn/VGPj++ueNexNxu8QpYuzZxOXDedTFguCzJqz/HfbaeoZ4uQ9gSa1W0
# j4NqUFWfppi4XF02rvZelXsdi9FrVgOCmrBT/bpZNI0HQzU1dxXWOQXYbkMfsjXf
# Ax/vTH6DR02IBfk583JwxZMuPj63PfLOEwGnr3TBAsuKcQJMtgs8iR14z22xe1x7
# mJ6wLFXgTE4utx60JM1bSa3wZU8ADmRq7njtx6QaoM7x1VX70P6eNE8UeJbmxP6j
# U72DO/5+sZc5mITPQYWJ9mfJohJU+G2fB4263Yo2G0bqs7gF7B8Z3yY/JekYYyH/
# GCm3DuH49EqMMRAMgK8CoW83682kuFIt/9tmD4DATlPlcvlNPCP9d7rnckQH5Hti
# 37pPGMGYeQF4Bl1lYrxdUKUro6eOLemesl06lPjuYEsZHVmxSkZGZ7R2lh7MGYCD
# 4RjXOJa01guP6NeUBUi76JamhtpebaLAjsQXOF8EWA0kS30XG9J1+RRXEoQ8HRUr
# zhDZ32wpfylhmViCasFt9ib+0BOdiMbA86buDGmd1rx5yKCGJUStQF0pX/tkgB0P
# FV9U8AL7TobTqxWe3Q676tFykPE5KBHB7grc+L+GDo2JVBCF0CcPyyCdA8I5ar4N
# 4CpG1ZlhJw==
# =ZyWU
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 29 Oct 2026 04:05:14 PM CDT
# gpg:                using RSA key AA1B48B0A22326A5A4C364CFC798DC741BEC319D
# gpg:                issuer "farosas@suse.de"
# gpg: Good signature from "Fabiano Rosas <farosas@suse.de>" [unknown]
# gpg:                 aka "Fabiano Almeida Rosas <fabiano.rosas@suse.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: AA1B 48B0 A223 26A5 A4C3  64CF C798 DC74 1BEC 319D

* tag 'qtest-20261029-pull-request' of https://gitlab.com/farosas/qemu:
  qtest: don't close listener socket in qtest_socket_accept
  qtest: multiple fixes to socket_accept()
  tests/qtest/libqtest: Use a GArray for QTestState::irq_level[]
  system/qtest: Check ngl->name for irq_intercept_in
  system/qtest: Avoid fixed-size irq_levels array for IRQ intercept

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-10-29 17:08:44 -05:00
Richard Henderson 6bf67e6b2c Merge tag 'migration-20261029-pull-request' of https://gitlab.com/farosas/qemu into staging
Migration pull-request

- Compatibility fix for multifd+postcopy migration against older versions
- Rework of early connection code
- Adjustment to snapshot thread name

# -----BEGIN PGP SIGNATURE-----
#
# iQJEBAABCAAuFiEEqhtIsKIjJqWkw2TPx5jcdBvsMZ0FAmrjlD0QHGZhcm9zYXNA
# c3VzZS5kZQAKCRDHmNx0G+wxnUZ5D/94kaE3L9ZTGp3zCOlZgiKXwkpvyYu4on2v
# 9lCMa39lEgFy3B0ASjPCdeHiJoa8sGDIBsmkpB20M+WsiP4T7TgfZbzPcEjKtsZe
# Xl5vn5LcupVsH0VBpLnkgYEqV24czLxPIQh3wXMXCY7df2nrHQpK8s+0P28TShiQ
# ZBLahqQWVvDXOesGTuH1yD0AIxDjQ4yIlTPaTiDTC/EEDh5uaeS48SpJLektNdoP
# ZCsC7VBghH9fqIf2c0D/j9ewKUW67h5XaMVyXULNs0rup18qhu+tjLHwD7HuT6fL
# 1UBnqqJykbiP4C9Ac7N7Uqb548MVl1s5Yv3pz82SU5vz09vxwLMzDfRcUmAZBcUH
# hgIiZzKEvRgQK86iWaUmVVwM5AcQwREVu+ohayxfI6tBieCHLEO5EkVQ1WEkuo3X
# v6NXxsokXJ1K2gs3SzooDlSAFu9MHTCFBFGcnmIlMEeBLrVpJTqPc0bMounuIJ52
# aPvdjpyAiYDAxTWK0Pl/UDcRSW90HeI+2ibQtYWn9ZHcTVLqRd8yb3dntrcMNzmO
# udcbVlIsqyCs6n/T/vuGshHOVXjJiuPj/1CFCsvyM9E5Fj7sNG7EV2vZxzt24+Ho
# mjROo1pwep/WftCj6b41pCA3RT9VYRMUKyZm3NOPsoiJCYU9DRnUOF4spYVuwxUf
# 4CpMfEU6kg==
# =WmGN
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 29 Oct 2026 01:45:17 PM CDT
# gpg:                using RSA key AA1B48B0A22326A5A4C364CFC798DC741BEC319D
# gpg:                issuer "farosas@suse.de"
# gpg: Good signature from "Fabiano Rosas <farosas@suse.de>" [unknown]
# gpg:                 aka "Fabiano Almeida Rosas <fabiano.rosas@suse.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: AA1B 48B0 A223 26A5 A4C3  64CF C798 DC74 1BEC 319D

* tag 'migration-20261029-pull-request' of https://gitlab.com/farosas/qemu:
  migration: Postpone the outgoing preempt channel for preempt_pre_7_2
  migration: Fix incoming channel race with multifd and preempt_pre_7_2
  migration: Dump type of channel in set_incoming_channel tracepoint
  migration: Split migration_channel_process_incoming()
  migration: Fix socket listen backlog
  migration: Add two more trace points for incoming channel mgmt
  tests/migration-test: Add multifd+postcopy test for preempt recovery
  migration: shorten dst snapshot load thread name

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-10-29 17:08:08 -05:00
Pierrick Bouvier fcdb9fdbbc tests/docker/dockerfiles: add release.docker
This new dockerfile allows to build a distroless image containing only
qemu stripped release binaries, their lib dependencies, and installed
artifacts (roms, keymap, ...). There is no shell, no python, nothing
else. This is achieved thanks to a multi-stage build, where we add qemu
binaries, artifacts and libraries in a new scratch image. Image has
the minimal size possible.

This is based on Ubuntu, which has the advantage to have working
containers available down to 14.04. Debian old old stable have broken
apt sources for instance.

This unique dockerfile works for all qemu versions >= 3.1.0 (2018).
We could build down to v0.12.0, but it would require more tweaks in the
dockerfile, so we keep it simple instead.

To build the image, you need to provide a qemu and ubuntu version:
$ podman build -f release.Dockerfile --build-arg QEMU_VERSION=v11.1.0 --build-arg UBUNTU_VERSION=24.04 -t qemu/v11.1.0

To run it, as there is no shell, and no defined entrypoint, you need to
choose the binary you want explicitely:
$ podman run -it --rm qemu/v11.1.0 qemu-system-aarch64 --version

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/qemu-devel/20261029000853.15166-2-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
2026-10-29 19:51:34 +00:00
Daniel P. Berrangé d4a85ac217 qtest: don't close listener socket in qtest_socket_accept
The listener FD passed into qtest_socket_accept should be
considered owned by the caller, and thus is is inappropriate
and unusual to close it in the method.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2026-10-29 15:55:29 -03:00
Daniel P. Berrangé 2e65d90c54 qtest: multiple fixes to socket_accept()
If the very first iteration of the loop breaks early due to the
dead QEMU process, 'ret' is never initialized. Furthermore the
listener socket is not closed on success and there is no error
message printed if timing out after all iterations are complete.
These problems were introduced by the recent refactoring to check
QEMU is alive.

CID 1688281

Reported-by: Markus Armbruster <armbru@redhat.com>
Fixes: c12ad53787 ("qtest: fail fast when QEMU terminates early")
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2026-10-29 15:55:28 -03:00
Peter Maydell 103bbc69ba tests/qtest/libqtest: Use a GArray for QTestState::irq_level[]
Currently we use a fixed irq_level[] array of 256 elements in
QTestState to implement capturing the IRQ level reported by the QEMU
under test so we can return it in qtest_get_irq().  This is smaller
than is actually used by some devices, and if a test tries to
intercept more IRQs than this and one is reported to libqtest then
we'll fail an assertion in qtest_rsp_args().

Switch to a GArray, which automatically resizes as required.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2026-10-29 15:49:12 -03:00
Richard Henderson b574eaf640 Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into staging
pci, vhost, virtio, iommu, acpi: features, fixes

multiboot can again load 64 bit images
vdpa-dev now implements guest_notifier_mask/pending
pci bridge can now configure the negotiated bandwidth
tap can now auto-detect host mtu and expose to guest
amd iommu can now attach on non system bus
vhost-user spec now has its own mailing list

Fixes, cleanups all over the place.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# -----BEGIN PGP SIGNATURE-----
#
# iQFDBAABCgAtFiEEXQn9CHHI+FuUyooNKB8NuNKNVGkFAmrjkJ0PHG1zdEByZWRo
# YXQuY29tAAoJECgfDbjSjVRpY1YH/0r+PhxgcRVVrroGkIxaTaPfOpTj1UkGPmND
# OcjcVCKPXBJF+rve1ZOE4HF8VvbEU1fD1tJ6w+Hto78tjmaVEDvE7gVbhX3YRHv9
# LubC75aTJBYixn/wcS/LUyLAf50+3DD3T+yy83obaJmxHwFyO3CJh2CIMSQxTbSe
# zGPA0noriSSMKEnfbTtikj6NHvFIhdnYipkUaWjGefEbdzXumBhcAF2C7eee9H5m
# 1Nz1Zvjx7BMoArviiZ6EWpGwWPBp0fKwTa7Idcv9K5v6YfWhgVp/gPploCCvulEA
# SMYRqQbbQ41801jR8kY9mV5w5ZFUeNENqplbOR3y6dYtr2w+H2k=
# =JvkM
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 29 Oct 2026 01:29:49 PM CDT
# gpg:                using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
# gpg:                issuer "mst@redhat.com"
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [unknown]
# gpg:                 aka "Michael S. Tsirkin <mst@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: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu: (77 commits)
  virtio-net: add mtu-from-tap property for automatic MTU detection
  net: add generic get_mtu NetClientInfo callback
  net/tap: add tap_fd_get_mtu() to query host tap MTU
  hw/virtio/virtio-mem: Fix error message on invalid NUMA node
  intel_iommu_accel: Teardown FAULTQ resources in bottom half
  intel_iommu_accel: Accept PRQ response for passthrough device
  intel_iommu_accel: Add PRQ injection for passthrough device
  backends/iommufd: Extend iommufd_backend_alloc_hwpt() with fault_id
  backends/iommufd: Introduce iommufd_backend_alloc_faultq
  intel_iommu_accel: Guard VTDAccelPASIDCacheEntry definition
  amd_iommu: Allow IOMMU to attachment on non-system (pcie.0) bus
  acpi-build: Create PCI topology using amd iommu root bus
  amd_iommu: Introduce root bus
  i386/kvm: Use x86_iommu_device_get() for per-device IOMMU lookup
  intel_iommu: Add support for get_x86_iommu callback
  amd_iommu: Add support for get_x86_iommu callback
  x86-iommu: Introduce x86_iommu_device_get() for x86-iommu retrieval
  amd_iommu: Assign ioapic_as only when interrupt remapping is supported.
  vhost-user: add dedicated mailing list
  virtio-snd: don't use virtio_snd_pcm_get_stream() in virtio_snd_post_load()
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-10-29 13:47:40 -05:00
Yodel Eldar f66ded546b tests/functional/x86_64/test_vhost_user_bridge: Eliminate stdbuf usage
Usage of stdbuf triggers a runtime error when vhost-user-bridge
is built with ASAN. Now that vhost-user-bridge writes debug
output to stderr, stdbuf is obviated; remove its invocation.

Message ID of relevant thread:
<20260906-nohmp-next-v1-2-2b21e63974f3@redhat.com>

Suggested-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Suggested-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Yodel Eldar <yodel.eldar@yodel.dev>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260914165250.88382-3-yodel.eldar@yodel.dev>
2026-10-29 14:27:25 -04:00
Yuho Choi 7cdfef9521 vhost-user: remove shared object entries during cleanup
SHARED_OBJECT_ADD publishes a borrowed vhost_dev pointer in the global
UUID table. If an exporter goes away without sending SHARED_OBJECT_REMOVE,
vhost_user_backend_cleanup() frees dev->opaque but leaves these entries
behind. A later lookup from another backend can dereference the NULL
opaque pointer, or access a freed vhost_dev if its containing allocation
has also been released.

Remove all entries exported by the device after closing its backend
request channel and before freeing its state. Match both the resource
type and owner pointer so other exporters and dma-buf entries are kept.

Add unit coverage for multiple UUIDs per owner, unrelated resources,
repeated cleanup, UUID reuse, and an uninitialized or empty table.

Fixes: 1609476662 ("vhost-user: add shared_object msg")
Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
Reviewed-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: <20260910053012.1395885-1-oss.patchbox@gmail.com>
2026-10-29 14:27:25 -04:00
David Vrabel 73962cc5f0 hw/pci-bridge: Add generic PCIe switch upstream and downstream ports
The TI XIO3130 PCIe switch is a vintage Gen1 device, so we add generic
PCIe upstream and downstream port devices that are Gen6.

In guests with pairs of passthrough PCIe devices (e.g, a GPU+NIC pair)
often need to place the devices behind a common (emulated) PCIe switch
so in-guest software (such as NCCL) can correctly determine that P2P
transactions between the devices is possible.

NCCL also needs to be able to determine the available PCIe
bandwidth. If such a guest sees the TI XIO3130 PCIe switch, then it
incorrectly calculates only 2.5 GT/s and x1 is available, but the real
hardware might be 32 GT/s and x16.

Instead of enhancing the existing switch and claiming it is more
capable than the real hardware we add additional generic PCIe upstream
and downstream port devices, which matches the existing generic PCIe
root port device.

The speed and width of the ports are configurable.

Signed-off-by: David Vrabel <david.vrabel@nutanix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260928152431.310363-2-david.vrabel@nutanix.com>
2026-10-29 14:27:25 -04:00
Andrey Drobyshev 8a3afd4fb0 tests/functional: cover a cpr-transfer target going away with vhost-vsock
A cpr-transfer target takes the vsock device over in post_load().  Make
sure the source gets it back when the target goes away afterwards.
Three cases, in the first two the target is made to fail the load by
lacking a device the source has:

  - the target exits on the failure (default exit-on-error); the source
    is stopped beforehand, so it stays paused until we 'cont' it once
    the target is gone;

  - the target stays alive (exit-on-error=false) and the source resumes
    on its own (return-path capability);

  - the target loads the state while the source is stopped, stays
    paused and is quit normally; the source is resumed instead.

In all cases a host<->guest transfer must then work on the source.

The transfer helpers get a payload size parameter, since the plain
checks don't need the 512M of the stress cases, and the target start
code is moved into a helper shared with the existing cpr-transfer test.

Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261012-up-vsock-vhost-v5-v16-22-36c38bd15ffc@virtuozzo.com>
2026-10-29 14:27:24 -04:00
Andrey Drobyshev 2a757a5309 tests/functional: add vhost-vsock CPR test with a live guest
The qtests only cover the QEMU side of the vhost-vsock handoff.  Add a
functional test which runs an actual host<->guest vsock transfer across
a series of CPR migrations, for both cpr-transfer and cpr-exec:

  - the guest is booted on top of a qcow2 overlay shared by all the QEMU
    instances it goes through;

  - the host sends a 512M file of random data to the guest with socat,
    where it's stored on disk, then gets it back the same way; a CPR
    migration is performed every 0.2s while a transfer is in progress;

  - with cpr-transfer each migration starts a fresh target QEMU and
    retires the source; with cpr-exec the same process is re-exec'ed
    over and over;

  - the file received back must be identical to the one sent, and both
    socat instances in the guest must exit cleanly.

The test needs KVM, socat and /dev/vhost-vsock on the host, and a kernel
supporting VHOST_RESET_OWNER for vhost-vsock.  If any of those
requirements are missing the test is skipped.

Acked-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261012-up-vsock-vhost-v5-v16-21-36c38bd15ffc@virtuozzo.com>
2026-10-29 14:27:24 -04:00
Andrey Drobyshev 895a903bc5 tests/qtest/migration: add vhost-vsock tests for cpr-transfer and cpr-exec
Run the existing cpr-transfer and cpr-exec tests with a vhost-vsock-pci
device attached.  There's no guest involved which is driving the device,
so here we only test the QEMU side of the handoff, i.e. the vhost FD is
preserved, the device ownership is released on the source and re-acquired
on the target.

The tests need /dev/vhost-vsock on the host and a kernel supporting
VHOST_RESET_OWNER for vhost-vsock, they are skipped otherwise.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261012-up-vsock-vhost-v5-v16-20-36c38bd15ffc@virtuozzo.com>
2026-10-29 14:26:57 -04:00
Andrey Drobyshev cc7776e054 tests/qtest/migration: add test for snapshot rejection in CPR modes
Snapshots are refused whenever a CPR migration mode is set.  Add a test
which sets each of the CPR modes in turn and checks that 'savevm' and
'loadvm' fail with the corresponding error, then switches back to
'normal' mode and checks that the error is gone.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261012-up-vsock-vhost-v5-v16-5-36c38bd15ffc@virtuozzo.com>
2026-10-29 14:26:56 -04:00
Andrey Drobyshev 232fd8191e tests/unit: add test for duplicate keys in CPR FD table
cpr_save_fd() now refuses to register an FD under a (name, id) key which
is already taken.  Add a test which checks that 2nd registration fails
with an error while the 1st one is left intact, that different names
or ids don't clash, and that the key can be reused once deleted.

Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261012-up-vsock-vhost-v5-v16-2-36c38bd15ffc@virtuozzo.com>
2026-10-29 14:26:56 -04:00
Peter Xu 105af98fe7 tests/migration-test: Add multifd+postcopy test for preempt recovery
We have one for TLS, but we don't have the non-TLS version.  Add it.

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2026-10-29 13:13:11 -03:00
Richard Henderson 73294d096c Merge tag 'qga-pull-2026-10-28' of https://github.com/kostyanf14/qemu into staging
qga-pull-2026-10-28

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEwsLBCepDxjwUI+uE711egWG6hOcFAmrhwGcACgkQ711egWG6
# hOe52BAApWlo/di5Xm2I5nn5w557gzxCollTjzHRQYFFqvvhTqWqAFO01uE4q09p
# O/BJmUeqdvYUm+mX2Q7syduEhCzbwRM0wwfs6GmlxC7JbKYmYNlEAMN/9M9H7XTo
# AN4fFq991tDYrQoBPbdAfsa9TIPmN4O1l+WJvrcRFytw4BpRolCqALuX7/Hensq+
# ds3wZw4RtVNO/lxymGmggKYPN9HxFi94HPd/+332cqw+sdM39zy/n7oUr24Y6/ph
# MSuCIW4AdyOT0Z+FBxUk63OAZba52CXljiJSdK/gO5qcYGmlSZcoMdnAnFEB6FlE
# qHUc0J3mbLzmsJCaj+Tt5Nvf4Cdzlg2vv0Smb3BxPp0sWyN8GP5C5AwQqJP0eD/2
# r08ZsjqqiYu3bqSeT9y2IBO6kPkIMMS+oLDROjNY1G3gGAhK9a7q6HkEvy1MVSr6
# mdxIG4i4FQDwqX3vYu6WhEGHWaPqfJqzHvzBorqfYXkAbNgXUj6PdC0PpAIOEtDk
# +uQBMzLk+EMz4wGpDnk6oz8BgbyQ1Lg9oPc0vjCmRF5BPvWOQQ1RGJaOmhheKe5y
# p8fI4ZdNRPjVsjTzEsMvYVLV0W/6gO1uBtRWZP1MTh30nDHFNuUc3LwiPyAkA258
# 6nj/uvnUq6LGZaV7XEwb8Z7j0n358T4YGqwTZ6KfKaPIZwMWn6A=
# =CeeI
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 28 Oct 2026 04:29:11 AM CDT
# gpg:                using RSA key C2C2C109EA43C63C1423EB84EF5D5E8161BA84E7
# gpg: Good signature from "Kostiantyn Kostiuk (Upstream PR sign) <kkostiuk@redhat.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: C2C2 C109 EA43 C63C 1423  EB84 EF5D 5E81 61BA 84E7

* tag 'qga-pull-2026-10-28' of https://github.com/kostyanf14/qemu:
  qga: implement 'guest-network-get-route' for FreeBSD
  tests/unit/test-qga: enable on FreeBSD
  qga/vss-win32: remove orphaned VSS provider service
  qga: implement 'guest-get-diskstats' for FreeBSD
  qga: fix typo in guest-file-read warning
  qga: implement 'guest-get-fsinfo' for NetBSD and OpenBSD

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-10-28 06:21:59 -05:00
Richard Henderson 0259ddcb9d Merge tag 'hw-misc-20261027' of https://github.com/philmd/qemu into staging
Misc HW patches

- Don't complain about spaces before 'Fixes' tags in scripts/checkpatch.pl
- Various fixes (SD card, i.MX, SH4 UART, CAN, PCIe, ...)
- Widen QEMU_ARCH_* and arch_bitmask to 64-bit
- MAINTAINERS updates

# -----BEGIN PGP SIGNATURE-----
#
# iQJPBAABCAA5FiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmrhtHobFIAAAAAABAAO
# bWFudTIsMi41KzEuMTIsMCwzAAoJEOPjLCzercDejMsP/18i0YGbBmuB9Bfxvbms
# WIW6q5rZiS44hSVJHxlpvrhDX1gkBKxbE9AAJ+xMjuqDAw2pSawSK+v7AAigLbfu
# hzrGYw/PBvbAAUXsStJuTbCTtmftVhLyPd7YEJs6+2LWhqwwwN/jixHPinunOFdK
# nZmWBNyWIMYV0r46a450nEHGjEjQBWtZhBBFYcYQ6L8LW1StdjFMkHnviqRD0d3N
# pz++eLTpbDYb9Pyfr7dvFhUWtkBGTCYB6iuvFzJ8S8VWDbG2Gc00DTdP3QMXF8S7
# 2Fp9c8iwqi4tm17qT8+Do3Jv27Dt43wz5ZVinmS1oHacZl5xTP+BgI+f1FA4IWR1
# vCc2f0mmZbk+DjvuZKuCRcRaA7oKtnDEZvuoRb+2r+8YaMOJgszQJNfyBBOQFpfN
# kfmVy8MVzTB0Ps3TrSID7ZyzU1IYEa4YLnq/7L5iXlgjrnAimelEMcd9SjNdohHk
# oqzrvgTh0eimj5qpwg+pKE22y7iHtUhM/jA35IM3g6oERyM0yv7bKjGeHthoZv5V
# 1v5OjjD6DAItNTA+O/WqS27YhNICNE5mqwu2jzqw8ZcPA4OshbcgEJ9VaxASd3qI
# eZURqYx2qnoHR2M3weG0LZTJSlr2wIsWtVbF2ZN6odzKkYfoY2CzQMjBfTSD8+fa
# g4L11zpAhKYzoHpw+UE2fMAA
# =jdKk
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 28 Oct 2026 03:38:18 AM CDT
# gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [unknown]
# gpg: Signature notation: manu=2,2.5+1.12,0,3
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE

* tag 'hw-misc-20261027' of https://github.com/philmd/qemu: (58 commits)
  qemu/arch-defs: increase width of QEMU_ARCH_* masks enums to be 64 bits
  qemu/arch-defs: Use SYS_EMU_TARGET__MAX to define QEMU_ARCH_ALL
  qemu/arch-defs: extract QEMU_ARCH_BIT for QEMU_ARCH_* enums
  hw/display/xlnx_dp: Make assertions clearer
  hw/misc/allwinner-h3-dramc: Avoid shift by negative amount
  hw/net/cadence_gem: Check guest-provided queue numbers in screening registers
  hw/net/can/flexcan: Fix FLEXCAN_CRCR_MBCRC definition
  hw/pci-host/aspeed_pcie: Fix global MSI setting during class initialization
  hw/char/sh_serial: fix break detection flag
  hw/char/sh_serial: use rx_cnt for available FIFO space
  hw/char/sh_serial: fix RDF flag clear on FIFO reset
  MAINTAINERS: Update Gustavo's email address
  hw/arm: remove pci-bridge/pci_expander_bridge.h from virt.c
  hw/watchdog/wdt_imx2: Trace with QOM path
  hw/net/lan9118_phy: Trace with QOM path
  hw/net/imx_fec: Trace with QOM path where easily possible
  hw/usb/imx-usb-phy: Avoid casting from void *
  hw/misc/imx*_ccm: Avoid casting from void *
  hw/intc/imx_avic: Avoid casting from void *
  hw/char/imx_serial: Avoid casting from void *
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-10-28 06:21:44 -05:00
Roman Bogorodskiy 37c51cddb7 tests/unit/test-qga: enable on FreeBSD
FreeBSD has all necessary commands implemented,
so enable test-qga for it.

Requires only minimal portability fixes for sockets
in connect_qga().

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260929150100.66035-1-bogorodskiy@gmail.com
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
2026-10-28 11:21:01 +02:00
Bernhard Beschow dc6ae442c1 tests/functional/arm: Add console test for mcimx7d-sabre machine
The test currently exercises the Linux kernel and waits for the first
daemons to be started. At this point, basic hardware is initialized and
if the log message is reached, no driver ended up in an endless loop,
thus the system should be usable.

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Message-ID: <20261006083445.30362-12-shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
2026-10-28 09:25:38 +01:00
Bernhard Beschow 09e062dfa7 tests/functional/arm: Add console test for sabrelite machine
The test currently exercises the Linux kernel and waits for the first
daemons to be started. At this point, basic hardware is initialized and
if the log message is reached, no driver ended up in an endless loop,
thus the system should be usable.

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Message-ID: <20261006083445.30362-9-shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
2026-10-28 09:25:38 +01:00
Bernhard Beschow 0d3753b511 docs, tests/functional: Drop redundant CLI arguments in imx8m*-evk invocations
Both boards provide defaults matching real hardware. No need to ask
users to repeat these. Also, remove these redundant arguments from the
functional tests such that the defaults get tested.

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Bin Meng <bin.meng@processmission.com>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Message-ID: <20261006083445.30362-7-shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
2026-10-28 09:25:37 +01:00
Aniket Sahu b71c5a9613 tests/functional/ppc64: extend ppc64 powernv net device tests
Added console checks as the probe log lines will appear before the
S14Silence-console init scripts.

Signed-off-by: Aniket Sahu <asahu1x@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Amit Machhiwal <amachhiw@linux.ibm.com>
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260921081010.31778-3-asahu1x@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
2026-10-28 10:45:51 +05:30
Aniket Sahu 9eb5eb4d97 tests/functional/ppc64: extend pseries migration tests
The existing test_migration.py exercises all three migration transport
paths (TCP, UNIX, exec) but only against the mac99 machine type.
A regression in pseries-specific vmstate save/restore handlers would
not be caught by migrating a mac99 guest.

Switch the UNIX socket and exec (socat) migration tests from mac99 to
pseries so that these transport paths are exercised against the pseries
vmstate.  The TCP test is left on mac99 since pseries TCP migration is
already covered by test_ppc64_linux_migration in test_pseries.py.

Signed-off-by: Aniket Sahu <asahu1x@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Amit Machhiwal <amachhiw@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260921081010.31778-2-asahu1x@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
2026-10-28 10:45:50 +05:30
Richard Henderson d29412cca5 Merge tag 'pull-riscv-to-apply-20261027' of https://github.com/alistair23/qemu into staging
RISC-V PR for 11.2

* Add experimental Zvabd extension support
* Mask vsepc according to IALIGN
* Reset vCPU on VM reset via MP_STATE_INIT_RECEIVED
* Improve modeling of the Atlantis UART
* Fix IOMMU entry leak with ioatc-limit=0
* Fix integer handling issues in k230_gsdma and k230_decomp_gzip
* Reclaim invalidated IOATC entries for IOMMU
* Duct tape fix for QMP and RV profiles introspection
* Move RISC-V 'Z' CPU properties section to removed features
* Use TSO barriers instead of full barriers for Ztso
* Make mnstatus.MNPELP writable with Zicfilp
* Gate envcfg CBO fields on extensions
* Fix stale PMP state across reset
* Use 1ULL for a value we're going to shift by 63
* Remove unused IMISC macro
* Encode debug translation ranges in IOMMU
* Allow regular mstatus MPV/GVA writes again
* Fix uninitialised upper half in pmu_timer_trigger_irq
* Fix CPU state access on big-endian hosts

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEaukCtqfKh31tZZKWr3yVEwxTgBMFAmrgREAACgkQr3yVEwxT
# gBPBHxAAmIzV1LXJAxQTvU46+1j+4+mSvGr37byb1iU8yg+dJCNtYpFLHKdNjF0Q
# Fn+5uBL+QJC3rEA0Xbq6iF4EP2GO8t/Qm4rElLmWCw1xzraj7RAZrNJHWCebLp1j
# PLS53gINaQNIuE6DC91mwcuWanKo7q+tvOiwcShaVyUH771J1+1xVOkpcbkQaVrZ
# a54IfHIcs4TIsKrpmxCJPkEuBcL4VtaK5JwcqbeCQQ68v7L7qQpec75t9idr3o25
# Pn/BOsHwkXoJ1qxFuY61JGhUpFKUzZIqd6HKqwv4SENZY+O87J79R9X/HU9H17xh
# B75+h91ZFSZ2luNd2vZCCMx4vOXuCa+YE/m0ZmyyjJnGLA4LHRoeFRmUUu5Dxzkn
# kP+psnaeUfcI6W71d8Dcqov1g1O7MBdVrQD1hzK8IeAuYL438cLZpo9WT6TVX5cn
# /DRCyDR4f6uzf8Lnh0wItJGzSUlW2xadFLu357KsJ0+lpytpmYolOBxUGJXtJu2g
# BSfgQX9y9xhszCbFopngunu3guOlDoHZEJ9l29+tXicezvJxXw+FRyc4EU3onRtz
# zXGWa7sN4XGifzoDorbVcWGpOT2w2LI1himS4N9qXWNCZ4s115xENMVCMDRt6a9Z
# aZRyBib2nbrrgnO4JJbxBUe/MViBfQlc+AuqMmEwrwdP3LRBbZA=
# =qxZ6
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 27 Oct 2026 01:27:12 AM CDT
# gpg:                using RSA key 6AE902B6A7CA877D6D659296AF7C95130C538013
# gpg: Good signature from "Alistair Francis <alistair@alistair23.me>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 6AE9 02B6 A7CA 877D 6D65  9296 AF7C 9513 0C53 8013

* tag 'pull-riscv-to-apply-20261027' of https://github.com/alistair23/qemu: (29 commits)
  target/riscv: Fix CPU state access on big-endian hosts
  target/riscv: fix uninitialised upper half in pmu_timer_trigger_irq()
  target/riscv/csr.c: allow regular mstatus MPV/GVA writes again
  hw/riscv/riscv-iommu: encode debug translation ranges
  include/hw/intc/riscv_imsic.h: remove unused macro
  target/riscv: Use 1ULL for a value we're going to shift by 63
  target/riscv: pmp: reset the derived PMP bounds and rule count
  target/riscv: pmp: clear A and L on every implemented PMP entry at reset
  target/riscv: gate envcfg CBO fields on extensions
  target/riscv: make mnstatus.MNPELP writable with Zicfilp
  target/riscv: Use TSO barriers instead of full barriers for Ztso
  docs: Move RISC-V 'Z' CPU properties section to removed features
  target/riscv/cpu.c: duct tape fix for QMP + RV profiles introspection
  hw/riscv/riscv-iommu: reclaim invalidated IOATC entries
  hw/riscv/riscv-iommu: serialize IOATC accesses
  hw/dma: fix k230_gsdma integer handling issues
  qtest: fix k230_decomp_gzip test integer handling issues
  hw/misc: use hwaddr for the k230_decomp_gzip input address
  hw/misc: fix calculating input address overflow in k230_decomp_gzip
  hw/misc: fix calculating output address overflow in k230_decomp_gzip
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-10-27 14:27:13 -05:00
Brian Cain 464a8cc8b0 tests/functional/hexagon: boot DSP firmware
Download the firmware and run it on the corresponding DSP machine.

The images are third-party binaries, so the tests run only when untrusted
code is allowed.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
2026-10-27 07:23:27 -07:00
Brian Cain 478270e839 hw/hexagon: add subsystem-base property
Let the hexagon-sim-style machines their QDSP6 subsystem, and with it the
l2vic and QTimer.

The config table's subsystem base is updated to align with the chosen
address.

Reviewed-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
2026-10-27 07:23:27 -07:00
Brian Cain 4dff005e1d hw/hexagon: add the SM8975 NSP machine
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
2026-10-27 07:23:27 -07:00
Brian Cain ef47ed9557 hw/hexagon: add the SA8797P NSP0 machine
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
2026-10-27 07:23:27 -07:00
Brian Cain 3687a9e59c hw/hexagon: add the SC8480XP NSP0 machine
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
2026-10-27 07:23:27 -07:00
Brian Cain a1df9d1158 hw/hexagon: add the SA8775P CDSP machine
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
2026-10-27 07:23:27 -07:00
Brian Cain 1107d374c7 hw/hexagon: add the QCS6490 CDSP machine
Reviewed-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
2026-10-27 07:23:27 -07:00
Brian Cain 21a446d057 tests/tcg/hexagon: add v85 scalar tests
Add tests for: vallocframe, atomics, trap2, CFI/restricted branches, and
scalar fp instructions.

New instructions not yet supported by the toolchain are manually encoded
with .word directives.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Reviewed-by: Marco Liebel <marco.liebel@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
2026-10-27 07:23:27 -07:00
Brian Cain fe95b99e6f target/hexagon: implement SSR.SS single-step
SSR.SS enables a single-step debug event after each packet executed in
user or guest mode.

Carry the state in a new SS_ACTIVE TB flag.  When it is set, translate
one packet per TB and raise HEX_EVENT_DEBUG w/PC at the next packet (which
becomes ELR).

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
2026-10-27 07:23:27 -07:00
Brian Cain 990d307eeb target/hexagon: fix allocframe FRAMEKEY scrambling
The architecture scrambles only the LR word of the {FP, LR} frame that
allocframe stores.  With the idef parser enabled, fFRAME_SCRAMBLE built
the XOR key with FRAMEKEY in both halves of the 64-bit value, so the
stored FP was scrambled as well.

deallocframe is also parser-generated and applies the same incorrect
transform a second time, which masks the error.  dealloc_return uses the
hand-written TCG implementation that correctly descrambles only LR, so
it leaves FP corrupt when returning from a frame allocated by the parser.

Add a regression test that sets a nonzero FRAMEKEY, allocates a frame,
and returns through dealloc_return to validate the restored FP.

Uncovered by testing some boot images using QuRT.

Reviewed-by: Marco Liebel <marco.liebel@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
2026-10-27 07:22:24 -07:00
Zephyr Li 87c6033165 hw/riscv/riscv-iommu: encode debug translation ranges
The debug translation response aligns the translated physical address to
the effective translation range, but always reports S=0. For a request
inside a superpage, the response therefore identifies the wrong 4 KiB
physical page.

For effective ranges larger than 4 KiB, set S and encode the range size
using trailing ones in the PPN field. Keep the existing response format
for 4 KiB translations.

The RISC-V IOMMU specification permits reporting a 4 KiB translation even
when the page tables use superpages. Reporting the effective range is an
implementation choice; this change does not claim that S=1 is mandatory
for every translation through a superpage mapping.

Add debug-response tests for S-stage-only 4 KiB, 64 KiB NAPOT, and 2 MiB
translations, G-stage-only 2 MiB translations, and nested S4K/G2M,
S2M/G4K, and S2M/G2M mappings. Check requests inside large ranges and at
both ends. The mixed nested cases verify that the response uses the
smaller effective translation granularity.

Fixes: a7aa525b93 ("hw/riscv/riscv-iommu: add DBG support")
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3552
Signed-off-by: Zephyr Li <fritchleybohrer@gmail.com>
Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Message-ID: <20261022065647.67150-1-fritchleybohrer@gmail.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2026-10-26 12:19:16 +10:00