3642 Commits

Author SHA1 Message Date
Jim MacArthur
60cb02a5aa docs/system/igvm.rst: Update external links
* Fixes link to AMD64 Architecture Programmer's
Manual and bumps version to 3.43.
* Updates link to buildigvm to new home on GitLab.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3247
Signed-off-by: Jim MacArthur <jim.macarthur@linaro.org>
Reviewed-by: Luigi Leonardi <leonardi@redhat.com>
Message-ID: <20260119-igvm-documentation-fix-v2-1-b2f6174e3f4f@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2026-02-03 08:32:33 +01:00
BALATON Zoltan
5cf3908f70 memory: Remove memory_region_init_rom_device_nomigrate()
This function is not used outside of memory_region_init_rom_device()
which is its only caller. Inline it there and remove it.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <e6f973ff3c243fe1780bf01c3e67c9e019b08fa9.1770042013.git.balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2026-02-02 16:43:38 +01:00
Richard Henderson
d21a442a5a Merge tag 'pull-target-arm-20260129' of https://gitlab.com/pm215/qemu into staging
target-arm queue:
 * Support SMMUv3 acceleration
 * A few other minor cleanups and fixes

# -----BEGIN PGP SIGNATURE-----
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAml7hesZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3mFyEACUDY0XTLaqkCLQyeJc1OAg
# +oH6sRblPCJpBT3Y8eFUiDjH/2amSdxADxNmE7B/+ltD2InXJ6lHfPsA+F7QiaXD
# 7D0vKQ9LlQiv2KXwH75xEqTkG1W0m/9OLhnuyygiBIA+hjvCU5wuCmJ3AIAZOdV1
# haiW5Dg4++nxjyFNJOdC7IVCb8xIMO7rlITG4aAFhl8VOT9Orx/kJYvBCnk2flFP
# +X8JQuI3kn5ew4iTahsvAnsxTSn403u/A7j1PT8I4cODnRoV7rNF4L+LmtROHkIs
# Fkqz5LI7yN8IQeh8/kDxXr25tZnwsQ2xrBLcZsyMelVDN4fXj2+HDn+ohCNV+xIh
# 65mlQkPZ+uos4PBLgXRmuRHfvt4EBYBwAx/iRk4D+NPmHbNGlznKBRiy/7/HpFsr
# JH3XYJBW6iqmqbvfCfGJ83aiSfTkRYE/k/w8JPBO9ko8nmuqMwlCysHfBfmr/zU3
# 2MHzx+CcQ6kWEh7bi3R1r/r0LPtzT9Y4xsZKKhGyjKmwmA7eNbVCbpzbTmxWICcP
# donH/9ecAX+il7/hZOZliG7050HeSPuZC+pM7BkJlLuiKDpfwn/hBeIPJu4JGna7
# N4qRls6rO3IOchzQk9eFewie1575xUV/BDUlNsXE2ZdN0n8XgSHd9lBXzlLeOoV+
# cjg2O1Iwi+53Nb4G5Ap74Q==
# =JEwH
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 30 Jan 2026 03:08:11 AM AEDT
# gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:                issuer "peter.maydell@linaro.org"
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [unknown]
# gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [unknown]
# gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [unknown]
# gpg:                 aka "Peter Maydell <peter@archaic.org.uk>" [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: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* tag 'pull-target-arm-20260129' of https://gitlab.com/pm215/qemu: (43 commits)
  arm: add DCZID_EL0 to idregs array
  arm: add {get,set}_dczid_bs helpers
  docs/system: update FEAT_BBML[12] references
  MAINTAINERS: add emulation.rst to ARM TCG CPUs
  target/arm/hvf: Sync CNTV_CTL_EL0 & CNTV_CVAL_EL0
  target/arm/hvf: Move hvf_sysreg_[read, write]_cp() functions around
  hw/arm/smmuv3-accel: Make SubstreamID support configurable
  hw/vfio/pci: Synthesize PASID capability for vfio-pci devices
  hw/pci: Factor out common PASID capability initialization
  hw/pci: Add helper to insert PCIe extended capability at a fixed offset
  backends/iommufd: Add get_pasid_info() callback
  backends/iommufd: Retrieve PASID width from iommufd_backend_get_device_info()
  hw/arm/smmuv3-accel: Add property to specify OAS bits
  hw/arm/smmuv3-accel: Add support for ATS
  hw/arm/smmuv3-accel: Add a property to specify RIL support
  hw/arm/smmuv3: Add accel property for SMMUv3 device
  hw/arm/smmuv3: Block migration when accel is enabled
  tests/qtest/bios-tables-test: Update IORT blobs after revision upgrade
  hw/arm/virt-acpi-build: Add IORT RMR regions to handle MSI nested binding
  tests/qtest/bios-tables-test: Prepare for IORT revison upgrade
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-02-02 15:04:44 +11:00
Pierrick Bouvier
cab15547f1 plugins: move qemu-plugin.h to include/plugins/
This change has two benefits:
- ensure plugins can't include anything else from QEMU than plugins API
- when compiling a C++ module, solves the header conflict with iostream
  header that includes transitively the wrong ctype.h, which already
  exists in include/qemu.

