]> git.ipfire.org Git - thirdparty/qemu.git/log
thirdparty/qemu.git
4 months agovirtio-gpu-virgl: correct parent for blob memory region
Joelle van Dyne [Sat, 3 Jan 2026 21:43:59 +0000 (13:43 -0800)] 
virtio-gpu-virgl: correct parent for blob memory region

When `owner` == `mr`, `object_unparent` will crash:

object_unparent(mr) ->
object_property_del_child(mr, mr) ->
object_finalize_child_property(mr, name, mr) ->
object_unref(mr) ->
object_finalize(mr) ->
object_property_del_all(mr) ->
object_finalize_child_property(mr, name, mr) ->
object_unref(mr) ->
fail on g_assert(obj->ref > 0)

However, passing a different `owner` to `memory_region_init` does not
work. `memory_region_ref` has an optimization where it takes a ref
only on the owner. That means when flatviews are created, it does not
take a ref on the region and you can get a UAF from `flatview_destroy`
called from RCU.

The correct fix therefore is to use `NULL` as the name which will set
the `owner` but not the `parent` (which is still NULL). This allows us
to use `memory_region_ref` on itself while not having to rely on unparent
for cleanup.

Signed-off-by: Joelle van Dyne <j@getutm.app>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260103214400.71694-1-j@getutm.app>

4 months agoMAINTAINERS: Update VIOT maintainer
Jean-Philippe Brucker [Tue, 30 Dec 2025 15:48:45 +0000 (15:48 +0000)] 
MAINTAINERS: Update VIOT maintainer

Unfortunately I can't contribute to QEMU for the time being, but Eric
has offered to take on maintainership of the ACPI VIOT. Thank you!

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251230154844.325364-2-jean-philippe@linaro.org>

4 months agocryptodev-builtin: Limit the maximum size
zhenwei pi [Sun, 21 Dec 2025 02:43:21 +0000 (10:43 +0800)] 
cryptodev-builtin: Limit the maximum size

This backend driver is used for demonstration purposes only, unlimited
size leads QEMU OOM.

Fixes: CVE-2025-14876
Fixes: 1653a5f3fc7 ("cryptodev: introduce a new cryptodev backend")
Reported-by: 이재영 <nakamurajames123@gmail.com>
Signed-off-by: zhenwei pi <zhenwei.pi@linux.dev>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251221024321.143196-3-zhenwei.pi@linux.dev>

4 months agohw/virtio/virtio-crypto: verify asym request size
zhenwei pi [Sun, 21 Dec 2025 02:43:20 +0000 (10:43 +0800)] 
hw/virtio/virtio-crypto: verify asym request size

The total lenght of request is limited by cryptodev config, verify it
to avoid unexpected request from guest.

Fixes: CVE-2025-14876
Fixes: 0e660a6f90a ("crypto: Introduce RSA algorithm")
Reported-by: 이재영 <nakamurajames123@gmail.com>
Signed-off-by: zhenwei pi <zhenwei.pi@linux.dev>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251221024321.143196-2-zhenwei.pi@linux.dev>

4 months agovirtio-spi: Add vhost-user-spi device support
Haixu Cui [Tue, 16 Dec 2025 03:21:22 +0000 (11:21 +0800)] 
virtio-spi: Add vhost-user-spi device support

This patch introduces support for vhost-user-spi and vhost-user-spi-pci
devices in QEMU, enabling virtio-based SPI communication via the vhost-user
protocol.

The implementation follows the virtio-spi specification and leverages
the upstream virtio-spi driver in Linux. Relevant references:

- Virtio SPI specification:
  https://github.com/oasis-tcs/virtio-spec/tree/master/device-types/spi
- Linux virtio-spi driver:
  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/spi/spi-virtio.c?h=v6.18-rc3
- vhost-user-spi daemon:
  https://github.com/rust-vmm/vhost-device/tree/main/vhost-device-spi

Example usage with rust-vmm vhost-user-spi daemon:

Start the vhost-user-spi daemon:
    vhost-device-spi --socket-path=vspi.sock --socket-count=1 \
        --device "/dev/spidev0.0"

Launch QEMU with:
    qemu-system-aarch64 -m 1G \
        -chardev socket,path=/home/root/vspi.sock0,id=vspi \
        -device vhost-user-spi-device,chardev=vspi,id=spi \
        -object memory-backend-file,id=mem,size=1G,mem-path=/dev/shm,share=on \
        -numa node,memdev=mem

Signed-off-by: Haixu Cui <quic_haixcui@quicinc.com>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251216032122.1316684-3-quic_haixcui@quicinc.com>

4 months agostandard-headers: Update virtio_spi.h from Linux v6.18-rc3
Haixu Cui [Tue, 16 Dec 2025 03:21:21 +0000 (11:21 +0800)] 
standard-headers: Update virtio_spi.h from Linux v6.18-rc3

Synced virtio_spi.h from upstream Linux kernelusing
scripts/update-linux-headers.sh.

Source:
- Linux commit dcb6fa37fd7bc9c3d2b066329b0d27dedf8becaa (v6.18-rc3)
- Author: Linus Torvalds <torvalds@linux-foundation.org>
- Date:   Sun Oct 26 15:59:49 2025 -0700

This update ensures QEMU's standard headers are consistent with the latest
virtio SPI definitions from Linux v6.18-rc3.

Signed-off-by: Haixu Cui <quic_haixcui@quicinc.com>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251216032122.1316684-2-quic_haixcui@quicinc.com>

4 months agoq35: Fix migration of SMRAM state
Igor Mammedov [Thu, 11 Dec 2025 16:54:54 +0000 (17:54 +0100)] 
q35: Fix migration of SMRAM state

When migrating, dst QEMU by default has SMRAM unlocked,
and since wmask is not migrated, the migrated value of
MCH_HOST_BRIDGE_F_SMBASE in config space fall to prey of

  mch_update_smbase_smram()
    ...
    if (pd->wmask[MCH_HOST_BRIDGE_F_SMBASE] == 0xff) {
        *reg = 0x00;

and is getting cleared and leads to unlocked smram
on dst even if on source it's been locked.

As Andrey has pointed out [1], we should derive wmask
from config and not other way around.

Drop offending chunk and resync wmask based on MCH_HOST_BRIDGE_F_SMBASE
register value. That would preserve the register during
migration and set smram regions into corresponding state.

What that changes is:
that it would let guest write junk values in register
(with no apparent effect) until it's stumbles upon
reserved 0x1 [|] 0x2 values, at which point it
would be only possible to lock register and trigger
switch to SMRAM blackhole in CPU AS.

While at it, fix up test by removing junk discard before negotiation hunk.

PS2:
Instead of adding a dedicated post_load handler for it,
reuse mch_update->mch_update_smbase_smram call chain
that is called on write/reset/post_load to be consistent
with how we handle mch registers.

PS3:
for prosterity here is erro message Andrey got due to this bug:
    qemu: vfio_container_dma_map(0x..., 0x0, 0xa0000, 0x....) = -22 (Invalid argument)
    qemu: hardware error: vfio: DMA mapping failed, unable to continue

1) https://patchew.org/QEMU/20251203180851.6390-1-arbn@yandex-team.com/

Fixes: f404220e279c ("q35: implement 128K SMRAM at default SMBASE address")
Reported-by: Andrey Ryabinin <arbn@yandex-team.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Andrey Ryabinin <arbn@yandex-team.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251211165454.288476-1-imammedo@redhat.com>

4 months agopcie_sriov: Fix PCI_SRIOV_* accesses in pcie_sriov_pf_exit()
Kevin Wolf [Fri, 5 Dec 2025 14:57:18 +0000 (15:57 +0100)] 
pcie_sriov: Fix PCI_SRIOV_* accesses in pcie_sriov_pf_exit()

PCI_SRIOV_* are offsets into the SR-IOV capability, not into the PCI
config space. pcie_sriov_pf_exit() erroneously takes them as the latter,
which makes it read PCI_HEADER_TYPE and PCI_BIST when it tries to read
PCI_SRIOV_TOTAL_VF.

In many cases we're lucky enough that the PCI config space will be 0
there, so we just skip the whole for loop, but this isn't guaranteed.
For example, setting the multifunction bit on the PF and then doing a
'device_del' on it will get a larger number and cause a segfault.

Fix this and access the real PCI_SRIOV_* fields in the capability.

Cc: qemu-stable@nongnu.org
Fixes: 19e55471d4e8 ('pcie_sriov: Allow user to create SR-IOV device')
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251205145718.55136-1-kwolf@redhat.com>

4 months agovirtio: Fix crash when sriov-pf is set for non-PCI-Express device
Kevin Wolf [Thu, 4 Dec 2025 17:26:57 +0000 (18:26 +0100)] 
virtio: Fix crash when sriov-pf is set for non-PCI-Express device