By Hyrum's law, there was already one usage of other headers with mem
plugin, which has been eliminated in previous commit.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260124182921.531562-7-pierrick.bouvier@linaro.org
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Alex Bradbury
0a9754525c contrib/plugins/hotblocks: Allow limit to be set as a command line argument
Also add documentation for this argument. This allows the default of 20
to be overridden, and is helpful for using the hotblocks plugin for
analysis scripts that require collecting data on a larger number of
blocks (e.g. setting limit=0 to dump information on all blocks).

Signed-off-by: Alex Bradbury <asb@igalia.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Link: https://lore.kernel.org/qemu-devel/58281d6e54bcad1802e8d3dc8d8501d54c2a971e.1753857212.git.asb@igalia.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Alex Bradbury
e4ed74c9ae docs/about/emulation: Add documentation for hotblocks plugin arguments
Currently just 'inline'.

Signed-off-by: Alex Bradbury <asb@igalia.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Link: https://lore.kernel.org/qemu-devel/35128cc5a86a0c18418f9d3150fb8771c54ef7d8.1753857212.git.asb@igalia.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2026-01-29 09:34:14 -08:00
Alex Bennée
8a0d94ab4a docs/system: update FEAT_BBML[12] references
It looks like the features were renamed to include the levels at some
point. To make it easier to match features up to the Arm ARM update to
use the full name.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org
Message-id: 20260127145555.3070590-1-alex.bennee@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-01-29 13:42:29 +00:00
Marc-André Lureau
c899071b5a rust: move binding generation to bindings/
Move raw FFI bindings generation to separate crates.  This makes it
possible to reuse bindgen declarations for a header file in its
dependencies (this was not the case before this change), while keeping
multiple -sys crates to avoid rebuilding all the code whenever
something changes.

Because the -sys crates are generated in dependency order, this also
enforces that the crates are organized in something that resembles
the dependencies between C headers.

The meson.build for rust-safe crates becomes simpler, and it should be
possible in the future to let Meson's cargo support handle most of it.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[General cleanup and Python script. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-01-27 08:57:52 +01:00
Richard Henderson
363a069b31 Merge tag 'migration-20260123-pull-request' of https://gitlab.com/farosas/qemu into staging
Migration pull request

- Removal of deprecated query-migrationthreads command
- Removal of deprecated QMP migrate argument 'detach'
- Removal of deprecated zero-blocks capability
- Removal of deprecated migration to file using fd: URI
- Improvements to fd handling in QEMUFile
- Cleanups to postcopy tests
- Cleanup of migration channel connection code

# -----BEGIN PGP SIGNATURE-----
#
# iQJEBAABCAAuFiEEqhtIsKIjJqWkw2TPx5jcdBvsMZ0FAmlz0PIQHGZhcm9zYXNA
# c3VzZS5kZQAKCRDHmNx0G+wxnS1hEADSUFCynktz0MwmPbun9rHI/DSTmkk2SFIj
# 4WI66Wgez805uD/Xa/r7qpqpjkTTFd+mgbfUlkcmiatrrPMFsYFP4cyrtFfLOl16
# ODmYZO+VQ+cFpzgXDsS1IrHSwaJ1zU7sFkYLXGJdwwhkDWDDxHpO/1OADG7HotkH
# GFaZaMFim4fAHuDp688uzbUsljNjaKNlqbZQFVeg2S+ewEFtp1/tTY2oRTuKA0Es
# BPeENU6xQxR26YPn8lZub61D12ZNw4BCKTNANGvnDGjTmC9Ijw3iAjEo5O4TWhca
# q7UPkFS9uuxIxtAeRul92XzAclASnZ52Lk1oTfP083GcXIepsFwNKKmZtulOjGm2
# bz8exu46WUSO0wxlWcM/DGfmkapKbXteP/nIBjpeRrYxxz4dBJ4MHHCNv487Si3Y
# Um8dar3wUNP6UZEt/ZGidJRvcigMwM01aDVXyn05qqHQ8Qfj93ozi9hz1ttHBeDP
# QuX6LlJ4wiU4z9QZqNaDe7pwSi/VdROkp3U0/0SVySudqE/vTC0YtUxq2miH7RLl
# VJsYPF9nZOEgKXCqMdzM4G9kr/jJ0Ou7z8hm/J6l19joBn79pf7FrRG935LCM7at
# 0xkF1D+D/O4+C/mnYemVXNwY35MhQR9OihS6DjVxYeySf4QIwUtuzBQ6W1pz9vJt
# EyLedtJXpg==
# =7sEk
# -----END PGP SIGNATURE-----
# gpg: Signature made Sat 24 Jan 2026 06:50:10 AM AEDT
# 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-20260123-pull-request' of https://gitlab.com/farosas/qemu: (36 commits)
  migration/channel: Centralize calling migration_channel_connect_outgoing
  migration: Remove qmp_migrate_finish
  migration: Move CPR HUP watch to cpr-transfer.c
  migration: Free cpr-transfer MigrationAddress along with gsource
  migration: Move URI parsing to channel.c
  migration: Move channel parsing to channel.c
  migration: Move transport connection code into channel.c
  migration: Move channel code to channel.c
  migration: Rename instances of start
  migration/channel: Rename migration_channel_connect
  migration: Start incoming from channel.c
  migration/rdma: Use common connection paths
  migration: Move setting of QEMUFile into migration_outgoing|incoming_setup
  migration: Handle error in the early async paths
  migration: Fold migration_cleanup() into migration_connect_error_propagate()
  migration: yank: Move register instance earlier
  migration: Expand migration_connect_error_propagate to cover cancelling
  migration: Move error reporting out of migration_cleanup
  migration: Free the error earlier in the resume case
  migration: Use migrate_mode() to query for cpr-transfer
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-01-24 10:08:23 +11:00
Peter Xu
f1fcc1c101 migration: Remove fd: support on files
This feature was deprecated in 9.1.  Remove it in this release (11.0).

We also need to remove one unit test (/migration/precopy/fd/file) that
covers the fd: file migration, because it'll stop working now.

Reviewed-by: Prasad Pandit <ppandit@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260115225503.3083355-3-peterx@redhat.com
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2026-01-23 11:24:19 -03:00
Peter Xu
aa575660d0 migration: Remove zero-blocks capability
It was declared deprecated since 9.2.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260115225503.3083355-2-peterx@redhat.com
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2026-01-23 11:24:19 -03:00
Markus Armbruster
fc37c122ff migration: Drop deprecated QMP migrate argument @detach
Deprecated in commit c2fb6eaeb9 (qapi/migration: Deprecate migrate
argument @detach), v10.1.0.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/qemu-devel/20260108125512.2234147-3-armbru@redhat.com
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2026-01-23 11:24:16 -03:00
Markus Armbruster
7686f2c5d7 migration: Drop deprecated QMP command query-migrationthreads
Deprecated in commit 228529d1fe (migration: Deprecate
query-migrationthreads command), v9.2.0.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/qemu-devel/20260108125512.2234147-2-armbru@redhat.com
[fixed title underline length]
Signed-off-by: Fabiano Rosas <farosas@suse.de>
2026-01-23 11:24:16 -03:00
Peter Maydell
eac712a44b docs: avoid unintended mailto: hyperlinks
In rST documents, an '@' character in normal text or a parsed-literal is
assumed to be an email address and will result in a 'mailto:' hyperlink in
the generated HTML.  In several places we have mailto: hyperlinks that are
unintended nonsense; correct these by either escaping the @ character or
making the text use ``...`` preformatted rendering.