Setting the sriov-pf property on devices that aren't PCI Express causes
an assertion failure:

    $ qemu-system-x86_64 \
        -blockdev null-co,node-name=null \
        -blockdev null-co,node-name=null2 \
        -device virtio-blk,drive=null,id=pf \
        -device virtio-blk,sriov-pf=pf,drive=null2
    qemu-system-x86_64: ../hw/pci/pcie.c:1062: void pcie_add_capability(PCIDevice *, uint16_t, uint8_t, uint16_t, uint16_t): Assertion `offset >= PCI_CONFIG_SPACE_SIZE' failed.

This is because proxy->last_pcie_cap_offset is only initialised to a
non-zero value in virtio_pci_realize() if it's a PCI Express device, and
then virtio_pci_device_plugged() still tries to use it.

To fix this, just skip the SR-IOV code for !pci_is_express(). Then the
next thing pci_qdev_realize() does is call pcie_sriov_register_device(),
which returns the appropriate error.

Cc: qemu-stable@nongnu.org
Fixes: d0c280d3fac6 ('pcie_sriov: Make a PCI device with user-created VF ARI-capable')
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251204172657.174391-1-kwolf@redhat.com>

4 months agovirtio-dmabuf: Ensure UUID persistence for hash table insertion
Dorinda Bassey [Thu, 4 Dec 2025 16:20:13 +0000 (17:20 +0100)] 
virtio-dmabuf: Ensure UUID persistence for hash table insertion

In `virtio_add_resource` function, the UUID used as a key for
`g_hash_table_insert` was temporary, which could lead to
invalid lookups when accessed later. This patch ensures that
the UUID remains valid by duplicating it into a newly allocated
memory space. The value is then inserted into the hash table
with this persistent UUID key to ensure that the key stored in
the hash table remains valid as long as the hash table entry
exists.

Fixes: faefdba847 ("hw/display: introduce virtio-dmabuf")
Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Albert Esteve <aesteve@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Jim MacArthur <jim.macarthur@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251204162129.262745-1-dbassey@redhat.com>

4 months agovhost: accept indirect descriptors in shadow virtqueue
Eugenio Pérez [Mon, 1 Dec 2025 12:51:49 +0000 (13:51 +0100)] 
vhost: accept indirect descriptors in shadow virtqueue

The device is not able to generate indirect descriptors by itself, only
the driver can do it.  And SVQ is already able to handle them by reusing
VirtQueue struct.

Shadow VirtQueue just transform the indirect descriptors to chained
buffers.  This way we don't need to map a new buffer for the indirect
table and handle its exhaustion etc.  As they are only used in control
plane and HW devices don't like indirect, we should not see significant
downsides with these.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
--

Tested functionally by forwarding the CVQ descriptors.

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: <20251201125149.2151026-1-eperezma@redhat.com>

4 months agoacpi/ghes: Use error_fatal in acpi_ghes_memory_errors()
Gavin Shan [Mon, 1 Dec 2025 14:18:03 +0000 (00:18 +1000)] 
acpi/ghes: Use error_fatal in acpi_ghes_memory_errors()

Use error_fatal in acpi_ghes_memory_errors() so that the caller needn't
explicitly call exit(). The return value of acpi_ghes_memory_errors()
and ghes_record_cper_errors() is changed to 'bool' indicating an error
has been raised, to be compatible with what's documented in error.h.

Suggested-by: Igor Mammedov <imammedo@redhat.com>
Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251201141803.2386129-6-gshan@redhat.com>

4 months agoacpi/ghes: Bail early on error from get_ghes_source_offsets()
Gavin Shan [Mon, 1 Dec 2025 14:18:02 +0000 (00:18 +1000)] 
acpi/ghes: Bail early on error from get_ghes_source_offsets()

In ghes_record_cper_errors(), get_ghes_source_offsets() can return
a error initialized by error_setg(). Without bailing on this error,
it can call into the second error_setg() due to the unexpected value
returned from the read acknowledgement register. The second error_setg()
can trigger assert(*errp == NULL) in its callee error_setv(), which
isn't expected.

Bail early in ghes_record_cper_errors() when error is received from
get_ghes_source_offsets() to avoid the unexpected behavior.

Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251201141803.2386129-5-gshan@redhat.com>

4 months agotarget/arm/kvm: Exit on error from acpi_ghes_memory_errors()
Gavin Shan [Mon, 1 Dec 2025 14:18:01 +0000 (00:18 +1000)] 
target/arm/kvm: Exit on error from acpi_ghes_memory_errors()

A core dump is no sense as there isn't programming bugs related to
errors from acpi_ghes_memory_errors().

Exit instead of abort when the function returns errors, and the
excessive error message is also dropped.

Suggested-by: Igor Mammedov <imammedo@redhat.com>
Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251201141803.2386129-4-gshan@redhat.com>

4 months agoacpi/ghes: Abort in acpi_ghes_memory_errors() if necessary
Gavin Shan [Mon, 1 Dec 2025 14:18:00 +0000 (00:18 +1000)] 
acpi/ghes: Abort in acpi_ghes_memory_errors() if necessary

The function hw/acpi/ghes-stub.c::acpi_ghes_memory_errors() shouldn't
be called by any one. Take g_assert_not_reached() as a clearer indication.

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251201141803.2386129-3-gshan@redhat.com>

4 months agoacpi/ghes: Automate data block cleanup in acpi_ghes_memory_errors()
Gavin Shan [Mon, 1 Dec 2025 14:17:59 +0000 (00:17 +1000)] 
acpi/ghes: Automate data block cleanup in acpi_ghes_memory_errors()

Use g_auto_ptr() to automate data block cleanup in the function so
that it won't be a burden to us.

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251201141803.2386129-2-gshan@redhat.com>

4 months agovdpa: fix vhost-vdpa suspended state not be shared
Wafer Xie [Wed, 19 Nov 2025 13:24:52 +0000 (21:24 +0800)] 
vdpa: fix vhost-vdpa suspended state not be shared

When stopping a vhost-vdpa device, only the first queue pair is marked as suspended,
while the remaining queues are not updated to the suspended state.
As a result, when stopping a multi-queue vhost-vdpa device,
the following error message will be printed.

qemu-system-x86_64:vhost VQ 2 ring restore failed: -1: Operation not permitted (1)

qemu-system-x86_64:vhost VQ 3 ring restore failed: -1: Operation not permitted (1)

So move v->suspended to v->shared, and then all the vhost_vdpa devices cannot
have different suspended states.

Fixes: 0bb302a9960a ("vdpa: add vhost_vdpa_suspend")
Suggested-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Wafer Xie <wafer@jaguarmicro.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20251119132452.3117-1-wafer@jaguarmicro.com>

4 months agovirtio/vhost: don't consider non-MAP_SHARED regions public
Daniil Tatianin [Thu, 13 Nov 2025 08:58:42 +0000 (11:58 +0300)] 
virtio/vhost: don't consider non-MAP_SHARED regions public

Just having a file descriptor is not enough to consider a memory region
public. If QEMU didn't map it as MAP_SHARED (in case of share=off), guest
writes to this region won't be visible to the vhost-user backend, thus
causing it to read all zeroes or garbage. Make sure we don't pass such
regions and include that to our definition of what a private region is.

Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Fixes: 552b25229c ("vhost: Rework memslot filtering and fix "used_memslot" tracking")
Acked-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251113085842.323745-1-d-tatianin@yandex-team.ru>

4 months agoMerge tag 'pull-aspeed-20260204' of https://github.com/legoater/qemu into staging
Peter Maydell [Thu, 5 Feb 2026 09:50:33 +0000 (09:50 +0000)] 
Merge tag 'pull-aspeed-20260204' of https://github.com/legoater/qemu into staging

aspeed queue:

* Added support for the new AST1700 IO expander, including several
  device models (LTPI, PWM, I2C, GPIO, etc.).
* Updated the AST2700 SoC with LTPI support, EHCI IRQ fixes, and other
  improvements.
* Updated test images and test cases for various Aspeed platforms.
* Fixed issues in the Aspeed I2C and ADC models.
* Added support for pca9535 GPIO expander.
* Updated documentation for Aspeed boards.

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEoPZlSPBIlev+awtgUaNDx8/77KEFAmmDH8EACgkQUaNDx8/7
# 7KEJShAAulFE612LVWb+FAnuqf4StOA8qHbK3zDVG8ki7IC9vfOdS5guRwJgy5bU
# rbCYxSudRe50uRct+3c2mxPEsUpFUwfthA8w36BGZoSxxugLSoBzJto3Om1UH/rQ
# ZMZerg6Aze0oab2Df98TTceSi4el76owKRAabnOAOS7n24BKxTgn4dN2weRyWT0d
# 7AemIMqjtRhT27JBoB8vHsmdNlSDzI+eR2nyHJqvd0u3DHKBVxk0UH/DyTnJ5/4i
# A7d4Oxi28rEG+VJVG5vLfJi+is1sggoGxfX3SQmWKronODn3aNkWk93dR+kljMGo
# pXyqMQn8JJZZtRRSGAMflIdYvYLmpQkyUGR6kufdMn4EshALwLa5bObx6qb7RLyG
# CfS0gIR1O9zTS6w7kzifF4N2/iYlIReoIs8IiYFCcef8kmu/UToipQtUIllZN3q5
# pNTlruoylqbctyaqrtwHV2tiPxO4N+Y7voX68YtXWIVzLChQiAwz6osdP+JO1txq
# ePi3R0nAI9wks3NR206LRO45OFKP4IPgfAbMMq5aeDEpIbxU/qAEtTglwUUPby9o
# E8D15vukcYWuobvVqnKX7IzWGoGzJX5QU0wbO5pfDUc8BtQtdL9nOaSTDX3o+chK
# KNcuG91mQLlGe86OpysoK6N+PNwLvnWy8Su5x3HF0wNQ0PTASkw=
# =APEm
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed Feb  4 10:30:25 2026 GMT
# gpg:                using RSA key A0F66548F04895EBFE6B0B6051A343C7CFFBECA1
# gpg: Good signature from "Cédric Le Goater <clg@redhat.com>" [full]
# gpg:                 aka "Cédric Le Goater <clg@kaod.org>" [full]
# Primary key fingerprint: A0F6 6548 F048 95EB FE6B  0B60 51A3 43C7 CFFB ECA1

* tag 'pull-aspeed-20260204' of https://github.com/legoater/qemu: (45 commits)
  tests/functional/aarch64: Add I2C test for AST1700 IO expanders
  tests/functional/aarch64: Parameterize PCIe2 initialization in AST2700
  tests/functional/aarch64: Parameterize I2C bus ID in AST2700 test
  hw/arm/aspeed: Enable AST1700 IO expander support
  hw/arm/aspeed: Model AST1700 I3C block as unimplemented device
  hw/arm/aspeed: Attach SGPIOM device to AST1700 model
  hw/arm/aspeed: Attach PWM device to AST1700 model
  hw/arm/aspeed: Attach WDT device to AST1700 model
  hw/arm/aspeed: attach I2C device to AST1700 model
  hw/arm/aspeed: Attach GPIO device to AST1700 model
  hw/arm/aspeed: Attach SCU device to AST1700 model
  hw/arm/aspeed: Attach ADC device to AST1700 model
  hw/arm/aspeed: Attach SPI device to AST1700 model
  hw/arm/aspeed: Attach SRAM device to AST1700 model
  hw/arm/aspeed: Attach UART device to AST1700 model
  hw/arm/aspeed: Attach LTPI controller to AST1700 model
  hw/arm/aspeed: Integrate interrupt controller for AST1700
  hw/arm/aspeed: Integrate AST1700 device into AST27X0
  hw/arm/aspeed: Add AST1700 LTPI expander device model
  hw/misc: Add basic Aspeed PWM model
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 months agointel_iommu: Add a CLI option to enable SVM
CLEMENT MATHIEU--DRIF [Wed, 29 Oct 2025 10:51:46 +0000 (10:51 +0000)] 
intel_iommu: Add a CLI option to enable SVM

Signed-off-by: Clement Mathieu--Drif <clement.mathieu--drif@eviden.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251029105137.1097933-8-clement.mathieu--drif@eviden.com>

4 months agointel_iommu: Minimal handling of privileged ATS request
CLEMENT MATHIEU--DRIF [Wed, 29 Oct 2025 10:51:45 +0000 (10:51 +0000)] 
intel_iommu: Minimal handling of privileged ATS request

The purpose of this commit is not to support privileged requests but
to prevent devices from doing things they wouldn't be able to do
with real hardware.

We simply block privileged requests when the SRS ecap is not set
and abort when the ecap is present.

For now, its not worth implementing support for privileged requests
because the kernel does not support it.
(https://lore.kernel.org/linux-iommu/20230411064815.31456-11-baolu.lu@linux.intel.com/)
However, we may consider working on it depending on how the development
goes in the kernel.

Signed-off-by: Clement Mathieu--Drif <clement.mathieu--drif@eviden.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251029105137.1097933-7-clement.mathieu--drif@eviden.com>

4 months agointel_iommu: Handle insufficient permissions during translation requests
CLEMENT MATHIEU--DRIF [Wed, 29 Oct 2025 10:51:45 +0000 (10:51 +0000)] 
intel_iommu: Handle insufficient permissions during translation requests

ATS translations should not fail when the write permission is not set.

Signed-off-by: Clement Mathieu--Drif <clement.mathieu--drif@eviden.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251029105137.1097933-6-clement.mathieu--drif@eviden.com>

4 months agopci: Block ATS requests when privileged mode is disabled
CLEMENT MATHIEU--DRIF [Wed, 29 Oct 2025 10:51:44 +0000 (10:51 +0000)] 
pci: Block ATS requests when privileged mode is disabled

Signed-off-by: Clement Mathieu--Drif <clement.mathieu--drif@eviden.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251029105137.1097933-5-clement.mathieu--drif@eviden.com>

4 months agopcie: Add a function to check if pasid privileged mode is enabled
CLEMENT MATHIEU--DRIF [Wed, 29 Oct 2025 10:51:43 +0000 (10:51 +0000)] 
pcie: Add a function to check if pasid privileged mode is enabled

Signed-off-by: Clement Mathieu--Drif <clement.mathieu--drif@eviden.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251029105137.1097933-4-clement.mathieu--drif@eviden.com>

4 months agointel_iommu: Support memory operations with pre-translated addresses
CLEMENT MATHIEU--DRIF [Wed, 29 Oct 2025 10:51:42 +0000 (10:51 +0000)] 
intel_iommu: Support memory operations with pre-translated addresses

Signed-off-by: Clement Mathieu--Drif <clement.mathieu--drif@eviden.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251029105137.1097933-3-clement.mathieu--drif@eviden.com>

4 months agointel_iommu: Add an IOMMU index for pre-translated addresses
CLEMENT MATHIEU--DRIF [Wed, 29 Oct 2025 10:51:41 +0000 (10:51 +0000)] 
intel_iommu: Add an IOMMU index for pre-translated addresses

Signed-off-by: Clement Mathieu--Drif <clement.mathieu--drif@eviden.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251029105137.1097933-2-clement.mathieu--drif@eviden.com>

4 months agohw/pci-host: Set DEVICE_CATEGORY_BRIDGE once in parent class_init()
Philippe Mathieu-Daudé [Mon, 27 Oct 2025 11:23:06 +0000 (12:23 +0100)] 
hw/pci-host: Set DEVICE_CATEGORY_BRIDGE once in parent class_init()

No need to set DEVICE_CATEGORY_BRIDGE for each device
implementing TYPE_PCI_HOST_BRIDGE: set it once in the
parent.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20251027112306.57634-1-philmd@linaro.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251027112306.57634-1-philmd@linaro.org>

4 months agopci/shpc: Do not unparent in instance_finalize()
Akihiko Odaki [Mon, 27 Oct 2025 01:24:18 +0000 (10:24 +0900)] 
pci/shpc: Do not unparent in instance_finalize()

Children are automatically unparented so manually unparenting is
unnecessary.

Worse, automatic unparenting happens before the instance_finalize()
callback of the parent gets called, so object_unparent() calls in
the callback will refer to objects that are already unparented, which
is semantically incorrect.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20251027-shpc-v1-1-00e9b20a355d@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251027-shpc-v1-1-00e9b20a355d@rsg.ci.i.u-tokyo.ac.jp>

4 months agotests/functional/aarch64: Add I2C test for AST1700 IO expanders
Kane Chen [Wed, 4 Feb 2026 08:21:46 +0000 (08:21 +0000)] 
tests/functional/aarch64: Add I2C test for AST1700 IO expanders

Extend the AST2700 test suite to verify I2C connectivity on AST1700
IO expanders using the DCSCM image. This validates the new bus-label
naming scheme by testing communication on both primary and
expander-attached I2C buses.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-23-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agotests/functional/aarch64: Parameterize PCIe2 initialization in AST2700
Kane Chen [Wed, 4 Feb 2026 08:21:44 +0000 (08:21 +0000)] 
tests/functional/aarch64: Parameterize PCIe2 initialization in AST2700

The current AST2700 functional test forces PCIe2 enablement by manually
manipulating U-Boot env and FDT via the console. This sequence
interferes with test cases that rely on the default boot flow of the
image.

Introduce a 'enable_pcie' parameter (defaulting to True) to both
'verify_openbmc_boot_start' and 'verify_openbmc_boot_and_login' methods.
This allow test cases to toggle the PCIe2 initialization sequence based
on their specific requirements without breaking standard boot tests.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-22-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agotests/functional/aarch64: Parameterize I2C bus ID in AST2700 test
Kane Chen [Wed, 4 Feb 2026 08:21:43 +0000 (08:21 +0000)] 
tests/functional/aarch64: Parameterize I2C bus ID in AST2700 test

The current Aspeed AST2700 functional test case strictly uses I2C bus
1 for its sensor tests. This hard-coded approach prevents the test
logic from being reused for other machine types or configurations
where I2C bus 1 might be disabled or where a different bus needs to
be verified (e.g., I2C expanders).

This refactoring allows the same I2C verification logic to be shared
across different test scenarios by simply passing the target bus
number.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-21-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: Enable AST1700 IO expander support
Kane Chen [Wed, 4 Feb 2026 08:21:42 +0000 (08:21 +0000)] 
hw/arm/aspeed: Enable AST1700 IO expander support

Set ioexp_num to 2 to enable AST1700 IO expander support.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-20-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: Model AST1700 I3C block as unimplemented device
Kane Chen [Wed, 4 Feb 2026 08:21:40 +0000 (08:21 +0000)] 
hw/arm/aspeed: Model AST1700 I3C block as unimplemented device

AST1700 exposes more I3C buses than the current dummy I3C model
provides. When Linux probes the I3C devices on AST1700 this mismatch
can trigger a kernel panic. Model the I3C block as an unimplemented
device to make the missing functionality explicit and avoid unexpected
side effects.

This wires up the I3C interrupt lines for the IO expanders and adds the
corresponding device entries for the AST1700 model.

No functional I3C emulation is provided yet; this only prevents crashes and
documents the missing piece.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-19-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: Attach SGPIOM device to AST1700 model
Kane Chen [Wed, 4 Feb 2026 08:21:39 +0000 (08:21 +0000)] 
hw/arm/aspeed: Attach SGPIOM device to AST1700 model

Connect the SGPIOM device to AST1700 model.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-18-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: Attach PWM device to AST1700 model
Kane Chen [Wed, 4 Feb 2026 08:21:38 +0000 (08:21 +0000)] 
hw/arm/aspeed: Attach PWM device to AST1700 model

Connect the PWM device to AST1700 model.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-17-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: Attach WDT device to AST1700 model
Kane Chen [Wed, 4 Feb 2026 08:21:36 +0000 (08:21 +0000)] 
hw/arm/aspeed: Attach WDT device to AST1700 model

Connect the WDT device to AST1700 model.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-16-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: attach I2C device to AST1700 model
Kane Chen [Wed, 4 Feb 2026 08:21:35 +0000 (08:21 +0000)] 
hw/arm/aspeed: attach I2C device to AST1700 model

Connect the I2C controller to the AST1700 model by mapping its MMIO
region and wiring its interrupt line.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-15-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: Attach GPIO device to AST1700 model
Kane Chen [Wed, 4 Feb 2026 08:21:33 +0000 (08:21 +0000)] 
hw/arm/aspeed: Attach GPIO device to AST1700 model

Connect the GPIO controller to the AST1700 model by mapping its MMIO
region and wiring its interrupt line.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-14-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: Attach SCU device to AST1700 model
Kane Chen [Wed, 4 Feb 2026 08:21:31 +0000 (08:21 +0000)] 
hw/arm/aspeed: Attach SCU device to AST1700 model

Connect the SCU device to AST1700 model.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-13-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: Attach ADC device to AST1700 model
Kane Chen [Wed, 4 Feb 2026 08:21:30 +0000 (08:21 +0000)] 
hw/arm/aspeed: Attach ADC device to AST1700 model

Connect the ADC device to AST1700 model.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-12-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: Attach SPI device to AST1700 model
Kane Chen [Wed, 4 Feb 2026 08:21:28 +0000 (08:21 +0000)] 
hw/arm/aspeed: Attach SPI device to AST1700 model

Connect the SPI device to AST1700 model.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-11-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: Attach SRAM device to AST1700 model
Kane Chen [Wed, 4 Feb 2026 08:21:26 +0000 (08:21 +0000)] 
hw/arm/aspeed: Attach SRAM device to AST1700 model

Map the SRAM device to AST1700 model

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-10-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: Attach UART device to AST1700 model
Kane Chen [Wed, 4 Feb 2026 08:21:25 +0000 (08:21 +0000)] 
hw/arm/aspeed: Attach UART device to AST1700 model

Connect the UART controller to the AST1700 model by mapping its MMIO
region.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-9-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: Attach LTPI controller to AST1700 model
Kane Chen [Wed, 4 Feb 2026 08:21:24 +0000 (08:21 +0000)] 
hw/arm/aspeed: Attach LTPI controller to AST1700 model

Connect the LTPI controller to the AST1700 model by mapping its MMIO
region.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-8-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: Integrate interrupt controller for AST1700
Kane Chen [Wed, 4 Feb 2026 08:21:22 +0000 (08:21 +0000)] 
hw/arm/aspeed: Integrate interrupt controller for AST1700

Connect the AST1700 interrupt lines to the GIC in AST27X0, enabling
the propagation of AST1700-originated interrupts to the host SoC.

This patch does not implement interrupt sources in AST1700 itself,
only the wiring into AST27X0.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-7-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: Integrate AST1700 device into AST27X0
Kane Chen [Wed, 4 Feb 2026 08:21:21 +0000 (08:21 +0000)] 
hw/arm/aspeed: Integrate AST1700 device into AST27X0

Connect the AST1700 device as a child of the AST27X0 model to reflect
its role in DC-SCM 2.0 LTPI-based architectures. This patch wires
the AST1700 device into the platform without introducing functional
peripherals.

This forms the base for LTPI expander emulation in QEMU using
AST27X0 as the host controller.

Note: ioexp_num is set to 0 at this stage. Once all related devices
and interrupts are fully implemented, ioexp_num will be updated to
its expected value. This ensures the machine remains functional at
every commit and avoids potential compiler or build issues.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-6-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: Add AST1700 LTPI expander device model
Kane Chen [Wed, 4 Feb 2026 08:21:19 +0000 (08:21 +0000)] 
hw/arm/aspeed: Add AST1700 LTPI expander device model

Introduce a minimal QEMU device model for the ASPEED AST1700, an
MCU-less I/O expander used in the LTPI topology defined by the
DC-SCM 2.0 specification (see figure 2):
https://www.opencompute.org/documents/ocp-dc-scm-2-0-ltpi-ver-1-0-pdf

This initial implementation includes:

* Definition of aspeed.ast1700 as a SysBusDevice

* Setup of a basic memory region to reserve I/O space for future
  peripheral modeling

This stub establishes the foundation for LTPI-related device emulation,
without implementing any functional peripherals at this stage.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-5-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/misc: Add basic Aspeed PWM model
Kane Chen [Wed, 4 Feb 2026 08:21:18 +0000 (08:21 +0000)] 
hw/misc: Add basic Aspeed PWM model

Add an initial PWM model for Aspeed SoCs, including device state,
register definitions, and basic initialization as a sysbus device.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-4-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: Attach LTPI controller to AST27X0 platform
Kane Chen [Wed, 4 Feb 2026 08:21:17 +0000 (08:21 +0000)] 
hw/arm/aspeed: Attach LTPI controller to AST27X0 platform

Connect the LTPI controller device (representing the AST1700 I/O
expander) to the AST27X0 SoC model. This patch sets up the memory
mapping and device registration according to the AST2700 SoC design,
where the LTPI controller is exposed at fixed MMIO regions.

This change only handles device instantiation and integration,
without implementing the controller's internal logic.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-3-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/misc: Add LTPI controller
Kane Chen [Wed, 4 Feb 2026 08:21:15 +0000 (08:21 +0000)] 
hw/misc: Add LTPI controller

LTPI (LVDS Tunneling Protocol & Interface) is defined in the OCP DC-SCM
2.0 specification:
https://www.opencompute.org/documents/ocp-dc-scm-2-0-ltpi-ver-1-0-pdf

LTPI is a protocol and physical interface for tunneling various low-speed
signals between the HPM and SCM. As shown in Figure 2, the AST27x0 (left)
integrates two LTPI controllers, allowing it to connect to up to two
extended boards.

This commit introduces a simple device model for the ASPEED LTPI
controller in QEMU.

The model includes basic MMIO read/write operations and sets default
register values during reset to emulate a link-up state.

Implements register space with read/write callbacks.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-2-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agodocs/system/arm/aspeed: Load raw U-Boot image in AST2700 boot example
Jamin Lin [Tue, 3 Feb 2026 02:08:53 +0000 (10:08 +0800)] 
docs/system/arm/aspeed: Load raw U-Boot image in AST2700 boot example

Recent SDK versions no longer provide a U-Boot FIT image, and U-Boot is
now built as a single raw binary. Update the documentation to load the
raw u-boot.bin image directly.

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/20260203020855.1642884-9-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agotests/functional/aarch64/test_aspeed_ast2700fc: Update test ASPEED SDK v11.00 for A1
Jamin Lin [Tue, 3 Feb 2026 02:08:52 +0000 (10:08 +0800)] 
tests/functional/aarch64/test_aspeed_ast2700fc: Update test ASPEED SDK v11.00 for A1

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/20260203020855.1642884-8-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agotests/functional/aarch64/test_aspeed_ast2700: Update test ASPEED SDK v11.00 for A1
Jamin Lin [Tue, 3 Feb 2026 02:08:51 +0000 (10:08 +0800)] 
tests/functional/aarch64/test_aspeed_ast2700: Update test ASPEED SDK v11.00 for A1

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/20260203020855.1642884-7-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agotests/functional/aarch64/test_aspeed_ast2700: Enable PCIe2 DTS status for AST2700...
Jamin Lin [Tue, 3 Feb 2026 02:08:50 +0000 (10:08 +0800)] 
tests/functional/aarch64/test_aspeed_ast2700: Enable PCIe2 DTS status for AST2700 tests

PCIe2 is disabled by default starting from SDK v10.00.

Add a helper function to stop U-Boot autoboot and update the device
tree at runtime, setting the PCIe2 node status to "okay" before
booting Linux. This allows the AST2700 functional test to verify
the PCIe2 root complex behavior correctly.

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/20260203020855.1642884-6-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/i2c/aspeed_i2c: Fix DMA moving data into incorrect address
Jamin Lin [Tue, 3 Feb 2026 02:08:49 +0000 (10:08 +0800)] 
hw/i2c/aspeed_i2c: Fix DMA moving data into incorrect address

In the previous design, the I2C model updated dma_dram_offset only when
firmware programmed the RX/TX DMA buffer address registers. The firmware
used to rewrite these registers before issuing each DMA command.

The firmware driver behavior has changed to program the DMA address
registers only once during I2C initialization. As a result, the I2C model
no longer refreshes dma_dram_offset, causing DMA to move data into an
incorrect DRAM address.

Fix this by introducing helper functions to update dma_dram_offset from
the DMA address registers, and invoke them right before handling TX/RX
DMA operations. This guarantees DMA always uses the correct buffer
address even if the registers are programmed only once.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Fixes: c400c38854017eeccda63115814eba4c3ef2b51f ("hw/i2c/aspeed: Introduce a new dma_dram_offset attribute in AspeedI2Cbus")
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260203020855.1642884-5-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed_ast27x0: Sort SSP and TSP IRQ maps
Jamin Lin [Tue, 3 Feb 2026 02:08:48 +0000 (10:08 +0800)] 
hw/arm/aspeed_ast27x0: Sort SSP and TSP IRQ maps

Sort the SSP and TSP IRQ map tables to improve readability and make the
definitions easier to maintain.

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/20260203020855.1642884-4-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed_ast27x0: Sort SSP and TSP memmap tables by address
Jamin Lin [Tue, 3 Feb 2026 02:08:47 +0000 (10:08 +0800)] 
hw/arm/aspeed_ast27x0: Sort SSP and TSP memmap tables by address

Sort the SSP and TSP memmap tables to improve readability and
make the definitions easier to maintain.

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/20260203020855.1642884-3-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed_ast27x0: Fix EHCI3/4 IRQ routing to GIC
Jamin Lin [Tue, 3 Feb 2026 02:08:46 +0000 (10:08 +0800)] 
hw/arm/aspeed_ast27x0: Fix EHCI3/4 IRQ routing to GIC

EHCI3 and EHCI4 were missing entries in aspeed_soc_ast2700a1_irqmap,
so their source IRQs were never routed through the INTC OR-gates.

As a result, EHCI3/4 interrupts were not propagated to the GIC,
causing incorrect interrupt behavior for these controllers.

Add EHCI3 and EHCI4 to the IRQ map and route them to the same INTC
group as other shared peripherals, ensuring their interrupts are
properly connected to the GIC.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Fixes: ba27ba302a264117c8b8427f944ced1bed17c438 ("hw/arm: ast27x0: Wire up EHCI controllers")
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260203020855.1642884-2-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agotests/functional/arm/test_aspeed_ast1030: Update test ASPEED Zephyr SDK v03.05
Jamin Lin [Tue, 27 Jan 2026 03:23:43 +0000 (11:23 +0800)] 
tests/functional/arm/test_aspeed_ast1030: Update test ASPEED Zephyr SDK v03.05

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/20260127032348.2238527-8-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agotests/functional/arm/test_aspeed_ast1060: Update test aspeed-zephyr-project v03.04
Jamin Lin [Tue, 27 Jan 2026 03:23:42 +0000 (11:23 +0800)] 
tests/functional/arm/test_aspeed_ast1060: Update test aspeed-zephyr-project v03.04

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/20260127032348.2238527-7-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agotests/functional/arm/test_aspeed_ast2600_sdk: Update test ASPEED SDK v11.00
Jamin Lin [Tue, 27 Jan 2026 03:23:41 +0000 (11:23 +0800)] 
tests/functional/arm/test_aspeed_ast2600_sdk: Update test ASPEED SDK v11.00

Drop root device and set root bus number to 0.

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/20260127032348.2238527-6-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed_ast2600: Expand RC_H PCIe MMIO window to 0x60000000 - 0x80000000
Jamin Lin [Tue, 27 Jan 2026 03:23:40 +0000 (11:23 +0800)] 
hw/arm/aspeed_ast2600: Expand RC_H PCIe MMIO window to 0x60000000 - 0x80000000

Historically, the ASPEED PCIe driver supported both RC_L and RC_H, with RC_L
using MMIO window 0x60000000 - 0x70000000 and RC_H using 0x70000000 - 0x80000000.

Mainline Linux has dropped RC_L support and now supports RC_H only, updating
RC_H to use a single combined MMIO window 0x60000000 - 0x80000000.

Update the AST2600 QEMU model accordingly by moving PCIE_MMIO1 base to
0x60000000 and increasing the aliased MMIO size to 0x20000000.

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/20260127032348.2238527-5-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/pci-host/aspeed_pcie: Drop AST2600 RC_H root-bus remap and bus-nr property
Jamin Lin [Tue, 27 Jan 2026 03:23:39 +0000 (11:23 +0800)] 
hw/pci-host/aspeed_pcie: Drop AST2600 RC_H root-bus remap and bus-nr property

The original AST2600 PCIe design supported both RC_L and RC_H, using root bus
number 0 for RC_L and 0x80 for RC_H. In that model, the root port appeared as
80:08.0 and QEMU carried a "bus-nr" property plus a config-space bus remap to
translate bus 0x80 to bus 0x00 for PCI enumeration.

Linux mainline has since dropped RC_L support and updated the RC_H root bus
number to start at 0. The root port is now enumerated as 00:08.0, matching the
default QEMU PCIe subsystem root bus numbering.

Remove the bus number setting and the AST2600 bus remap logic, and drop the
corresponding "bus-nr"/rc_bus_nr fields and property plumbing. QEMU now relies
on the default root bus 0 behavior.

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/20260127032348.2238527-4-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/pci-host/aspeed_pcie: Drop AST2600 PCIe root device
Jamin Lin [Tue, 27 Jan 2026 03:23:38 +0000 (11:23 +0800)] 
hw/pci-host/aspeed_pcie: Drop AST2600 PCIe root device

AST2600 PCIe previously exposed a root bus at 0x80 with both a
root device at 80:00.0 and a root port at 80:08.0.

Recent ASPEED SDK PCIe driver updates decided to remove the root
device and keep only a single root port. This behavior has already
been accepted by the upstream Linux kernel.

Update the QEMU PCIe model accordingly by dropping the root device
implementation and related properties. AST2600 now matches the
AST2700 PCIe topology and no longer supports the legacy RC_L
layout.

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/20260127032348.2238527-3-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agotests/functional/arm/test_aspeed_ast2500: Update test ASPEED SDK v10.00
Jamin Lin [Tue, 27 Jan 2026 03:23:37 +0000 (11:23 +0800)] 
tests/functional/arm/test_aspeed_ast2500: Update test ASPEED SDK v10.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/20260127032348.2238527-2-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/adc: Fix out-of-bounds write in Aspeed ADC model
Cédric Le Goater [Mon, 26 Jan 2026 14:18:20 +0000 (15:18 +0100)] 
hw/adc: Fix out-of-bounds write in Aspeed ADC model

The 'regs' array has ASPEED_ADC_NR_REGS (52) elements, while the
memory region covers offsets 0x00-0xFC. The aspeed_adc_engine_write()
function has an out-of-bounds write vulnerability when accessing
unimplemented registers.

Fix this by using 'return' instead of 'break' in the default case,
which prevents execution from reaching the s->regs[reg] assignment for
unimplemented registers.

Reported-by: Elhrj Saad <saadelhrj@gmail.com>
Fixes: 5857974d5d11 ("hw/adc: Add basic Aspeed ADC model")
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260126141820.719492-1-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/arm/aspeed: catalina: use pca9535
Patrick Williams [Wed, 21 Jan 2026 18:17:06 +0000 (13:17 -0500)] 
hw/arm/aspeed: catalina: use pca9535

A few entries in the catalina model were using the PCA9552 chip
because it was "close enough" in function.  Since there is a PCA9535
model now, switch to use it.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260121-pca9535-v1-2-164640e622ff@stwcx.xyz
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/gpio/pca9552: add pca9535 support
Patrick Williams [Wed, 21 Jan 2026 18:17:05 +0000 (13:17 -0500)] 
hw/gpio/pca9552: add pca9535 support

Extend the 16-bit PCA9552 model to support non-LED devices such as
the PCA9535[1].

[1]: https://www.ti.com/lit/ds/symlink/pca9535.pdf

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Reviewed-by: Glenn Miles <milesg@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260121-pca9535-v1-1-164640e622ff@stwcx.xyz
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/i2c/aspeed_i2c.c: Add a check for dma_read
Nabih Estefan [Tue, 20 Jan 2026 21:11:16 +0000 (21:11 +0000)] 
hw/i2c/aspeed_i2c.c: Add a check for dma_read

If aspeed_i2c_dma_read fails in aspeed_i2c_bus_send currently, we get
stuck in an infinite retry loop. Add a check for the return value of
aspeed_i2c_dma_read that will break us out of said loop.

Signed-off-by: Nabih Estefan <nabihestefan@google.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Fixes: 545d6bef7097 ("aspeed/i2c: Add support for DMA transfers")
Link: https://lore.kernel.org/qemu-devel/20260120211116.1367476-1-nabihestefan@google.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agoMAINTAINERS: Update ASPEED entry
Jamin Lin [Fri, 16 Jan 2026 08:24:28 +0000 (16:24 +0800)] 
MAINTAINERS: Update ASPEED 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/20260116082431.3689035-2-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agohw/i2c/aspeed: Introduce 'bus-label' to customize bus naming
Kane-Chen-AS [Mon, 12 Jan 2026 08:30:53 +0000 (16:30 +0800)] 
hw/i2c/aspeed: Introduce 'bus-label' to customize bus naming

On some Aspeed-based machines, multiple I2C controllers may exist
across different components, such as the primary SoC and an external
IO expander or co-processor (e.g., AST1700). Using the current static
naming convention results in object name conflicts when multiple
controllers attempt to instantiate buses with the same ID.

This patch introduces a 'bus-label' property for the Aspeed I2C
controller. This allows higher-level layers, such as the SoC realize
function, to provide a unique identifier for the buses. The I2C bus
object name is then constructed using this label (e.g., "ioexp0.0"
instead of the default "aspeed.i2c.bus.0").

This enhancement ensures unique bus identifiers across the system and
resolves naming conflicts in multi-controller configurations.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260112083054.4151945-2-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agotests/functional/arm/aspeed: Update buildroot images to 2025.11
Cédric Le Goater [Mon, 5 Jan 2026 16:03:58 +0000 (17:03 +0100)] 
tests/functional/arm/aspeed: Update buildroot images to 2025.11

The main changes compared to upstream 2025.11 buildroot are

  - Linux v6.18
  - latest OpenBMC U-Boot
  - extra packages (ssh, etc.)

See

  https://github.com/legoater/buildroot/commits/aspeed-2025.11

Acked-by: Jamin Lin <jamin_lin@aspeedtech.com>
Link: https://lore.kernel.org/qemu-devel/20260105160358.771511-1-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agoMerge tag 'pull-vbootrom-20260116-v3' into aspeed-next
Cédric Le Goater [Wed, 4 Feb 2026 07:24:03 +0000 (08:24 +0100)] 
Merge tag 'pull-vbootrom-20260116-v3' into aspeed-next

vbootrom update pull request v3

* tag 'pull-vbootrom-20260116-v3':
  pc-bios: Update vbootrom image to commit 1c8e9510b22c

Signed-off-by: Cédric Le Goater <clg@redhat.com>
4 months agoMerge tag 'single-binary-20260203' of https://github.com/philmd/qemu into staging
Richard Henderson [Tue, 3 Feb 2026 15:57:26 +0000 (01:57 +1000)] 
Merge tag 'single-binary-20260203' of https://github.com/philmd/qemu into staging

Various patches related to single binary effort:

- Endianness cleanups on various targets (PPC in particular)
- Few cleanups around target_ulong type on Alpha
- Have CPUClass::disas_set_info() take a const CPUState

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmmCDTkACgkQ4+MsLN6t
# wN7vHQ/+LCAYESbTy7cXeKGgAslwPbX1Q2zYGk0rhGMgrbBtQThbgQSkNsAwYmzg
# 6vx5crw9vYA/kLq0jyJQPTRIAKzXH9BzdEfTsEt5AIpZv6Cc4im6JBZdrxUa6S0O
# AMGb4pn9bpkcwHOv2ufotJbl0fa+id4WgQgXyLDEgwgNVvY18fVWfn5OwAon2bWo
# nb6zqRfwgdyAB+liwmlPNI+M4hZ3vDdct7whUP8t37FjTL0lNrsyG/Epr0xJB5ru
# CRsjubBkXAq8HlmwHZp8JSM/Lriitp8Z2ubD8VBqYbMYI25XUnRlBWWxTnQKkaDD
# Vgbq67UqS/k/X6vV5cfJaeS2qOdgF98V0VmrOqlNXTwMU56lzMn0ThgLqUXznRos
# IUfTUvmjfGu63aAWG2l+HBrehK5JEAGYzK6ZTiTA6abpvfHUjehslsQlAlMgcSnL
# TnMsM7mxS+XNbf6bsew0azTt2p/V81JDVrQuQgmAJS9ZOpALMFGep5YAYKvN/kLf
# cSbl+hQRsxqxQPoc6y0NrnCcfT33U1+I+IXpMIR/VyC0RgseW9HeRdJWuNyKBW/4
# VUBnQnYNhZM9hDHKp5PzU2KhoeudAlK3gws8zvtWfLCFyAvfmEYX0Gt5r23JkoxT
# IO340Jz5XRwfXMWENc6Bm8lqr7HilQi28HFNXWdy897YfNS83Ow=
# =J0gm
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 04 Feb 2026 12:59:05 AM AEST
# 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-20260203' of https://github.com/philmd/qemu: (30 commits)
  disas: Have disas_set_info() take a const CPUState
  disas: Make disassemble_info::target_info field const
  disas/riscv: Make rv_decode::cfg const
  target/arm: Have arm_sctlr_b() take a const @env argument
  target/arm: Have is_64() take a const @env argument
  target/arm: Have cpu_isar_feature() use a const ARMCPU object
  target/arm: Have arm_feature() take a const @env argument
  target/alpha: Expand TCGv type for 64-bit target
  target/alpha: Remove target_ulong uses in get_physical_address()
  target/alpha: Do not use target_ulong for page table entries / indexes
  target/alpha: Do not use target_ulong for trap arguments
  target/alpha: Replace target_ulong -> uint64_t in gdb_write_register()
  target/alpha: Build system units in common source set
  target/alpha: Avoid target-specific migration headers in machine.c
  target/m68k: Inline translator_ld[uw,l,q]() calls
  target/i386: Inline translator_ld[uw,l,q]() calls
  target/riscv: Inline translator_ld[uw,l,q]() calls
  target/riscv: Inline cpu_ld[lq]_code() calls
  target/ppc: Inline cpu_ldl_code() call in ppc_ldl_code()
  target/ppc: Check endianness at runtime in ppc_data_endian_env()
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 months agoMerge tag 'firmware-20260203-pull-request' of https://gitlab.com/kraxel/qemu into...
Richard Henderson [Tue, 3 Feb 2026 15:56:55 +0000 (01:56 +1000)] 
Merge tag 'firmware-20260203-pull-request' of https://gitlab.com/kraxel/qemu into staging

firmware updates for 11.0
- igvm: rework reset handling.
- igvm: add MADT parameter support.
- uefi: variable store fixes.

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEoDKM/7k6F6eZAf59TLbY7tPocTgFAmmB5AYACgkQTLbY7tPo
# cThR7Q//d5Z9cIQEOn7hqAgsqyz4llvyLpZk+pWuyQmJ7iBtF7geP0p61iICi5vP
# +jyKJChHtPQzAQLqKwgHLWAuYSW82EZPh74YvL4MBNe7WX8LouHvCoTsOE28Nxqx
# EWDtucSwwwQpx/r1iSSHEHqjlV2MudlGFMaOb0+by57j2ZsAGEe/0J+yF07hhXLQ
# OxQY1l8gHC+PK6BnRLnwIlBVBe+o2E9hJeV0GA/zd1UufTxsan/r06T1JRsdNhPe
# vkBFedwPz+4+jKbOVWBp2pY5FSxmIEe+sOqRdhFvyvz+KBziAyisCNtv/eABrd9h
# Jk/yfvrDIZEJk7GtwMAC/un+zz/iQfu9BK3EAtT5OnUCEbj7HNaEjuStB2AnfBnw
# 4clhjPA+qwej1771zAuKC5HOc+2mMxbON/roD4nGcEY3WKq7JvjUrIopesJcgCCu
# TjV1UXAxyG6CRvsiUc3uesdleumAqt3I4+OryfnPY5SloYjlg+bEW8fpKvXmI82l
# uZsI1SL3yqXJMVQEh0cS7awquKKkjzNR0CGR+a9KBMl3kCiuAPPkevEhERpd1J6V
# W6zZrNI9IHczBKrZEJ42apXutGmADDZUdREjktc4gUBvTzC317bfSTGk/tvQQe7N
# lRr9KV+56bSVrnLiqcCzfVj8U2YTecsvO98Xp28W3nwwvIls3mQ=
# =npQG
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 03 Feb 2026 10:03:18 PM AEST
# gpg:                using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [unknown]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [unknown]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@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: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* tag 'firmware-20260203-pull-request' of https://gitlab.com/kraxel/qemu:
  igvm: Fill MADT IGVM parameter field on x86_64
  igvm: Only build stubs if igvm is enabled
  igvm: Pass machine state to IGVM file processing
  igvm: Refactor qigvm_parameter_insert
  igvm: Add common function for finding parameter entries
  igvm: Move structs to internal header
  hw/acpi: Add standalone function to build MADT
  hw/acpi: Make BIOS linker optional
  hw/acpi: Make acpi_checksum() public
  igvm: move igvm file processing to reset callbacks
  igvm: add trace points for igvm file loading and processing
  igvm: move file load to complete callback
  igvm: make igvm-cfg object resettable
  igvm: reorganize headers
  hw/uefi: fix size negotiation
  hw/uefi: skip time check for append-write updates.
  docs/system/igvm.rst: Update external links

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 months agodisas: Have disas_set_info() take a const CPUState
Philippe Mathieu-Daudé [Thu, 29 Jan 2026 15:03:24 +0000 (16:03 +0100)] 
disas: Have disas_set_info() take a const CPUState

The CPUClass::disas_set_info() handler is meant to initialize
the %disassemble_info structure; it shoudn't alter the CPU state.
Enforce the CPUState can not be modified by having the handler
take a const pointer.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260202222412.24923-8-philmd@linaro.org>

4 months agodisas: Make disassemble_info::target_info field const
Philippe Mathieu-Daudé [Thu, 29 Jan 2026 14:56:41 +0000 (15:56 +0100)] 
disas: Make disassemble_info::target_info field const

Disassemblers shouldn't need writeable context, so make the
disassemble_info::target_info field const.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260202222412.24923-7-philmd@linaro.org>

4 months agodisas/riscv: Make rv_decode::cfg const
Philippe Mathieu-Daudé [Thu, 29 Jan 2026 14:56:27 +0000 (15:56 +0100)] 
disas/riscv: Make rv_decode::cfg const

Disassembler is not expected to alter the CPU config.
Besides, all other RISC-V methods takes a const RISCVCPUConfig.
Make the @cfg field of the rv_decode structure const, passing
a const pointer to disasm_inst().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260202222412.24923-6-philmd@linaro.org>

4 months agotarget/arm: Have arm_sctlr_b() take a const @env argument
Philippe Mathieu-Daudé [Thu, 29 Jan 2026 15:01:48 +0000 (16:01 +0100)] 
target/arm: Have arm_sctlr_b() take a const @env argument

arm_sctlr_b() only access @env read-only, make it const.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260202222412.24923-5-philmd@linaro.org>

4 months agotarget/arm: Have is_64() take a const @env argument
Philippe Mathieu-Daudé [Mon, 20 Jan 2025 02:54:31 +0000 (03:54 +0100)] 
target/arm: Have is_64() take a const @env argument

is_64() only access @env read-only, make it const.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260202222412.24923-4-philmd@linaro.org>

4 months agotarget/arm: Have cpu_isar_feature() use a const ARMCPU object
Philippe Mathieu-Daudé [Mon, 20 Jan 2025 03:08:31 +0000 (04:08 +0100)] 
target/arm: Have cpu_isar_feature() use a const ARMCPU object

The @cpu_ variable is only accessed read-only, make it const.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260202222412.24923-3-philmd@linaro.org>

4 months agotarget/arm: Have arm_feature() take a const @env argument
Philippe Mathieu-Daudé [Mon, 20 Jan 2025 02:51:38 +0000 (03:51 +0100)] 
target/arm: Have arm_feature() take a const @env argument

arm_feature() only access @env read-only, make it const.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260202222412.24923-2-philmd@linaro.org>

4 months agotarget/alpha: Expand TCGv type for 64-bit target
Philippe Mathieu-Daudé [Mon, 2 Feb 2026 23:26:22 +0000 (00:26 +0100)] 
target/alpha: Expand TCGv type for 64-bit target

The Alpha targets are only built as 64-bit:

  $ git grep TARGET_LONG_BITS configs/targets/alpha-*
  configs/targets/alpha-linux-user.mak:4:TARGET_LONG_BITS=64
  configs/targets/alpha-softmmu.mak:2:TARGET_LONG_BITS=64

Replace:

  TCGv -> TCGv_i64
  tcg_temp_new -> tcg_temp_new_i64

This is a mechanical replacement, adapting style to pass
the checkpatch.pl script.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260202234550.34156-8-philmd@linaro.org>

4 months agotarget/alpha: Remove target_ulong uses in get_physical_address()
Philippe Mathieu-Daudé [Mon, 2 Feb 2026 23:07:38 +0000 (00:07 +0100)] 
target/alpha: Remove target_ulong uses in get_physical_address()

%addr is a virtual address, so use the 'vaddr' type.
%pphys is a pointer to a physical address, so use the 'hwaddr' type.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260202234550.34156-7-philmd@linaro.org>

4 months agotarget/alpha: Do not use target_ulong for page table entries / indexes
Philippe Mathieu-Daudé [Mon, 2 Feb 2026 23:06:57 +0000 (00:06 +0100)] 
target/alpha: Do not use target_ulong for page table entries / indexes

%L[123]pte are loaded calling ldq_le_phys() which returns
a uint64_t. %pt is loaded with @ptbr, declared as uint64_t
in target/alpha/cpu.h:

  236    uint64_t ptbr;

%index is at most 1024 so can fit in uint16_t.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260202234550.34156-6-philmd@linaro.org>

4 months agotarget/alpha: Do not use target_ulong for trap arguments
Philippe Mathieu-Daudé [Mon, 2 Feb 2026 23:08:35 +0000 (00:08 +0100)] 
target/alpha: Do not use target_ulong for trap arguments

%mmcsr and %cause are filled with @trap_arg1 / @trap_arg2,
both declared as uint64_t in target/alpha/cpu.h:

    229     uint64_t trap_arg1;
    230     uint64_t trap_arg2;
    ...

Use uint64_t instead of target_ulong.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260202234550.34156-5-philmd@linaro.org>

4 months agotarget/alpha: Replace target_ulong -> uint64_t in gdb_write_register()
Philippe Mathieu-Daudé [Mon, 2 Feb 2026 23:00:21 +0000 (00:00 +0100)] 
target/alpha: Replace target_ulong -> uint64_t in gdb_write_register()

On Alpha, the target_ulong type expands to uint64_t.
Besides, ldq_be_p() returns a uint64_t type, and all
field / values accessed are uint64_t, see target/alpha/cpu.h:

  200 typedef struct CPUArchState {
  201     uint64_t ir[31];
  202     float64 fir[31];
  203     uint64_t pc;
  204     uint64_t unique;
  ...
  443 void cpu_alpha_store_fpcr (CPUAlphaState *env, uint64_t val);
  445 void cpu_alpha_store_gr(CPUAlphaState *env, unsigned reg, uint64_t val);

Use uint64_t instead of target_ulong.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260202234550.34156-4-philmd@linaro.org>

4 months agotarget/alpha: Build system units in common source set
Philippe Mathieu-Daudé [Wed, 7 Jan 2026 08:30:32 +0000 (09:30 +0100)] 
target/alpha: Build system units in common source set

Since commits bb5de52524c ("target: Widen pc/cs_base in
cpu_get_tb_cpu_state") and 32f0c394bbf ("target: Use vaddr
in gen_intermediate_code") we remove all uses of the target_ulong
type in target/alpha/. Use the meson target_common_system_arch[]
source set to prevent further uses of target-specific types.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260202234550.34156-3-philmd@linaro.org>

4 months agotarget/alpha: Avoid target-specific migration headers in machine.c
Philippe Mathieu-Daudé [Wed, 7 Jan 2026 08:30:24 +0000 (09:30 +0100)] 
target/alpha: Avoid target-specific migration headers in machine.c

machine.c doesn't use any target-specific macro defined by
the "migration/cpu.h" header. Use the minimum header required:
"migration/qemu-file-types.h" and "migration/vmstate.h", which
are not target-specific.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260202234550.34156-2-philmd@linaro.org>

4 months agotarget/m68k: Inline translator_ld[uw,l,q]() calls
Philippe Mathieu-Daudé [Thu, 27 Nov 2025 15:50:59 +0000 (16:50 +0100)] 
target/m68k: Inline translator_ld[uw,l,q]() calls

In preparation of removing the translator_ld[uw,l,q]() methods,
inline them for the m68k target, expanding MO_TE -> MO_BE since
this architecture is only available in big endianness.

Mechanical change using the following Coccinelle 'spatch' script:

    @@
    expression env, db, pc, do_swap;
    @@
    (
    - translator_lduw(env, db, pc)
    + translator_lduw_end(env, db, pc, MO_BE)
    |
    - translator_ldl(env, db, pc)
    + translator_ldl_end(env, db, pc, MO_BE)
    |
    - translator_ldq(env, db, pc)
    + translator_ldq_end(env, db, pc, MO_BE)
    )

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-ID: <20260202214050.98935-1-philmd@linaro.org>

4 months agotarget/i386: Inline translator_ld[uw,l,q]() calls
Philippe Mathieu-Daudé [Mon, 26 Jan 2026 19:08:24 +0000 (20:08 +0100)] 
target/i386: Inline translator_ld[uw,l,q]() calls

In preparation of removing the translator_ld[uw,l,q]() methods,
inline them for the x86 targets, expanding MO_TE -> MO_LE since
the architecture uses little endian order.

Mechanical change using the following Coccinelle 'spatch' script:

    @@
    expression env, db, pc, do_swap;
    @@
    (
    - translator_lduw(env, db, pc)
    + translator_lduw_end(env, db, pc, MO_LE)
    |
    - translator_ldl(env, db, pc)
    + translator_ldl_end(env, db, pc, MO_LE)
    |
    - translator_ldq(env, db, pc)
    + translator_ldq_end(env, db, pc, MO_LE)
    )

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260202213348.96754-1-philmd@linaro.org>

4 months agotarget/riscv: Inline translator_ld[uw,l,q]() calls
Philippe Mathieu-Daudé [Thu, 27 Nov 2025 15:54:20 +0000 (16:54 +0100)] 
target/riscv: Inline translator_ld[uw,l,q]() calls

In preparation of removing the translator_ld[uw,l,q]() methods,
inline them for the RISC-V targets, using mo_endian(ctx) -- which
we introduced in commit 504f7f304ff -- instead of MO_TE.

Mechanical change using the following Coccinelle 'spatch' script:

    @@
    expression env, db, pc, do_swap;
    @@
    (
    - translator_lduw(env, db, pc)
    + translator_lduw_end(env, db, pc, mo_endian(ctx))
    |
    - translator_ldl(env, db, pc)
    + translator_ldl_end(env, db, pc, mo_endian(ctx))
    |
    - translator_ldq(env, db, pc)
    + translator_ldq_end(env, db, pc, mo_endian(ctx))
    )

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260202213810.97141-1-philmd@linaro.org>

4 months agotarget/riscv: Inline cpu_ld[lq]_code() calls
Philippe Mathieu-Daudé [Thu, 20 Nov 2025 19:47:20 +0000 (20:47 +0100)] 
target/riscv: Inline cpu_ld[lq]_code() calls

In preparation of removing the cpu_ldl_code() and cpu_ldq_code()
wrappers, inline them.

Since RISC-V instructions are always stored in little-endian order
(see "Volume I: RISC-V Unprivileged ISA" document, chapter
'Instruction Encoding Spaces and Prefixes': "instruction fetch
in RISC-V is little-endian"), replace MO_TE -> MO_LE.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20260202214317.99090-1-philmd@linaro.org>

4 months agotarget/ppc: Inline cpu_ldl_code() call in ppc_ldl_code()
Philippe Mathieu-Daudé [Thu, 20 Nov 2025 20:00:33 +0000 (21:00 +0100)] 
target/ppc: Inline cpu_ldl_code() call in ppc_ldl_code()

In preparation of removing the cpu_ldl_code wrapper, inline it.

Get the runtime endianness with ppc_data_endian_env(), passing it
to cpu_ldl_code_mmu(). No need to swap versus qemu-system binary
anymore.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20260202210106.93257-12-philmd@linaro.org>

4 months agotarget/ppc: Check endianness at runtime in ppc_data_endian_env()
Philippe Mathieu-Daudé [Thu, 22 Jan 2026 20:22:14 +0000 (21:22 +0100)] 
target/ppc: Check endianness at runtime in ppc_data_endian_env()

Rather a runtime endianness check via env MSR over
a build-time one.

Now CPU can change endianness at runtime.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20260202210106.93257-11-philmd@linaro.org>

4 months agotarget/ppc: Introduce ppc_env_is_little_endian() helper
Philippe Mathieu-Daudé [Mon, 2 Feb 2026 20:35:57 +0000 (21:35 +0100)] 
target/ppc: Introduce ppc_env_is_little_endian() helper

Centralize endianness check on MSR via a common helper.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20260202210106.93257-10-philmd@linaro.org>

4 months agotarget/ppc: Check endianness via env in ppc_disas_set_info()
Philippe Mathieu-Daudé [Thu, 4 Dec 2025 17:45:11 +0000 (18:45 +0100)] 
target/ppc: Check endianness via env in ppc_disas_set_info()

disas_set_info() shouldn't bother with env->hflags,
access env->msr directly.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20260202210106.93257-9-philmd@linaro.org>

4 months agotarget/ppc: Inline need_byteswap() and replace translator_ldl_swap()
Philippe Mathieu-Daudé [Mon, 2 Feb 2026 20:41:45 +0000 (21:41 +0100)] 
target/ppc: Inline need_byteswap() and replace translator_ldl_swap()

Rather than using a boolean with translator_ldl_swap(),
get the MemOp endianness with ppc_code_endian() and pass
it to translator_ldl_end().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20260202210106.93257-8-philmd@linaro.org>

4 months agotarget/ppc: Introduce ppc_code_endian_dc() helper
Philippe Mathieu-Daudé [Wed, 3 Dec 2025 17:38:11 +0000 (18:38 +0100)] 
target/ppc: Introduce ppc_code_endian_dc() helper

Introduce the ppc_code_endian_dc() helper which returns the
MemOp endianness for the CODE path.

Use it in need_byteswap(), removing one TARGET_BIG_ENDIAN.

Note, the target MemOp endianness can be evaluated as (see
commit 5c43a750b67 "accel/tcg: Implement translator_ld*_end"):

    MO_TE ^ (do_swap * MO_BSWAP)

For PPC we use the DisasContext::le_mode field to swap the
default (big-endian) order, so to get the PPC MemOp endianness
we can directly use:

    MO_BE ^ (ctx->le_mode * MO_BSWAP)

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-ID: <20260202210106.93257-7-philmd@linaro.org>

4 months agotarget/ppc: Introduce ppc_data_endian_env() helper
Philippe Mathieu-Daudé [Wed, 3 Dec 2025 18:08:28 +0000 (19:08 +0100)] 
target/ppc: Introduce ppc_data_endian_env() helper

Introduce ppc_data_endian_env() which returns the endian MemOp
of the data path from the vCPU env pointer. Keep it hardcoded
as MO_TE, the target built-time endianness.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-ID: <20260202210106.93257-6-philmd@linaro.org>