This commit covers only the simple cases which can be trivially fixed
with escaping or ``..``; the remaining cases will be handled in
separate commits.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Zhang Chen <zhangckid@gmail.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260115142629.665319-3-peter.maydell@linaro.org
2026-01-23 14:08:57 +00:00
Peter Maydell
5b9a1d5b4f docs/system/arm/xlnx-zynq.rst: Improve docs rendering
Make some minor improvements to the rendering of the docs for
the xlnx-zynq-a9 board:

 * use a proper hyperlink rather than a bare URL for the
   link to the reference manual
 * drop the hex address of the SMC SRAM: the bare '@' is
   rendered as bogus mailto: hyperlink, and the information
   is not very interesting to the user anyway
 * expand out the abbreviations in the list of Cortex-A9
   per-CPU devices
 * correct the bullet-point list markup so it doesn't render
   with odd highlighted lines
 * capitalize 'Arm' correctly

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Zhang Chen <zhangckid@gmail.com>
Message-id: 20260115142629.665319-2-peter.maydell@linaro.org
2026-01-23 14:08:57 +00:00
Peter Maydell
d154001f5a docs: Be consistent about capitalization of 'Arm' (again)
The company 'Arm' went through a rebranding many years back
involving a recapitalization from 'ARM' to 'Arm'. As a result
our documentation is a bit inconsistent between the two forms.
It's not worth trying to update everywhere in QEMU, but it's
easy enough to make docs/ consistent.

We last did this in commit 6fe6d6c9a in 2020, but a few new
uses of the wrong capitalization have crept back in since.

As before, "ARMv8" and similar architecture names, and
older CPU names like "ARM926" still retain all-caps.

In a few places we make minor grammar fixups as we touch
the sentences we're fixing.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260115150545.669444-1-peter.maydell@linaro.org
2026-01-22 11:23:31 +00:00
Bernhard Beschow
43f9287d3a docs/system/arm/imx8mp-evk: Avoid suggesting redundant CLI parameters
Commit 094fd7d36f ("hw/arm/imx8mp-evk: Add KVM support") introduced KVM
support for the imx8mp-evk machine. KVM only works with the "host" CPU type
such that it has been made the default CPU type for KVM. No need to repeat
that on the command line.

Fixes: 094fd7d36f ("hw/arm/imx8mp-evk: Add KVM support")
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Message-id: 20260114213227.3812-3-shentey@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-01-22 11:23:31 +00:00
Bernhard Beschow
582a8f30ea hw/arm/imx8mp-evk: Provide some defaults matching real hardware
Having four CPUs and 6 GiB of RAM matches real hardware. Fix the machine
defaults to make its use more ergonomic and less error-prone.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Message-id: 20260114213227.3812-2-shentey@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-01-22 11:23:30 +00:00
Tao Tang
6ce361b02c hw/misc: Introduce iommu-testdev for bare-metal IOMMU testing
Add a minimal PCI test device designed to exercise IOMMU translation
(such as ARM SMMUv3) without requiring guest firmware or OS. The device
provides MMIO registers to configure and trigger DMA operations with
controllable attributes (security state, address space), enabling
deterministic IOMMU testing.

Key features:
- Bare-metal IOMMU testing via simple MMIO interface
- Configurable DMA attributes for security states and address spaces
- Write-then-read verification pattern with automatic result checking

The device performs a deterministic DMA test pattern: write a known
value (0x12345678) to a configured GVA, read it back, and verify data
integrity. Results are reported through a dedicated result register,
eliminating the need for complex interrupt handling or driver
infrastructure in tests.

This is purely a test device and not intended for production use or
machine realism. It complements existing test infrastructure like
pci-testdev but focuses specifically on IOMMU translation path
validation.

Signed-off-by: Tao Tang <tangtao1634@phytium.com.cn>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Clément Mathieu--Drif <clement.mathieu--drif@eviden.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Message-ID: <20260119161112.3841386-4-tangtao1634@phytium.com.cn>
[PMD: Add SPDX-License-Identifier: GPL-2.0-or-later tag]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2026-01-20 19:51:36 +01:00
Richard Henderson
2f4bf8148f tcg: Remove INDEX_op_setcond2_i32
This opcode was exclusively for 32-bit hosts.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-01-17 10:46:18 +11:00
Richard Henderson
e3601d2cfc tcg: Remove INDEX_op_brcond2_i32
This opcode was exclusively for 32-bit hosts.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-01-17 10:46:18 +11:00
Richard Henderson
372ec46b9f meson: Reject 32-bit hosts
32-bit hosts have been deprecated since 10.0.
As the first step, disable any such at configuration time.
Further patches will remove the dead code.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-01-17 10:44:20 +11:00
Peter Maydell
6b65590f4a docs/system/generic-loader: move TODO to source code
Currently we have a "Restrictions and ToDos" section at the bottom of
the document which notes that there's no way to specify a CPU to load
a file through that doesn't also set that CPU's PC.  This is written
as a developer-facing note.  Move this to a TODO comment in the
source code, and provide a shorter user-facing statement of the
current restriction under the specific sub-option that it applies to.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
2026-01-15 15:26:30 +00:00
Peter Maydell
5f8d933407 docs/system/generic-loader: Don't mention QemuOpts implementation detail
We currently say "All values are parsed using the standard QemuOpts
parsing".  This doesn't tell the user anything useful because we
don't mention QemuOpts anywhere else in the docs.  What we're really
trying to tell the user is what we mention afterwards: that the
values are decimal, and you need an 0x prefix for hex.  How we
achieve it is an implementation detail the user doesn't need to know.

Drop the explicit mention of QemuOpts; this in passing removes a typo
"QemuOps" that we made in one place. Put the informative note
more closely associated with the <addr> suboption which is the
one that users might most reasonably assume to default to hex.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
2026-01-15 15:26:30 +00:00
Peter Maydell
1e812f8eb1 docs/system/generic-loader: Clarify behaviour of cpu-num
The cpu-num suboption to the generic loader has two effects when
it is used with -device loader,file=<file>:
 * it specifies which CPU to load the data through
 * it specifies which CPU gets its PC set to the file's entry point

Our documentation is not very clear about what happens if you don't
pass this suboption.  The default is that we pick the first CPU to
load the data, but we don't set the PC for any CPU, so the "If not
specified, the default is CPU 0" is confusing: it applies for loading
but not for the PC setting.

Clarify the text to make it clearer that the option has two effects
and the default behaviour is different for the two effects.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
2026-01-15 15:26:30 +00:00
Jim MacArthur
672a1dd1ed target/arm/tcg/cpu64.c: Enable ASID2 for cpu_max
docs/system/arm/emulation.rst: Add ASID2

Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Signed-off-by: Jim MacArthur <jim.macarthur@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-01-15 15:26:29 +00:00
Zhenzhong Duan
68d3a2a24d Workaround for ERRATA_772415_SPR17
On a system influenced by ERRATA_772415, IOMMU_HW_INFO_VTD_ERRATA_772415_SPR17
is repored by IOMMU_DEVICE_GET_HW_INFO. Due to this errata, even the readonly
range mapped on second stage page table could still be written.

Reference from 4th Gen Intel Xeon Processor Scalable Family Specification
Update, Errata Details, SPR17.
Link https://edc.intel.com/content/www/us/en/design/products-and-solutions/processors-and-chipsets/eagle-stream/sapphire-rapids-specification-update/
Backup https://cdrdv2.intel.com/v1/dl/getContent/772415

Also copied the SPR17 details from above link:
"Problem: When remapping hardware is configured by system software in
scalable mode as Nested (PGTT=011b) and with PWSNP field Set in the
PASID-table-entry, it may Set Accessed bit and Dirty bit (and Extended
Access bit if enabled) in first-stage page-table entries even when
second-stage mappings indicate that corresponding first-stage page-table
is Read-Only.

Implication: Due to this erratum, pages mapped as Read-only in second-stage
page-tables may be modified by remapping hardware Access/Dirty bit updates.

Workaround: None identified. System software enabling nested translations
for a VM should ensure that there are no read-only pages in the
corresponding second-stage mappings."

Introduce a helper vfio_device_get_host_iommu_quirk_bypass_ro to check if
readonly mappings should be bypassed.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Link: https://lore.kernel.org/qemu-devel/20260106062808.316574-5-zhenzhong.duan@intel.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2026-01-13 08:29:59 +01:00
Zhenzhong Duan
ce1e871680 docs/devel: Add IOMMUFD nesting documentation
Add documentation about using IOMMUFD backed VFIO device with intel_iommu with
x-flts=on.

Suggested-by: Yi Liu <yi.l.liu@intel.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Yi Liu <yi.l.liu@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260106061304.314546-20-zhenzhong.duan@intel.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2026-01-13 08:29:59 +01:00
Zhenzhong Duan
8e49988ce0 docs/devel: Remove stale comments related to iommufd dirty tracking
IOMMUFD dirty tracking support had be merged in merge commit dd4bc5f1cf,
the stale comments could be dropped.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20251226073007.1139478-1-zhenzhong.duan@intel.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2026-01-13 08:29:58 +01:00
Richard Henderson
cf3e71d8fc Merge tag 'single-binary-20260112' of https://github.com/philmd/qemu into staging
Various patches related to single binary effort:

- Endianness cleanups in memory core subsystem and for various targets
- Few cleanups around target_ulong type
- Build various compilation units as common

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmlleisACgkQ4+MsLN6t
# wN40yw/+NYK6Q+v8YHclH0g6YkPsXYsCVOLWhYaUQ9Smc3Vk8js02LRMxomGiyjc
# lRhatftrH4dCuiWavyhlK/z+tu3b2WOgjjcIocg7ztZEwzyvDPEKidBNM4Wrv27d
# 6WNdtCn1rOOYQBcCs/MEHnrxIl3qfl5Kqt4hzejcK4E1DFa1m5ashAEVJwMlqYWp
# qkBT3fw0jfHojM+eTAbvKI1fi27GVMXbQXSM3V3vG3njxmx4JQT0p9QjyDYWZwgh
# xAJvy5neoNv3T7TBELCfqSWzGA5WHrW/eAkuRuO0JVa69IOn/mh2aGKboJMT7KQF
# ufyxceHMj8TLJr6c9BrvaWX7+p7xyvbX3ud+qXOV9P2FBVm+hf2lHnw0pJJ6A51g
# qv3u8zUVwhmx6oF95ibQtaWKdLNhGCKtVKJu59Xxj/7Bp00BS1Jnj6E/g34To8Vm
# 18g3cPJ+CEhdTFSkcHusiVI4GdHb8JEGUd5kyWza3gEgYb/J1Ps/a807n6C6NQcq
# MRkt2zNKS+sJeZzvl+BGH8WewMVGWm1f8IoP28ZvgyxFVutkgFcj+UQZp3J7mkpV
# ja0B7+1NMK9oMeq/+YM4gUgEF0ydThlqa+qTzxVYu8qpzWT9+cqqWeQHAteE3g/v
# rqqu/sBUSbh5xi+82zRbgwd7Hj31ST5XkepQN0vUTT4P3zCijy8=
# =P+9/
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 13 Jan 2026 09:48:11 AM AEDT
# gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [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: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE

* tag 'single-binary-20260112' of https://github.com/philmd/qemu: (61 commits)
  target/arm/gdbstub: make compilation unit common
  target/arm/gdbstub: extract aarch64_cpu_register_gdb_regs_for_features
  gdbstub/helpers.h: allow header to be called from common code
  accel/tcg: Un-inline WatchPoint API user-emulation stubs
  target/tricore: Build system units in common source set
  target/tricore: Inline translator_lduw()
  target/tricore: Use little-endian variant of cpu_ld/st_data*()
  target/sparc: Inline cpu_ldl_code() call in cpu_do_interrupt()
  target/sparc: Inline translator_ldl()
  target/sparc: Use explicit big-endian LD/ST API
  hw/sparc: Use explicit big-endian LD/ST API
  hw/sparc: Mark SPARC-specific peripherals as big-endian
  target/sh4: drop cpu_reset from realizefn
  target/sh4: Build system units in common source set
  target/rx: Build system units in common source set
  target/rx: Inline translator_lduw() and translator_ldl()
  target/rx: Use explicit little-endian LD/ST API
  target/rx: Use little-endian variant of cpu_ld/st_data*()
  target/openrisc: Build system units in common source set
  target/openrisc: Avoid target-specific migration headers in machine.c
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-01-13 11:51:18 +11:00
Philippe Mathieu-Daudé
c8c3955424 docs/devel/loads-stores: Fix ld/stn_*_p() regexp
Fixes: afa4f6653d ("bswap: Add stn_*_p() and ldn_*_p() functions")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260109063504.71576-3-philmd@linaro.org>
2026-01-12 23:47:56 +01:00
Ani Sinha
900e9a3adc docs: update copyright year to 2026
We are already in 2026. Update docs to update copyright info to year 2026.

Cc: peter.maydell@linaro.org
Cc: qemu-trivial@nongnu.org
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-ID: <20260107045250.34420-1-anisinha@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2026-01-12 13:53:32 +01:00
Djordje Todorovic
2264f637da hw/riscv: Add support for MIPS Boston-aia board mode
The board model supports up to 64 harts with MIPS CPS, MIPS GCR,
MIPS CPC, AIA plic, and AIA clint devices. The model can create
boot code, if there is no -bios parameter. We can specify -smp x,
cores=y,thread=z.
Ex: Use 4 cores and 2 threads with each core to
have 8 smp cpus as follows.
  qemu-system-riscv64 -cpu mips-p8700 \
  -m 2G -M boston-aia \
  -smp 8,cores=4,threads=2 -kernel fw_payload.bin \
  -drive file=rootfs.ext2,format=raw -serial stdio

Signed-off-by: Chao-ying Fu <cfu@mips.com>
Signed-off-by: Djordje Todorovic <djordje.todorovic@htecgroup.com>
Acked-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260108134128.2218102-11-djordje.todorovic@htecgroup.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2026-01-09 15:13:53 +10:00
Daniel Henrique Barboza
7e89ab5eab docs/specs/riscv-aia.rst: add 'riscv-aia' accel prop info
Add a small section talking about the 'riscv-aia' KVM setting we
implement and how it affects the provisioning of the IMSIC s-mode
in-kernel controller.

While we're at it, fix the formatting of the AIA bullet list.

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20251028084622.1177574-1-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2026-01-09 15:01:09 +10:00
Fabiano Rosas
11d99e98fe tests/functional: Allow tests to be run individually
The functional tests currently don't allow a single test to be
selected for execution by dotted name, e.g:

./build/run tests/functional/ppc64/test_pseries.py PseriesMachine.test_ppc64_linux_boot
                                          ^
The issue is that the testcase.py main function passes the test
module's name as the second argument to unittest.main(), which makes
it ignore all other positional arguments (presumably because the
module is already the superset of all tests).

After commit cac08383f0 ("tests/functional: expose sys.argv to
unittest.main"), the situation improves by passing the rest of the
argv from the command line invocation into unittest.main(), but it
still doesn't fix the issue. The short form options are now accepted,
so the -k option could be used to filter for a pattern, which is
useful, but not the same as listing the test names.

Fix this by passing the test module name via the "module" argument to
unittest.main() and stop touching argv. The ways of invoking tests are
now as per unittests documentation (-k still works):

  Examples:
    test_pseries.py                           - run default set of tests
    test_pseries.py MyTestSuite               - run suite 'MyTestSuite'
    test_pseries.py MyTestCase.testSomething  - run MyTestCase.testSomething
    test_pseries.py MyTestCase                - run all 'test*' test methods in MyTestCase

Note that ever since we've been programatically passing the module
name to unittest.main(), the usage 'test_pseries.py test_pseries' was
never valid. It used to "work" just the same as 'test_pseries.py
foobar' would. After this patch, that usage results in an error.

Also note that testcase.py:main() pertains to running the test module
that invoked it via QemuSystemTest.main(), i.e. module == __main__. So
the 'discover' usage of unittest doesn't apply here, the module is
already discovered because that's where this code was called from to
begin with. This patch could just as well call unittest.main() instead
of unittest.main(test_module), but the latter provides nicer error
messages prefixed with the module name.

Tested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Message-ID: <20260102181700.11886-1-farosas@suse.de>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2026-01-07 09:55:37 +01:00
Jamin Lin
798c442df7 docs/specs/aspeed-intc: Remove GIC 128 - 136
The GIC interrupts 128 - 136 were only used by the AST2700 A0 SoC.
Since the AST2700 A0 has been deprecated, these interrupt
definitions are no longer needed. This commit removes them to
clean up the codebase.

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/20250901040808.1454742-5-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2026-01-05 10:38:02 +01:00
Jamin Lin
e50a021a45 hw/arm: Remove ast2700a0-evb machine
The ast2700a0-evb machine represents the first revision of the AST2700 and
serves as the initial engineering sample rather than a production version.
A newer revision, A1, is now supported, and the ast2700a1-evb should replace
the older A0 version.

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/20250901040808.1454742-2-jamin_lin@aspeedtech.com
[ clg: Updated docs/about/removed-features.rst ]
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2026-01-05 10:38:02 +01:00
Jamin Lin
641455f526 docs/system/arm/aspeed: Update Aspeed MiniBMC section to include AST1060 processor
Added details describing AST1060 as a Platform Root of Trust processor board alongside
AST1030 MiniBMC, and extended the list of missing devices to include
SMBus Filter and QSPI Monitor controllers.

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/20251112030553.291734-13-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2026-01-05 10:38:01 +01:00
Jamin Lin
ec348addb9 docs/system/arm/aspeed: Update Aspeed and 2700 family boards list
Remove the ast2700-evb entry from the Aspeed family boards list in
the documentation. The AST2700 platform now belongs to the new Aspeed
2700 family group, which has its own dedicated documentation section
and board definitions.

Update the Aspeed 2700 family boards list in the documentation to include
the new ast2700fc board entry.

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/20251112030553.291734-12-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2026-01-05 10:38:01 +01:00
Paolo Bonzini
ba773aded3 block: rename block/aio.h to qemu/aio.h
AioContexts are used as a generic event loop even outside the block
layer; move the header file out of block/ just like the implementation
is in util/.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-27 10:11:12 +01:00
Zhao Liu
b3104e721b dosc/cpu-models-x86: Add documentation for DiamondRapids
Current DiamondRapids hasn't supported cache model. Instead, document
its special CPU & cache topology to allow user emulate with "-smp" &
"-machine smp-cache".

Reviewed-by: Yu Chen <yu.c.chen@intel.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20251215073743.4055227-12-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-27 10:11:12 +01:00
Daniel P. Berrangé
757a9c91a6 run: introduce a script for running devel commands
Various aspects of the development workflow are complicated by the need
to set env variables ahead of time, or use specific paths. Meson
provides a 'devenv' command that can be used to launch a command with a
number of appropriate project specific environment variables preset.

By default it will modify $PATH to point to any build directory that
contains a binary built by the project.

This further augments that to replicate the venv 'activate' script:

 * Add $BUILD_DIR/pyvenv/bin to $PATH
 * Set VIRTUAL_ENV to $BUILD_DIR/pyvenv

And then makes functional tests more easily executable

 * Add $SRC_DIR/tests/functional and $SRC_DIR/python to $PYTHONPATH

To see the benefits of this consider this command:

  $ source ./build/pyvenv/bin/activate
  $ ./scripts/qmp/qmp-shell-wrap ./build/qemu-system-x86_64

which is now simplified to

  $ ./build/run ./scripts/qmp/qmp-shell-wrap qemu-system-x86_64 [args..]

This avoids the need repeat './build' several times and avoids polluting
the current terminal's environment and/or avoids errors from forgetting
to source the venv settings.

As another example running functional tests

  $ export PYTHONPATH=./python:./tests/functional
  $ export QEMU_TEST_QEMU_BINARY=./build/qemu-system-x86_64
  $ build/pyvenv/bin/python3 ./tests/functional/x86_64/test_virtio_version.py

which is now simplified to

  $ export QEMU_TEST_QEMU_BINARY=qemu-system-x86_64
  $ ./build/run ./tests/functional/x86_64/test_virtio_version.py

This usefulness of this will be further enhanced with the pending
removal of the QEMU python APIs from git, as that will require the use
of the python venv in even more scenarios that today.

The 'run' script does not let 'meson devenv' directly launch the command
to be run because it always requires $BUILD_DIR as the current working
directory. It is desired that 'run' script always honour the current
working directory of the terminal that invokes is. Thus the '--dump'
flag is used to export the devenv variables into the 'run' script's
shell.

This takes the liberty to assign 'run.in' to the "Build system" section
in the MAINTAINERS file, given that it leverages meson's 'devenv'
feature.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Link: https://lore.kernel.org/r/20251222113859.182395-1-berrange@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-27 10:11:12 +01:00
Paolo Bonzini
4b64d23a7e include: move hw/resettable.h to hw/core/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-27 10:11:08 +01:00
Paolo Bonzini
3e7316044d include: move hw/registerfields.h to hw/core/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-27 10:11:08 +01:00
Paolo Bonzini
78d45220b4 include: move hw/qdev-properties.h to hw/core/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-27 10:11:07 +01:00
Paolo Bonzini
d1000ecae2 include: move hw/qdev-core.h to hw/core/, rename
Call it hw/core/qdev.h to avoid the duplication in the name.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-27 10:11:07 +01:00
Paolo Bonzini
3775d19906 include: move hw/qdev-clock.h to hw/core/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-27 10:11:07 +01:00
Paolo Bonzini
838861a1f9 include: move hw/clock.h to hw/core/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-27 10:11:06 +01:00
Paolo Bonzini
1942b61b74 include: move hw/boards.h to hw/core/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-27 10:11:06 +01:00
Cédric Le Goater
704db3e250 aspeed: Deprecate the fby35 machine
There are no functional tests for the 'fby35' machine which makes
harder to determine when something becomes deprecated or unused.

The 'fby35' machine was originally added as an example of a multi-SoC
system, with the expectation the models would evolve over time in an
heterogeneous system. This hasn't happened and no public firmware is
available to boot it. It can be replaced by the 'ast2700fc', another
multi-SoC machine based on the newer AST2700 SoCs which are excepted
to receive better support in the future.

Cc: Peter Delevoryas <peter@pjd.dev>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Message-ID: <20251126102424.927527-1-clg@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2025-12-05 15:37:18 +00:00