]> git.ipfire.org Git - thirdparty/qemu.git/log
thirdparty/qemu.git
5 months agoqemu-options: remove extraneous [] around arg values
Daniel P. Berrangé [Thu, 8 Jan 2026 16:05:17 +0000 (16:05 +0000)] 
qemu-options: remove extraneous [] around arg values

There are quite a few inappropriate uses of [...] around argument
values. The [] are intended to indicate optionality, but in some
cases it is used to wrap a set of enum values. In other cases it
is being used to show the value is entirely optional, which was
common behaviour for boolean values in the past. QEMU has deprecated
short-form boolean options for quite a while though, and we should
thus not advertize this possibility in the docs.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agodocs: simplify DiamondRapids CPU docs
Daniel P. Berrangé [Wed, 11 Feb 2026 17:55:55 +0000 (17:55 +0000)] 
docs: simplify DiamondRapids CPU docs

This aligns the first line of the docs with the style used for previous
CPU models, and simplifies the text in the remaining docs.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoio: fix cleanup for websock I/O source data on cancellation
Daniel P. Berrangé [Tue, 6 Jan 2026 13:45:10 +0000 (13:45 +0000)] 
io: fix cleanup for websock I/O source data on cancellation

The websock code will create a GSource for tracking completion of the
handshake process, passing a QIOTask which is freed by the callback
when it completes, which means when a source is cancelled, nothing is
free'ing the task.

Switch to provide a data free callback to the GSource, which ensures
the QIOTask is always freed even when the main event callback never
fires.

Fixes: https://gitlab.com/qemu-project/qemu/-/issues/3114
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoio: fix cleanup for TLS I/O source data on cancellation
Daniel P. Berrangé [Tue, 6 Jan 2026 13:45:10 +0000 (13:45 +0000)] 
io: fix cleanup for TLS I/O source data on cancellation

The TLS code will create a GSource for tracking completion of the
handshake process, passing a QIOChannelTLSData struct that contains
various data items. The data struct is freed by the callback when
it completes, which means when a source is cancelled, nothing is
free'ing the data struct or its contents.

Switch to provide a data free callback to the GSource, which ensures
the QIOChannelTLSData struct is always freed even when the main event
callback never fires.

Fixes: https://gitlab.com/qemu-project/qemu/-/issues/3114
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoio: separate freeing of tasks from marking them as complete
Daniel P. Berrangé [Tue, 6 Jan 2026 16:08:49 +0000 (16:08 +0000)] 
io: separate freeing of tasks from marking them as complete

The original design of QIOTask was intended to simplify lifecycle
management by automatically freeing it when the task was marked as
complete. This overlooked the fact that when a QIOTask is used in
combination with a GSource, there may be times when the source
callback is never invoked. This is typically when a GSource is
released before any I/O event arrives. In such cases it is not
desirable to mark a QIOTask as complete, but it still needs to be
freed. To satisfy this, the task must be released manually.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoscripts: detect another GPL license boilerplate variant
Daniel P. Berrangé [Wed, 5 Nov 2025 11:42:13 +0000 (11:42 +0000)] 
scripts: detect another GPL license boilerplate variant

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoMerge tag 'pull-request-2026-03-02' of https://gitlab.com/thuth/qemu into staging
Peter Maydell [Mon, 2 Mar 2026 14:01:46 +0000 (14:01 +0000)] 
Merge tag 'pull-request-2026-03-02' of https://gitlab.com/thuth/qemu into staging

* Remove qemu-system-microblazeel (qemu-system-microblaze can be used instead)
* Improve detection of the docker/podman binary
* Prevent a null pointer dereference during zpci hot unplug

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmmlgwQACgkQLtnXdP5w
# LbW4jw//VMx6pHEu5L3Rzr3FZdgMJUhJ3UQKoV5PAImHz96QjIZi3kR311/D7Xjr
# nPf9VVgVZUEKzwyCfv7V06M9S79Jbw2cJesEIcu5LqbvGxKcevXVPMdVPpDG7P7T
# zuNW7eyIMpHYHRnMnxRNY/Hl8S1P9spEWJeQpNxfe9AKoWh2i4vEC8KLMAf59DAw
# MX0CZjonMeCBSWBqRqP0zOeUqiq9n49Lz1LQnCZb1R2TF+RGmwfe6+NaBeEZ9BSg
# FWGVIIq09OFxvtUuuut5X47DOrxk69q0RmiLy+wyrpH3VMxWM41n3oensoaNm0Xj
# dg0Eq1GzQwnLalaVgdqriGnymQWtvKXmlXHsIAwedLscOO6F5L+T12WZUSUjDZ92
# SGGKyi2TSkgEZO1naLxi+J0dMWSO51wOOln9GAgFHkT/PuF/12r0sVweXXiovucr
# 4CWKP8VGU5MVpGlZ9flLwXiq8uS1GOsMQbBj/eoVOxEuFnL0crX9dME8vlpoGYAg
# THmuLKOxtcVtC9BxBZQkMFj6IKdRYEfFnNuCl2gk33Ksdb9QYCyL54XSZ9vtvhhG
# +5ajjl+w+O8HgnQKdWSQy1PYrvQ6EXtY0ZOf0q0yPfz4oq4Ib81oLhfvK0AywM17
# DALYymGpGgOgGYIkKQKcn3id7OnaIiRe7ai4GeJ9AbFVgxR4l+w=
# =Sdy4
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon Mar  2 12:31:00 2026 GMT
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [undefined]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2026-03-02' of https://gitlab.com/thuth/qemu:
  gitlab: ensure docker output is always displayed in CI
  tests/docker: allow display of docker output
  tests/docker: add support for podman remote access
  tests/docker: improve handling of docker probes
  Remove the qemu-system-microblazeel target from the build
  gitlab-ci: Remove the microblazeel target from the CI jobs
  tests/qtest: Remove the microblazeel target from the qtests
  tests/functional: Remove the microblazeel test
  tests/functional: Make sure test case .py files are executable
  s390x/pci: prevent null pointer dereference during zpci hot unplug

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 months agoMerge tag 'bsd-user-2026q1-upstream-pull-request' of ssh://github.com/bsdimp/qemu...
Peter Maydell [Mon, 2 Mar 2026 14:01:31 +0000 (14:01 +0000)] 
Merge tag 'bsd-user-2026q1-upstream-pull-request' of ssh://github.com/bsdimp/qemu into staging

git-publish --base upstream/master --pull --to qemu-devel@nongnu.org --no-check-url

bsd-user: Upstream for 11.0

This combines several batch streams that:
(1) Upstream the bsd-misc.c system calls:
    quoatctl, reboot, getdtablesize, uuidgen, semget, semop, semctl, msgctl
(2) common-user drop __linux__ ifdef
(3) Remove NetBSD and OpenBSD specific code for bsd-user (hasn't built in years)
(4) Fix inotify issues on FreeBSD 15
(5) Fix issues with gdb on aarch64

All of thse have been reviewed, and the only problems with the check patch line
length and about added files.

# -----BEGIN PGP SIGNATURE-----
# Comment: GPGTools - https://gpgtools.org
#
# iQIzBAABCgAdFiEEIDX4lLAKo898zeG3bBzRKH2wEQAFAmmlD6EACgkQbBzRKH2w
# EQANZw//edwiQF/H+07EBKdZNF/QJsBwsH5OwHh/rgyq6OPUHWtu00gxNDFd/e/D
# O+FisLvDbNa9v2es1RX0lDzdgXRwi2LRIc4tMW3ifEjK7Jj8np09tfWkghwc2u9Z
# RShNxlCHfg/lTFkkm5wbHEpl1W1sImcLhYSLdoXAdUhK8lQOoUiFYOtg9s6xq6LH
# 3NHH4roY+HQE2zpK6gY45BsD1Fi3qdg5VNwTHkvcducdC5jjXnJ1UikL48zM72An
# LK8EqQfGx06RVkPgPyxTeUjniJj9SyixZjBD8YzqlmhSCt3RD4e0V+5/wd8YlPpI
# dBaYqzLSfft+vtJEqUyds/SilMHqf2brvJ9e2chwIqBlghxPb9GpPjHASDqk1/t8
# +ckFaOtdtamw0H8JFp1ixzFn7WLvUp3jpQJbSzZxmKwC0hZCxl/aXFKcq+gDg3k5
# 1wt/su+1zfb1Qjp8M8tKHLWy2/aXT/yY7IeWAk2hpOel3e4L9pDU6bsgQMz4kOE8
# WO6GHDu2YA688EArVL8ErTkKw04+mGdTMmjqrF00O/MWnW8LNKNTHIHaxWtCfXVv
# mHSUyHt94CoDtScwCdLmyZslHiO0XgUFhnK+EPd+sHyaAPu2uH6ezfFMRF8F1vs8
# WXsOnZArDg+r02PnltEjbIEOJ8t+tYTZqZ/3IKn2Gecixqhqdmc=
# =yPBa
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon Mar  2 04:18:41 2026 GMT
# gpg:                using RSA key 2035F894B00AA3CF7CCDE1B76C1CD1287DB01100
# gpg: Good signature from "Warner Losh <wlosh@netflix.com>" [unknown]
# gpg:                 aka "Warner Losh <imp@bsdimp.com>" [unknown]
# gpg:                 aka "Warner Losh <imp@freebsd.org>" [unknown]
# gpg:                 aka "Warner Losh <imp@village.org>" [unknown]
# gpg:                 aka "Warner Losh <wlosh@bsdimp.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: 2035 F894 B00A A3CF 7CCD  E1B7 6C1C D128 7DB0 1100

* tag 'bsd-user-2026q1-upstream-pull-request' of ssh://github.com/bsdimp/qemu: (27 commits)
  bsd-user: update aarch64-bsd-user.mak gdb XML list
  bsd-user: Add miscellaneous BSD syscall implementations
  bsd-user: Add System V message queue syscalls
  bsd-user: Implement System V semaphore calls
  bsd-user: Add bsd-misc.c to build
  bsd-user: Add message queue implementations
  bsd-user: Add do_bsd_msgctl implementation
  bsd-user: Add do_bsd___semctl implementation
  bsd-user: Add do_bsd_semop implementation
  bsd-user: Add do_bsd_semget implementation
  bsd-user: Add do_bsd_uuidgen implementation
  bsd-user: Add do_bsd_quotactl, do_bsd_reboot and do_bsd_getdtablesize
  bsd-user: Add semaphore operation constants and structures
  bsd-user: Add host_to_target_msqid_ds for msgctl(2)
  bsd-user: Add target_to_host_msqid_ds for msgctl(2)
  bsd-user: Add host_to_target_semid_ds for semctl(2)
  bsd-user: Add target_to_host_semid_ds for semctl(2)
  bsd-user: Add host_to_target_semarray for semaphore operations
  bsd-user: Add target_to_host_semarray for semaphore operations
  bsd-user: Add host_to_target_uuid for uuidgen(2)
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 months agoMerge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
Peter Maydell [Mon, 2 Mar 2026 09:13:34 +0000 (09:13 +0000)] 
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging

* target/alpha: Fix for record/replay issue
* accel/nitro: New Nitro Enclaves accelerator
* generic + kvm: add support for rebuilding VMs on reset
* audio requirements cleanup
* vmmouse: Fix hypercall clobbers
* rust: use checked_div to make clippy happy
* kvm: Don't clear pending #SMI in kvm_get_vcpu_events
* target/i386/emulate: rework MMU code, many fixes
* target/i386/whpx: replace winhvemulation with target/i386/emulate
* target/i386/whpx: x2apic support
* target/i386/whpx: vapic support
* kvm: support for the "ignore guest PAT" quirk
* target/i386: add ITS_NO bit for the arch-capabilities MSR
* target/i386: add MBEC bit for nested VMX

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCgAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmmkVTUUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroOa8Qf+J16s57unw/DiM4Mw7wvnLGA86OSu
# bJwlHBgmgz3uT8LwPpg2F3+yTDzTGErm5Ex7JHYJqdLdhVuU0cC3d3/TndUovWZf
# lMwQi2QJNKECtOIIz3rqbqvuSoy577Q7qN7CIN4vR8JKFvToPnwABVfkl+VKedCT
# Tu/f3SiazXnNH8FejtXsyjDHMwJfMwhYg5HyAHeqxtrqMCnQ/pc46ZQoM4CJr8P+
# jDZu85RDlLVXkA0RtwkJ6QfvxSU3wUjEeDBz9ThGLk00PFCr1LAXj/oz+0Ayz3qu
# LkVpLLBxt0hfMCZPlYF0+17m1CJv7/micHVZEgblawpq/xXXk1iE8avGQQ==
# =mEuN
# -----END PGP SIGNATURE-----
# gpg: Signature made Sun Mar  1 15:03:17 2026 GMT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* tag 'for-upstream' of https://gitlab.com/bonzini/qemu: (102 commits)
  target/i386: emulate: fix scas
  whpx: i386: expose HV_X64_MSR_APIC_FREQUENCY when kernel-irqchip=off
  whpx: i386: enable PMU
  target/i386: emulate: more 64-bit register handling
  whpx: i386: warn on unsupported MSR access instead of failing silently
  whpx: i386: enable synthetic processor features
  whpx: i386: enable all supported host features
  whpx: i386: move whpx_vcpu_kick_out_of_hlt() invocation to interrupt raise time
  target/i386: introduce ClearwaterForest-v3 to expose ITS_NO
  target/i386: introduce SierraForest-v5 to expose ITS_NO
  target/i386: introduce GraniteRapids-v5 to expose ITS_NO
  target/i386: introduce SapphireRapids-v6 to expose ITS_NO
  target/i386: Add MSR_IA32_ARCH_CAPABILITIES ITS_NO
  target/i386: Add VMX_SECONDARY_EXEC_MODE_BASED_EPT_EXEC
  Reapply "rcu: Unify force quiescent state"
  target/alpha: Reset CPU
  hw: i386: vapic: enable on WHPX with user-mode irqchip
  whpx: x86: kick out of HLT manually when using the kernel-irqchip
  whpx: x86: remove inaccurate comment
  KVM: i386: Default disable ignore guest PAT quirk
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 months agoMerge tag 'pull-ppc-for-11.0-20260302' of https://gitlab.com/harshpb/qemu into staging
Peter Maydell [Mon, 2 Mar 2026 09:13:21 +0000 (09:13 +0000)] 
Merge tag 'pull-ppc-for-11.0-20260302' of https://gitlab.com/harshpb/qemu into staging

ppc queue for 11.0

- Fix TCG debug assert translating CLRBWIBC
- Misc Power10 PowerVM bringup fixes
- MAINTAINERS: Add Glenn as PPC TCG Reviewer.

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEa4EM1tK+EPOIPSFCRUTplPnWj7sFAmmlLJAACgkQRUTplPnW
# j7t5yg//S6Ch3ipR0gt13Q4/Hpseila6NADPaU+ASDcRNaWgJCjc+a6jW8xN6m5D
# myfms5vcbNdRLvDNdLYqNhtEjVqJgsbvb7jaFDK+Ny1vJDPRHZK4QIlsx5fWSteL
# fefWgfAu0ce70MQNY6zIsy/a6ORz6g+fTEv6XWsfZEdvlxow4BsClfnDcQw6vu5B
# YLi9FY50Kk7BxQ2gfFbAAPqCU9XSmjSObCANil9qiGl81lLG7VqIflSBEdQ6NWa1
# hJpUUoSEq+BzLtrVLTswb0/EnG2HATHyExRG5jy+oycuB8hKtZIV7g6zAdMBibrk
# EBAAU7MoH/dzcf5XDtrWEFzRm3yXHorMEIxejt51ss/7s6XaiDOciViOR2OEPOxY
# pzJ+8K8wRCxrM9tE2ZHZhmscz7Dns9nU0T5TrJ0NExUe8sB9A19nOQCSJsdNaWSl
# 4AXsevm0lqkoUCBgd+6ZHPgSSoheNW4DXuGr7dvaQiDY9xUw8lvAeG1WIVa2W0il
# GAGECZ4Da5e1bLlpSw8ALvINLL+/OjzpL8d//QQOTE7xoF/5SgGUAI/w7OJJXYtX
# vdvzAE9Dk2EMo0juRU9yLKiy7fjz+Ecp6wV74t9r18ZjzkD286+6nAOaXjvFH35i
# c3UMUPdVYRNRjVdFxKw8B/CJ22aWauz8z9X+fFwnqKYH7YLLUZ8=
# =AkZY
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon Mar  2 06:22:08 2026 GMT
# gpg:                using RSA key 6B810CD6D2BE10F3883D21424544E994F9D68FBB
# gpg: Good signature from "Harsh Prateek Bora <harsh.prateek.bora@gmail.com>" [full]
# gpg:                 aka "Harsh Prateek Bora <harshpb@linux.ibm.com>" [full]
# Primary key fingerprint: 6B81 0CD6 D2BE 10F3 883D  2142 4544 E994 F9D6 8FBB

* tag 'pull-ppc-for-11.0-20260302' of https://gitlab.com/harshpb/qemu:
  MAINTAINERS: Add self as reviewer for PowerPC TCG
  ppc/pnv: Add OCC FLAG registers
  ppc/pnv: Support for SECURITY_SWITCH XSCOM register access
  target/ppc/translate: Fix TCG debug assert translating CLRBWIBC

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 months agogitlab: ensure docker output is always displayed in CI
Daniel P. Berrangé [Tue, 10 Feb 2026 16:35:56 +0000 (16:35 +0000)] 
gitlab: ensure docker output is always displayed in CI

Set the new $(DOCKER_V) variable from the previous commit, so that any
CI jobs invoking docker will show the full stdout content. This improves
the ability to diagnose any build failures in CI that involve docker.

For example, when a 'docker build' command fails, it lets us see which
command in the Dockerfile failed and why.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20260210163556.713841-5-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 months agotests/docker: allow display of docker output
Daniel P. Berrangé [Tue, 10 Feb 2026 16:35:55 +0000 (16:35 +0000)] 
tests/docker: allow display of docker output

The --quiet command is used with docker unless V=1 is passed to make,
and as a result stdout from docker is never visible by default, making
it hard to diagnose failures building / running containers.

Meanwhile passing V=1 is undesirable as that makes the entire build
system verbose.

Introduce a $(DOCKER_V) make variable which is initialized from $(V)

It is thus possible to display docker output without also enabling
make verbose output.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260210163556.713841-4-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 months agotests/docker: add support for podman remote access
Daniel P. Berrangé [Tue, 10 Feb 2026 16:35:54 +0000 (16:35 +0000)] 
tests/docker: add support for podman remote access

When a developer's environment is already within a podman container it
is not possible to use 'podman' again to create containers. It will
usually result in wierd errors such as:

  Error: fatal error, invalid internal status, unable to create a new pause process: cannot re-exec process to join the existing user namespace. Try running "podman system migrate" and if that doesn't work reboot to recover

Podman offers the ability to talk to a daemon outside the container,
however, which could be leveraged by QEMU.

This can be used by invoking "podman --remote", or equivalently the
separate "podman-remote" binary:

  https://github.com/containers/podman/blob/main/docs/tutorials/remote_client.md

The current 'podman version' check is insufficient to detect the
inability to launch containers, so it is replaced with the stronger
'podman info' check.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260210163556.713841-3-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 months agotests/docker: improve handling of docker probes
Daniel P. Berrangé [Tue, 10 Feb 2026 16:35:53 +0000 (16:35 +0000)] 
tests/docker: improve handling of docker probes

The docker.py script has logic to guess the container command and
detects one of

  * docker
  * sudo -n docker
  * podman

but the "docker.py probe" command then throws away the detected argv
and prints a slightly different argv based solely on the detected
argv[0]. The result is that 'probe' will print

  * docker
  * sudo docker
  * podman

which means that if sudo was detected & the result of 'probe' were
used directly, it would end up prompting for password interaction
every time.

The 'configure' script, however, runs 'probe' and then throws away
the printed argv again, reporting only 'podman' or 'docker', which
is used to set the $(RUNC) variable for tests/docker/Makefile.include
which is in turn used to pass --engine to docker.py. So the docker.py
command will re-detect the need for 'sudo -n' and use it correctly

The problem with this is that some commands in Makefile.include do
not call docker.py at all, they invoke $(RUNC) directly. Since
configure threw away the 'sudo' command prefix Makefile.in won't
be adding either 'sudo' or 'sudo -n', it'll just run plain 'docker'
which is wrong.

This commit sanitizes things so that the 'docker.py probe' prints
out the exact detected ARGV, and configure fully preserves this
ARGV when setting $(RUNC). Since "$(RUNC)" is no longer just a bare
engine name, however, we must now also set the $(CONTAINER_ENGINE)
variable for Makefile.include so it can pass something sane to
the --engine arg for docker.py

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20260210163556.713841-2-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 months agoRemove the qemu-system-microblazeel target from the build
Thomas Huth [Thu, 26 Feb 2026 08:46:06 +0000 (09:46 +0100)] 
Remove the qemu-system-microblazeel target from the build

It's been deprecated since two releases, so it should be fine to
remove this now. Users can use the qemu-system-microblaze binary
instead that can handle both endiannesses now.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260226084608.11251-5-thuth@redhat.com>

5 months agogitlab-ci: Remove the microblazeel target from the CI jobs
Thomas Huth [Thu, 26 Feb 2026 08:46:05 +0000 (09:46 +0100)] 
gitlab-ci: Remove the microblazeel target from the CI jobs

Since we're going to remove the qemu-system-microblazeel binary,
remove the related tests from the CI jobs now (or switch to "microblaze"
where it is appropriate).

Note: Since "build-system-ubuntu" does not have as many targets as
"build-system-fedora", we turn the "microblazeel-softmmu" into a
"microblaze-softmmu" in the ubuntu job, and remove the corresponding
target from the fedora job instead, so that the load is more balanced
now.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260226084608.11251-4-thuth@redhat.com>

5 months agotests/qtest: Remove the microblazeel target from the qtests
Thomas Huth [Thu, 26 Feb 2026 08:46:04 +0000 (09:46 +0100)] 
tests/qtest: Remove the microblazeel target from the qtests

The "petalogix-ml605" boot-serial-test can be run with the
"microblaze" target. The remaining tests can simply be dropped
now that we are going to remove the "microblazeel" target.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260226084608.11251-3-thuth@redhat.com>

5 months agotests/functional: Remove the microblazeel test
Thomas Huth [Thu, 26 Feb 2026 08:46:03 +0000 (09:46 +0100)] 
tests/functional: Remove the microblazeel test

We are going to remove the microblazeel target, so the test is not
required anymore. The little endian mode is tested already via the
"microblaze" target, so we don't lose any test coverage here.

While we're at it, simplify the "microblaze" target test now (in the
file tests/functional/microblaze/test_s3adsp1800.py) since we don't
need the separate super-class here anymore.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260226084608.11251-2-thuth@redhat.com>

5 months agotests/functional: Make sure test case .py files are executable
Peter Maydell [Thu, 12 Feb 2026 15:12:58 +0000 (15:12 +0000)] 
tests/functional: Make sure test case .py files are executable

The top-level test python scripts in tests/functional are supposed to
be marked executable; "make check-functional" doesn't care about
this, but it allows them to be run as standalone executables to
exercise a single test, as docs/devel/testing/functional.rst
describes.

A couple of files have got into the tree without the executable
bit set: fix them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260212151258.1750268-1-peter.maydell@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 months agos390x/pci: prevent null pointer dereference during zpci hot unplug
Aby Sam Ross [Fri, 13 Feb 2026 06:34:43 +0000 (01:34 -0500)] 
s390x/pci: prevent null pointer dereference during zpci hot unplug

vfio-pci hostdev realize during zpci hot plug fails (in `vfio_pci_realize()`)
if the vfio group file in `/dev/vfio/` lacks appropriate permissions and the
hostdev[/properties] addition doesn't reach the point where it could be
associated with previously added zpci device (in `s390_pcihost_plug()`).
As a result, zpci iommu pointer remains null. The zpci hot unplug following the
failed hostdev addition assumes zpci iommu pointer was assigned and tries to
make use of it to end the dma count resulting in a null pointer dereference.
In the non-hotplug scenario, `qdev_unplug()` for the zpci device is not called
after hostdev addition failure and this issue is not encountered.

All other uses of zpci iommu without null check happens after both the zpci and
hostdev(pci) devices are plugged and are safe from null dereference.

Fixes: 37fa32de7073 ("s390x/pci: Honor DMA limits set by vfio")
Signed-off-by: Aby Sam Ross <abysamross@ibm.com>
Acked-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Suggested-by: Halil Pasic <pasic@linux.ibm.com>
Message-ID: <b45cefc3147c2c8446772dab0f53d030fb92406a.1770963150.git.abysamross@ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 months agoMAINTAINERS: Add self as reviewer for PowerPC TCG
Glenn Miles [Wed, 25 Feb 2026 16:21:04 +0000 (10:21 -0600)] 
MAINTAINERS: Add self as reviewer for PowerPC TCG

Added myself as a reviewer for PowerPC TCG

Signed-off-by: Glenn Miles <milesg@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260225162118.914008-1-milesg@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 months agoppc/pnv: Add OCC FLAG registers
Caleb Schlossin [Tue, 10 Feb 2026 13:46:47 +0000 (07:46 -0600)] 
ppc/pnv: Add OCC FLAG registers

OCCFLG are scratch registers that can be shared with OCC firmware.
Log reads and writes to the registers as a reminder when we run
into more OCC code.

Add RW, WO_CLEAR and WO_OR SCOM Type enums in pnv_occ.c

Reviewed-by: Chalapathi V <chalapathi.v@linux.ibm.com>
Reviewed-by: Glenn Miles <milesg@linux.ibm.com>
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
Signed-off-by: Chalapathi V <chalapathi.v@linux.ibm.com>
Signed-off-by: Caleb Schlossin <calebs@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260210134647.2050821-4-calebs@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 months agoppc/pnv: Support for SECURITY_SWITCH XSCOM register access
Caleb Schlossin [Tue, 10 Feb 2026 13:46:45 +0000 (07:46 -0600)] 
ppc/pnv: Support for SECURITY_SWITCH XSCOM register access

Power Hypervisor code requires access to the SECURITY_SWITCH
XSCOM register at MMIO address 0x80028 (scom address 0x10005).
Adding basic read support for now so that is doesn't cause
error messages to be posted.

Reviewed-by: Chalapathi V <chalapathi.v@linux.ibm.com>
Reviewed-by: Glenn Miles <milesg@linux.ibm.com>
Reviewed-by: Aditya Gupta <adityag@linux.ibm.com>
Signed-off-by: Glenn Miles <milesg@linux.ibm.com>
Signed-off-by: Caleb Schlossin <calebs@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260210134647.2050821-2-calebs@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 months agotarget/ppc/translate: Fix TCG debug assert translating CLRBWIBC
Peter Maydell [Thu, 12 Feb 2026 15:07:53 +0000 (15:07 +0000)] 
target/ppc/translate: Fix TCG debug assert translating CLRBWIBC

The test case in the ppe42 functional test triggers a TCG debug
assertion, which causes the test to fail in an --enable-debug
build or when the sanitizers are enabled:

#6  0x00007ffff4a3b517 in __assert_fail
    (assertion=0x5555562e7589 "!temp_readonly(ots)", file=0x5555562e5b23 "../../tcg/tcg.c", line=4928, function=0x5555562e8900 <__PRETTY_FUNCTION__.23> "tcg_reg_alloc_mov") at ./assert/assert.c:105
#7  0x0000555555cc2189 in tcg_reg_alloc_mov (s=0x7fff60000b70, op=0x7fff600126f8) at ../../tcg/tcg.c:4928
#8  0x0000555555cc74e0 in tcg_gen_code (s=0x7fff60000b70, tb=0x7fffa802f540, pc_start=4294446080) at ../../tcg/tcg.c:6667
#9  0x0000555555d02abe in setjmp_gen_code
    (env=0x555556cbe610, tb=0x7fffa802f540, pc=4294446080, host_pc=0x7fffeea00c00, max_insns=0x7fffee9f9d74, ti=0x7fffee9f9d90)
    at ../../accel/tcg/translate-all.c:257
#10 0x0000555555d02d75 in tb_gen_code (cpu=0x555556cba590, s=...) at ../../accel/tcg/translate-all.c:325
#11 0x0000555555cf5922 in cpu_exec_loop (cpu=0x555556cba590, sc=0x7fffee9f9ee0) at ../../accel/tcg/cpu-exec.c:970
#12 0x0000555555cf5aae in cpu_exec_setjmp (cpu=0x555556cba590, sc=0x7fffee9f9ee0) at ../../accel/tcg/cpu-exec.c:1016
#13 0x0000555555cf5b4b in cpu_exec (cpu=0x555556cba590) at ../../accel/tcg/cpu-exec.c:1042
#14 0x0000555555d1e7ab in tcg_cpu_exec (cpu=0x555556cba590) at ../../accel/tcg/tcg-accel-ops.c:82
#15 0x0000555555d1ff97 in rr_cpu_thread_fn (arg=0x555556cba590) at ../../accel/tcg/tcg-accel-ops-rr.c:285
#16 0x00005555561586c9 in qemu_thread_start (args=0x555556ee3c90) at ../../util/qemu-thread-posix.c:393
#17 0x00007ffff4a9caa4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
#18 0x00007ffff4b29c6c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

This can be reproduced "by hand":

 ./build/clang/qemu-system-ppc -display none -vga none \
    -machine ppe42_machine -serial stdio \
    -device loader,file=$HOME/.cache/qemu/download/03c1ac0fb7f6c025102a02776a93b35101dae7c14b75e4eab36a337e39042ea8 \
    -device loader,addr=0xfff80040,cpu-num=0

(assuming you have the image file from the functional test
in your local cache).

This happens for this input:

IN:
0xfff80c00:  07436004  .byte    0x07, 0x43, 0x60, 0x04

which generates (among other things):

 not_i32 $0x80000,$0x80000

which the TCG optimization pass turns into:

 mov_i32 $0x80000,$0xfff7ffff             dead: 1  pref=0xffff

and where we then assert because we tried to write to a constant.

This happens for the CLRBWIBC instruction which ends up in
do_mask_branch() with rb_is_gpr false and invert true.  In this case
we will generate code that sets mask to a tcg_constant_tl() but then
uses it as the LHS in tcg_gen_not_tl().

Fix the assertion by doing the invert in the translate time C code
for the "mask is constant" case.

Cc: qemu-stable@nongnu.org
Fixes: f7ec91c23906 ("target/ppc: Add IBM PPE42 special instructions")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Glenn Miles <milesg@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260212150753.1749448-1-peter.maydell@linaro.org
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 months agobsd-user: update aarch64-bsd-user.mak gdb XML list
Siva Mahadevan [Mon, 23 Feb 2026 17:37:24 +0000 (12:37 -0500)] 
bsd-user: update aarch64-bsd-user.mak gdb XML list

Fixes unreachable code assert in qemu:smoke / bsd-user-smoke test.

Upstream commit: https://gitlab.com/qemu-project/qemu/-/commit/591e848aca7af3b4d25af03ed5bd266c479054bf

Pull-Request: https://github.com/qemu-bsd-user/qemu-bsd-user/pull/61
Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add miscellaneous BSD syscall implementations
Stacey Son [Thu, 5 Feb 2026 16:28:26 +0000 (09:28 -0700)] 
bsd-user: Add miscellaneous BSD syscall implementations

Wire up the remaining miscellaneous BSD syscalls:
- quotactl(2): Quota control (stub returning ENOSYS)
- reboot(2): Reboot system (stub returning ENOSYS)
- uuidgen(2): Generate UUIDs
- getdtablesize(2): Get descriptor table size

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add System V message queue syscalls
Stacey Son [Thu, 5 Feb 2026 16:33:17 +0000 (09:33 -0700)] 
bsd-user: Add System V message queue syscalls

Connect the System V IPC message queue syscalls:
- msgctl(2): Message queue control
- msgget(2): Get message queue identifier
- msgsnd(2): Send message to queue
- msgrcv(2): Receive message from queue

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Implement System V semaphore calls
Stacey Son [Thu, 5 Feb 2026 16:34:00 +0000 (09:34 -0700)] 
bsd-user: Implement System V semaphore calls

Wire up semget(2) and semop(2) syscalls to get System V semaphore
implementation, as well the undocumented __semctl used to implement the
bits of the interface in libc.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add bsd-misc.c to build
Warner Losh [Thu, 5 Feb 2026 16:32:54 +0000 (09:32 -0700)] 
bsd-user: Add bsd-misc.c to build

Build bsd-misc.c for routines to support System V IPC, UUID, quotactl,
reboot and getdtablesize.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add message queue implementations
Stacey Son [Mon, 2 Feb 2026 23:46:42 +0000 (16:46 -0700)] 
bsd-user: Add message queue implementations

Add implementations for:
- msgsnd(2): Send message to queue with size validation
- msgget(2): Get message queue identifier
- msgrcv(2): Receive message from queue with size validation

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add do_bsd_msgctl implementation
Stacey Son [Mon, 2 Feb 2026 23:46:42 +0000 (16:46 -0700)] 
bsd-user: Add do_bsd_msgctl implementation

Add implementation of msgctl(2) syscall for System V message queue control
operations. Handles command translation and structure conversions for
IPC_STAT/IPC_SET/IPC_RMID operations.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add do_bsd___semctl implementation
Stacey Son [Mon, 2 Feb 2026 23:45:05 +0000 (16:45 -0700)] 
bsd-user: Add do_bsd___semctl implementation

Add implementation of __semctl(2) syscall for System V semaphore control
operations. Handles command translation, endianness conversion for GETVAL/
SETVAL, and array/structure conversions for GETALL/SETALL/IPC_STAT/IPC_SET.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add do_bsd_semop implementation
Stacey Son [Mon, 2 Feb 2026 23:44:39 +0000 (16:44 -0700)] 
bsd-user: Add do_bsd_semop implementation

Add implementation of semop(2) syscall to perform System V semaphore
operations. Converts target sembuf array to host format and executes
operations.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add do_bsd_semget implementation
Stacey Son [Mon, 2 Feb 2026 23:44:22 +0000 (16:44 -0700)] 
bsd-user: Add do_bsd_semget implementation

Add implementation of semget(2) syscall to get System V semaphore set
identifier. Converts target IPC flags to host format.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add do_bsd_uuidgen implementation
Stacey Son [Mon, 2 Feb 2026 23:41:28 +0000 (16:41 -0700)] 
bsd-user: Add do_bsd_uuidgen implementation

Add implementation of uuidgen(2) syscall that generates UUIDs and
converts them to target ABI format.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add do_bsd_quotactl, do_bsd_reboot and do_bsd_getdtablesize
Stacey Son [Mon, 2 Feb 2026 23:39:46 +0000 (16:39 -0700)] 
bsd-user: Add do_bsd_quotactl, do_bsd_reboot and do_bsd_getdtablesize

Add some trivial misc system calls: stub implementations for quotactl(2)
and reboot(2) syscall; a trivial do_bsd_getdtablesize that calls
getdtablesize(2).

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add semaphore operation constants and structures
Warner Losh [Thu, 5 Feb 2026 16:32:11 +0000 (09:32 -0700)] 
bsd-user: Add semaphore operation constants and structures

Add System V semaphore operation constants (GETVAL, SETVAL, GETALL, etc.)
and the target_sembuf and target_semun structures needed for semop(2) and
semctl(2) syscall emulation.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add host_to_target_msqid_ds for msgctl(2)
Stacey Son [Mon, 2 Feb 2026 21:56:58 +0000 (14:56 -0700)] 
bsd-user: Add host_to_target_msqid_ds for msgctl(2)

Add host_to_target_msqid_ds() to convert host struct msqid_ds to target
format for msgctl(2) IPC_STAT operations.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Brooks Davis <brooks@one-eyed-alien.net>
Signed-off-by: Sean Bruno <sbruno@FreeBSD.org>
Signed-off-by: Mikael Urankar <mikael.urankar@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add target_to_host_msqid_ds for msgctl(2)
Stacey Son [Mon, 2 Feb 2026 21:55:23 +0000 (14:55 -0700)] 
bsd-user: Add target_to_host_msqid_ds for msgctl(2)

Add target_to_host_msqid_ds() to convert target struct msqid_ds to host
format for msgctl(2) IPC_SET operations. Uses memset to zero the struct
rather than directly accessing kernel-only members. Handles FreeBSD
64-bit time_t except on i386.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Brooks Davis <brooks@one-eyed-alien.net>
Signed-off-by: Sean Bruno <sbruno@FreeBSD.org>
Signed-off-by: Mikael Urankar <mikael.urankar@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add host_to_target_semid_ds for semctl(2)
Stacey Son [Mon, 2 Feb 2026 21:53:41 +0000 (14:53 -0700)] 
bsd-user: Add host_to_target_semid_ds for semctl(2)

Add host_to_target_semid_ds() to convert host struct semid_ds to target
format for semctl(2) IPC_STAT operations.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add target_to_host_semid_ds for semctl(2)
Stacey Son [Mon, 2 Feb 2026 21:52:08 +0000 (14:52 -0700)] 
bsd-user: Add target_to_host_semid_ds for semctl(2)

Add target_to_host_semid_ds() to convert target struct semid_ds to host
format for semctl(2) IPC_SET operations.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Mikael Urankar <mikael.urankar@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add host_to_target_semarray for semaphore operations
Stacey Son [Mon, 2 Feb 2026 21:50:27 +0000 (14:50 -0700)] 
bsd-user: Add host_to_target_semarray for semaphore operations

Add host_to_target_semarray() to convert host semaphore array to target
format for semctl(2) GETALL operations.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add target_to_host_semarray for semaphore operations
Stacey Son [Mon, 2 Feb 2026 21:48:45 +0000 (14:48 -0700)] 
bsd-user: Add target_to_host_semarray for semaphore operations

Add target_to_host_semarray() to convert target semaphore array to host
format for semctl(2) SETALL operations.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add host_to_target_uuid for uuidgen(2)
Stacey Son [Mon, 2 Feb 2026 21:46:17 +0000 (14:46 -0700)] 
bsd-user: Add host_to_target_uuid for uuidgen(2)

Add host_to_target_uuid() to convert host struct uuid to target ABI
for the uuidgen(2) syscall.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add function declarations for bsd-misc.c conversions
Warner Losh [Thu, 5 Feb 2026 16:31:18 +0000 (09:31 -0700)] 
bsd-user: Add function declarations for bsd-misc.c conversions

Add function declarations for BSD System V IPC and UUID conversion
routines that will be implemented in bsd-misc.c.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add target_uuid structure for uuidgen syscall
Warner Losh [Thu, 5 Feb 2026 16:30:58 +0000 (09:30 -0700)] 
bsd-user: Add target_uuid structure for uuidgen syscall

Add the target ABI definition for struct uuid, needed for uuidgen(2)
syscall emulation.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Add target_semid_ds and target_msqid_ds structures
Warner Losh [Thu, 5 Feb 2026 16:29:58 +0000 (09:29 -0700)] 
bsd-user: Add target_semid_ds and target_msqid_ds structures

Add the target ABI definitions for System V semaphore and message queue
data structures, needed for semctl() and msgctl() syscall emulation.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Mikael Urankar <mikael.urankar@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agocommon-user: Drop __linux__ around .note.GNU-stack
Warner Losh [Thu, 5 Feb 2026 16:25:08 +0000 (09:25 -0700)] 
common-user: Drop __linux__ around .note.GNU-stack

GNU-stack tagging is a toolchain issue, not an OS issue. All the
toolchains require this for ELF.

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
5 months agobsd-user: Remove NetBSD-specific code
Warner Losh [Fri, 6 Feb 2026 15:04:01 +0000 (08:04 -0700)] 
bsd-user: Remove NetBSD-specific code

Remove the NetBSD specific code form bsd-user. It's not been maintained
in any meaningful way since it was introduced to the tree in 2008. It
hasn't been connected to the build since 2021, and last time (in 2023) I
tried to mock-up the meson support it needed, it failed to build. While
there were some out-of-tree work, I've not been able to connect with
that code.

Cc: Reinoud Zandijk <reinoud@netbsd.org>
Cc: Ryo ONODERA <ryoon@netbsd.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agobsd-user: Remove OpenBSD-specific code
Warner Losh [Fri, 6 Feb 2026 14:55:00 +0000 (07:55 -0700)] 
bsd-user: Remove OpenBSD-specific code

Remove the OpenBSD specific code form bsd-user. It's not been maintained
in any meaningful way since it was introduced to the tree in 2008. It
hasn't been connected to the build since 2021, and last time (in 2023) I
tried to mock-up the meson support it needed, it failed to build. I
contacted the OpenBSD people in 2018, it appears, and even at that time
they tought this code was not at all useful to them.

Cc: Brad Smith <brad@comstyle.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agofreebsd: FreeBSD 15 has native inotify
Warner Losh [Fri, 6 Feb 2026 16:00:30 +0000 (09:00 -0700)] 
freebsd: FreeBSD 15 has native inotify

Check to make sure that we have inotify in libc, before looking for it
in libinotify.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Daniel P. Berrange <berrange@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Warner Losh <imp@bsdimp.com>
5 months agotarget/i386: emulate: fix scas
Mohamed Mediouni [Sat, 28 Feb 2026 21:47:04 +0000 (22:47 +0100)] 
target/i386: emulate: fix scas

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260228214704.19048-9-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agowhpx: i386: expose HV_X64_MSR_APIC_FREQUENCY when kernel-irqchip=off
Mohamed Mediouni [Sat, 28 Feb 2026 21:47:03 +0000 (22:47 +0100)] 
whpx: i386: expose HV_X64_MSR_APIC_FREQUENCY when kernel-irqchip=off

Now that we expose AccessFrequencyRegs, expose HV_X64_MSR_APIC_FREQUENCY as well for the case when the Hyper-V LAPIC is not used.

If the Hyper-V LAPIC is used, this will be handled by the hypervisor instead of the VMM, hence gating it on !whpx_irqchip_in_kernel().

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260228214704.19048-8-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agowhpx: i386: enable PMU
Mohamed Mediouni [Sat, 28 Feb 2026 21:47:02 +0000 (22:47 +0100)] 
whpx: i386: enable PMU

Also a partition property instead of a CPU one...

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260228214704.19048-7-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agotarget/i386: emulate: more 64-bit register handling
Mohamed Mediouni [Sat, 28 Feb 2026 21:47:01 +0000 (22:47 +0100)] 
target/i386: emulate: more 64-bit register handling

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260228214704.19048-6-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agowhpx: i386: warn on unsupported MSR access instead of failing silently
Mohamed Mediouni [Sat, 28 Feb 2026 21:47:00 +0000 (22:47 +0100)] 
whpx: i386: warn on unsupported MSR access instead of failing silently

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260228214704.19048-5-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agowhpx: i386: enable synthetic processor features
Mohamed Mediouni [Sat, 28 Feb 2026 21:46:59 +0000 (22:46 +0100)] 
whpx: i386: enable synthetic processor features

At the point in time in which we setup the partition, the vCPUs
aren't available yet.

So enable them by default for now like what the MSHV backend does.

AccessFrequencyRegs is shared for both the LAPIC frequency reporting and the TSC frequency.

To still benefit from the fixed TSC frequency reporting when kernel-irqchip=off, still enable AccessFrequencyRegs anyway.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260228214704.19048-4-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agowhpx: i386: enable all supported host features
Mohamed Mediouni [Sat, 28 Feb 2026 21:46:58 +0000 (22:46 +0100)] 
whpx: i386: enable all supported host features

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260228214704.19048-3-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agowhpx: i386: move whpx_vcpu_kick_out_of_hlt() invocation to interrupt raise time
Mohamed Mediouni [Sat, 28 Feb 2026 21:46:57 +0000 (22:46 +0100)] 
whpx: i386: move whpx_vcpu_kick_out_of_hlt() invocation to interrupt raise time

This fixes the sti followed by hlt kvm_unit_tests.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260228214704.19048-2-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agotarget/i386: introduce ClearwaterForest-v3 to expose ITS_NO
Jon Kohler [Thu, 6 Nov 2025 17:46:25 +0000 (10:46 -0700)] 
target/i386: introduce ClearwaterForest-v3 to expose ITS_NO

Expose ITS_NO by default, as users using Clearwater Forest and higher
CPU models would not be able to live migrate to lower CPU hosts due to
missing features. In that case, they would not be vulnerable to ITS.

its-no was originally added on [1], but needs to be exposed on the
individual CPU models for the guests to see by default.

Note: Version 1 already exposes ARCH_CAP_BHI_NO, which would already
mark the CPU as invulnerable to ITS (at least in Linux); however,
expose ITS_NO for completeness.

[1] 74978391b2da ("target/i386: Make ITS_NO available to guests")

Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Jon Kohler <jon@nutanix.com>
Link: https://lore.kernel.org/r/20251106174626.49930-6-jon@nutanix.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agotarget/i386: introduce SierraForest-v5 to expose ITS_NO
Jon Kohler [Thu, 6 Nov 2025 17:46:24 +0000 (10:46 -0700)] 
target/i386: introduce SierraForest-v5 to expose ITS_NO

Expose ITS_NO by default, as users using Sierra Forest and higher
CPU models would not be able to live migrate to lower CPU hosts due to
missing features. In that case, they would not be vulnerable to ITS.

its-no was originally added on [1], but needs to be exposed on the
individual CPU models for the guests to see by default.

Note: For SRF, version 2 already exposed BHI_CTRL, which would already
mark the CPU as invulnerable to ITS (at least in Linux); however,
expose ITS_NO for completeness.

[1] 74978391b2da ("target/i386: Make ITS_NO available to guests")

Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Jon Kohler <jon@nutanix.com>
Link: https://lore.kernel.org/r/20251106174626.49930-5-jon@nutanix.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agotarget/i386: introduce GraniteRapids-v5 to expose ITS_NO
Jon Kohler [Thu, 6 Nov 2025 17:46:23 +0000 (10:46 -0700)] 
target/i386: introduce GraniteRapids-v5 to expose ITS_NO

Expose ITS_NO by default, as users using Granite Rapids and higher
CPU models would not be able to live migrate to lower CPU hosts due to
missing features. In that case, they would not be vulnerable to ITS.

its-no was originally added on [1], but needs to be exposed on the
individual CPU models for the guests to see by default.

[1] 74978391b2da ("target/i386: Make ITS_NO available to guests")

Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Jon Kohler <jon@nutanix.com>
Link: https://lore.kernel.org/r/20251106174626.49930-4-jon@nutanix.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agotarget/i386: introduce SapphireRapids-v6 to expose ITS_NO
Jon Kohler [Thu, 6 Nov 2025 17:46:22 +0000 (10:46 -0700)] 
target/i386: introduce SapphireRapids-v6 to expose ITS_NO

Expose ITS_NO by default, as users using Sapphire Rapids and higher
CPU models would not be able to live migrate to lower CPU hosts due to
missing features. In that case, they would not be vulnerable to ITS.

its-no was originally added on [1], but needs to be exposed on the
individual CPU models for the guests to see by default.

[1] 74978391b2da ("target/i386: Make ITS_NO available to guests")

Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Jon Kohler <jon@nutanix.com>
Link: https://lore.kernel.org/r/20251106174626.49930-3-jon@nutanix.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agotarget/i386: Add MSR_IA32_ARCH_CAPABILITIES ITS_NO
Jon Kohler [Thu, 6 Nov 2025 17:46:21 +0000 (10:46 -0700)] 
target/i386: Add MSR_IA32_ARCH_CAPABILITIES ITS_NO

Add bit definition for Indirect Target Selection (ITS_NO) bit 62, to
allow ITS_NO to be added directly to a CPU model in the future.

Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Jon Kohler <jon@nutanix.com>
Link: https://lore.kernel.org/r/20251106174626.49930-2-jon@nutanix.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agotarget/i386: Add VMX_SECONDARY_EXEC_MODE_BASED_EPT_EXEC
Jon Kohler [Tue, 23 Dec 2025 06:08:34 +0000 (23:08 -0700)] 
target/i386: Add VMX_SECONDARY_EXEC_MODE_BASED_EPT_EXEC

Enumerate ability to enable Intel Mode-Based Execute Control (MBEC)
on secondary execution control bit 22.

Intel MBEC is a hardware feature, introduced in the Kabylake
generation, that allows for more granular control over execution
permissions. MBEC enables the separation and tracking of execution
permissions for supervisor (kernel) and user-mode code. It is used as
an accelerator for Microsoft's Memory Integrity [1] (also known as
hypervisor-protected code integrity or HVCI).

[1] https://learn.microsoft.com/en-us/windows/security/hardware-security/enable-virtualization-based-protection-of-code-integrity

Code is mirrored here:
https://github.com/JonKohler/linux/tree/mbec-v1-6.18
https://github.com/JonKohler/kvm-unit-tests/tree/mbec-v1

LKML thread(s) are here:
Original RFC: https://lore.kernel.org/all/20250313203702.575156-1-jon@nutanix.com/
V1 code: https://lore.kernel.org/all/20251223054806.1611168-1-jon@nutanix.com/
KVM unit test changes: https://lore.kernel.org/all/20251223054850.1611618-1-jon@nutanix.com/

Cc: Xiaoyao Li <xiaoyao.li@intel.com>
Cc: Zhao Liu <zhao1.liu@intel.com>
Co-authored-by: Jon Kohler <jon@nutanix.com>
Co-authored-by: Aditya Desai <aditya.desai@nutanix.com>
Signed-off-by: Jon Kohler <jon@nutanix.com>
Link: https://lore.kernel.org/r/20251223060834.1618428-1-jon@nutanix.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agoMerge tag 'pull-11.0-testing-updates-270226-2' of https://gitlab.com/stsquad/qemu...
Peter Maydell [Sat, 28 Feb 2026 14:30:23 +0000 (14:30 +0000)] 
Merge tag 'pull-11.0-testing-updates-270226-2' of https://gitlab.com/stsquad/qemu into staging

testing updates (vm, docker, arm functional)

  - migrate non-lcitool Debian containers to Trixie (13)
  - remove legacy-test-cross hacks
  - fix some minor make vm- Makefile issues
  - bump OpenBSD to 7.8
  - add VBSA EFI functional test for Arm

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAmmhlHYACgkQ+9DbCVqe
# KkQVsQf+Mnow3ceQ4Tx9ovnn18SyS6+hXzBqUabd2aV4ybnkcwXAsY1XnArINdQP
# FuaJNgQalcaQYF9iCgZpSE0hcdk8Zt2lISZOPOAMvZ5zvia+fT2FoqKQYevIK/Oq
# 1A8g96yZW33EPi4SemEgnmXoKl8a0/HDqD7AT/L0JJuDWuldplRC2vJHoyT0tnC0
# qgTmENOGJsxbLJnpu9y2PyHpTgeRw7TdHwjN56c8Q0RjIptUFHotU47xYvMAbcdw
# E6mbeppnrOlF+0kNBy+jtAg1Fleh7JGIYbwyRh4QctRxIgTgvBJn/ej9BuljI230
# 8bCPaG6X5Ijrru66mTSQNyrsMAu4tA==
# =0Rb8
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri Feb 27 12:56:22 2026 GMT
# gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* tag 'pull-11.0-testing-updates-270226-2' of https://gitlab.com/stsquad/qemu:
  tests/functional: add Arm VBSA uefi conformance test
  tests/vm: build openbsd from lcitool data
  tests/vm: fix interactive boot
  tests/vm: remove unused import
  tests/vm: bump OpenBSD to the current 7.8 release
  tests/docker: migrate legacy-test-cross compilers to trixie
  tests/docker: upgrade most non-lcitool debian tests to debian 13

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 months agoMerge tag 'pull-9p-20260228' of https://github.com/cschoenebeck/qemu into staging
Peter Maydell [Sat, 28 Feb 2026 14:30:13 +0000 (14:30 +0000)] 
Merge tag 'pull-9p-20260228' of https://github.com/cschoenebeck/qemu into staging

9pfs changes:

* Fix crash under unlink-heavy load in v9fs_mark_fids_unreclaim().

* Fix crash with the synth fs driver.

# -----BEGIN PGP SIGNATURE-----
#
# iQJLBAABCgA1FiEEltjREM96+AhPiFkBNMK1h2Wkc5UFAmmi7dIXHHFlbXVfb3Nz
# QGNydWRlYnl0ZS5jb20ACgkQNMK1h2Wkc5Uitw//SvhQlsjdtoJjsQYNpYN7gbkC
# PwU3b88xP1iPEhZ7ZWoQYdd0bJEdb4CmfG/iKlz8jwCvY2VnX4xkfU15GYLzEtOR
# PU13dBxXPLmhRFFO6TzLm8kFwa8LkZB/Hm8cGCwBshsGwIgQAE9RNoE/LyQb6C7B
# ocgdNFXkSvaqnWY6m3PjQb59IZ1Smg5P7GMvoIzqeiVYJ6PvsLvW9V/w3UrT5dhB
# hFqK8eUgYV5Wgx1qUeYqr8O9425tdGf9cO7w1eIl/YKTQkV3wbkvY8LlARYeLU6P
# bg2eVqj3c+dDVpO0+VSNUNutV5STHYP6Ub/WEZBP92MIOx8VIvus62/zKR2Hq2uY
# e0qpC3lCvKGxzxH54GGYzUfKonLi3uv5tLMfB/EPcLQd4bH0bf23a/F5gesYvzwZ
# N8WeHxV/cNpxxkM6lIDTdSIoxtj8HXLsZxkSJ8bOPpcXd7JPfIQATfYKVvVO7AzB
# JHsGSwHZ4xKw2KuDtN6xsalf48kVi8VZpcmgmCCgFN/m0ubQTcRiIXoZ3c8j9xp/
# UqrmcpBX5uU4t0CDEm0RBwyHVey7Gv0xFg8VKfIdWczdIcGNh/VCzp8rm+zcl6FB
# XFkA7O2q/qIPNpj0JNaBekKSLvDtqjgR0rOHh0iJhhzdQWIVkbKd0OvMtmpgKlbk
# vdAulpGAJftqpoe6/zo=
# =pZuI
# -----END PGP SIGNATURE-----
# gpg: Signature made Sat Feb 28 13:29:54 2026 GMT
# gpg:                using RSA key 96D8D110CF7AF8084F88590134C2B58765A47395
# gpg:                issuer "qemu_oss@crudebyte.com"
# gpg: Good signature from "Christian Schoenebeck <qemu_oss@crudebyte.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: ECAB 1A45 4014 1413 BA38  4926 30DB 47C3 A012 D5F4
#      Subkey fingerprint: 96D8 D110 CF7A F808 4F88  5901 34C2 B587 65A4 7395

* tag 'pull-9p-20260228' of https://github.com/cschoenebeck/qemu:
  hw/9pfs: fix missing EOPNOTSUPP on Twstat and Trenameat for fs synth driver
  hw/9pfs: fix data race in v9fs_mark_fids_unreclaim()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 months agohw/9pfs: fix missing EOPNOTSUPP on Twstat and Trenameat for fs synth driver
Christian Schoenebeck [Sun, 15 Feb 2026 12:44:50 +0000 (13:44 +0100)] 
hw/9pfs: fix missing EOPNOTSUPP on Twstat and Trenameat for fs synth driver

Renaming files/dirs is only supported by path-based fs drivers. EOPNOTSUPP
should be returned on any renaming attempt for not path-based fs drivers.
This was already the case for 9p "Trename" request type. However for 9p
request types "Trenameat" and "Twstat" this was yet missing.

So fix this by checking in Twstat and Trenameat request handlers whether
the fs driver in use is really path based, if not return EOPNOTSUPP and
abort further handling of the request.

This fixes a crash with the 9p "synth" fs driver which is not path-based.

The crash happened because the synth driver stores and expects a raw
V9fsSynthNode pointer instead of a C-string on V9fsPath.data. So the
C-string delivered by 9p server to synth fs driver was incorrectly
casted to a V9fsSynthNode pointer, eventually causing a segfault.

Reported-by: Oliver Chang <ochang@google.com>
Fixes: https://issues.oss-fuzz.com/issues/477990727
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3298
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Link: https://lore.kernel.org/qemu-devel/E1vrbaP-000Gqb-B3@kylie.crudebyte.com/
5 months agohw/9pfs: fix data race in v9fs_mark_fids_unreclaim()
Richie Buturla [Wed, 11 Feb 2026 15:44:50 +0000 (16:44 +0100)] 
hw/9pfs: fix data race in v9fs_mark_fids_unreclaim()

A data race between v9fs_mark_fids_unreclaim() and v9fs_path_copy()
causes an inconsistent read of fidp->path. In v9fs_path_copy(), the
path size is set before the data pointer is allocated, creating a
window where size is non-zero but data is NULL.

v9fs_co_open2() holds a write lock during path modifications,
but v9fs_mark_fids_unreclaim() was not acquiring a read
lock, allowing it to race.

Fix by holding the path read lock during FID table iteration.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3300
Signed-off-by: Richie Buturla <richie@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260211154450.254338-1-richie@linux.ibm.com/
Fixes: 7a46274529 ("hw/9pfs: Add file descriptor reclaim support")
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
5 months agoReapply "rcu: Unify force quiescent state"
Akihiko Odaki [Tue, 17 Feb 2026 06:34:30 +0000 (15:34 +0900)] 
Reapply "rcu: Unify force quiescent state"

This reverts commit ddb4d9d1748681cfde824d765af6cda4334fcce3.

The commit says:
> This reverts commit 55d98e3edeeb17dd8445db27605d2b34f4c3ba85.
>
> The commit introduced a regression in the replay functional test
> on alpha (tests/functional/alpha/test_replay.py), that causes CI
> failures regularly. Thus revert this change until someone has
> figured out what is going wrong here.

Reapply the change as alpha is fixed.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Link: https://lore.kernel.org/r/20260217-alpha-v1-2-0dcc708c9db3@rsg.ci.i.u-tokyo.ac.jp
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agotarget/alpha: Reset CPU
Akihiko Odaki [Tue, 17 Feb 2026 06:34:29 +0000 (15:34 +0900)] 
target/alpha: Reset CPU

alpha_cpu_realizefn() did not properly call cpu_reset(), which
corrupted icount. Add the missing function call to fix icount.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Tested-by: Thomas Huth <thuth@redhat.com>
Link: https://lore.kernel.org/r/20260217-alpha-v1-1-0dcc708c9db3@rsg.ci.i.u-tokyo.ac.jp
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agohw: i386: vapic: enable on WHPX with user-mode irqchip
Mohamed Mediouni [Thu, 26 Feb 2026 18:19:30 +0000 (19:19 +0100)] 
hw: i386: vapic: enable on WHPX with user-mode irqchip

Alleviate a performance bottleneck on legacy Windows guests.

In my test setup, this makes Windows XP boot times be 20x faster
than they're otherwise.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260226181930.53170-4-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agowhpx: x86: kick out of HLT manually when using the kernel-irqchip
Mohamed Mediouni [Thu, 26 Feb 2026 18:19:29 +0000 (19:19 +0100)] 
whpx: x86: kick out of HLT manually when using the kernel-irqchip

Otherwise, interrupts processed through the cancel vCPU and inject path will not cause the vCPU to go out of its halt state.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260226181930.53170-3-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agowhpx: x86: remove inaccurate comment
Mohamed Mediouni [Thu, 26 Feb 2026 18:19:28 +0000 (19:19 +0100)] 
whpx: x86: remove inaccurate comment

WHvRunVpExitReasonX64Halt _is_ triggered on halt with kernel-irqchip=off as of Windows 11 version 25H2.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260226181930.53170-2-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agoKVM: i386: Default disable ignore guest PAT quirk
myrslint [Fri, 15 Aug 2025 16:53:09 +0000 (16:53 +0000)] 
KVM: i386: Default disable ignore guest PAT quirk

Add a new accelerator option that allows the guest to adjust the PAT.
This is already the case for TDX guests and allows using virtio-gpu
Venus with RADV or NVIDIA drivers.

The quirk is disabled by default.  Since this caused problems with
Linux's Bochs video device driver, add a knob to leave it enabled,
and for now do ont enable it by default.

Signed-off-by: Myrsky Lintu <qemu.haziness801@passinbox.com>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2943
Link: https://lore.kernel.org/r/175527721636.15451.4393515241478547957-1@git.sr.ht
[Add property; for now leave it off by default. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agorust: use checked_div to make clippy happy
John Snow [Thu, 19 Feb 2026 18:54:09 +0000 (13:54 -0500)] 
rust: use checked_div to make clippy happy

When upgrading from Fedora 41 to Fedora 43 for CI tests, clippy begins
complaining about not using checked_div instead of manually checking
divisors. Make clippy happy and use checked_div() instead.

Signed-off-by: John Snow <jsnow@redhat.com>
Link: https://lore.kernel.org/r/20260219185409.708130-2-jsnow@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agoui: drop spice-protocol < 0.14.3 support
Marc-André Lureau [Wed, 11 Feb 2026 10:01:47 +0000 (14:01 +0400)] 
ui: drop spice-protocol < 0.14.3 support

According to repology, all our supported distributions have 0.14.3.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Link: https://lore.kernel.org/r/20260211-cleanups-v1-7-e63c96572389@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agoaudio: require spice >= 0.15
Marc-André Lureau [Wed, 11 Feb 2026 10:01:45 +0000 (14:01 +0400)] 
audio: require spice >= 0.15

Spice server 0.15.0 was released on 2021-04-16. It is part of all our
supported distro (except CentOS 9, which doesn't include it).

It has all the new required audio APIs/interfaces.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Link: https://lore.kernel.org/r/20260211-cleanups-v1-5-e63c96572389@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agoaudio: require pulse >= 0.9.13
Marc-André Lureau [Wed, 11 Feb 2026 10:01:44 +0000 (14:01 +0400)] 
audio: require pulse >= 0.9.13

pulseaudio 0.9.13 was released on 2009-09-10. All our supported
distros have it.

PA_*_IS_GOOD are from 0.9.11.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Link: https://lore.kernel.org/r/20260211-cleanups-v1-4-e63c96572389@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agoscripts/vendor.py: add pycotap
Marc-André Lureau [Wed, 11 Feb 2026 10:01:43 +0000 (14:01 +0400)] 
scripts/vendor.py: add pycotap

Related to commit 5ec1eec11000ef118b2a87c330245ffaa475f5ee ("python:
Install pycotap in our venv if necessary")

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Link: https://lore.kernel.org/r/20260211-cleanups-v1-3-e63c96572389@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agopython/wheel: remove meson-1.9.0
Marc-André Lureau [Wed, 11 Feb 2026 10:01:42 +0000 (14:01 +0400)] 
python/wheel: remove meson-1.9.0

Leftover from commit 8c04b6a48b15a478ff3f9d152592a0ba503a31e4.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Link: https://lore.kernel.org/r/20260211-cleanups-v1-2-e63c96572389@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agoaudio: fix nominal volume channel (cosmetic)
Marc-André Lureau [Wed, 11 Feb 2026 10:01:41 +0000 (14:01 +0400)] 
audio: fix nominal volume channel (cosmetic)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Link: https://lore.kernel.org/r/20260211-cleanups-v1-1-e63c96572389@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agoqom: add 'confidential-guest-reset' property for x86 confidential vms
Ani Sinha [Wed, 25 Feb 2026 03:49:39 +0000 (09:19 +0530)] 
qom: add 'confidential-guest-reset' property for x86 confidential vms

Through the new 'confidential-guest-reset' property, control plane should be
able to detect if the hypervisor supports x86 confidential guest resets. Older
hypervisors that do not support resets will not have this property populated.

Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-35-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agotests/functional/x86_64: add functional test to exercise vm fd change on reset
Ani Sinha [Wed, 25 Feb 2026 03:49:38 +0000 (09:19 +0530)] 
tests/functional/x86_64: add functional test to exercise vm fd change on reset

A new functional test is added that exercises the code changes related to
closing of the old KVM VM file descriptor and opening a new one upon VM reset.
This normally happens when confidential guests are reset but for
non-confidential guests, we use a special machine specific debug/test parameter
'x-change-vmfd-on-reset' to enable this behavior.
Only specific code changes related to re-initialisation of SEV-ES, SEV-SNP and
TDX platforms are not exercised in this test as they require hardware that
supports running confidential guests.

Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-34-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agohw/machine: introduce machine specific option 'x-change-vmfd-on-reset'
Ani Sinha [Wed, 25 Feb 2026 03:49:37 +0000 (09:19 +0530)] 
hw/machine: introduce machine specific option 'x-change-vmfd-on-reset'

A new machine specific option 'x-change-vmfd-on-reset' is introduced for
debugging and testing only (hence the 'x-' prefix). This option when enabled
will force KVM VM file descriptor to be changed upon guest reset like
in the case of confidential guests. This can be used to exercise the code
changes that are specific for confidential guests on non-confidential
guests as well (except changes that require hardware support for
confidential guests).
A new functional test has been added in the next patch that uses this new
parameter to test the VM file descriptor changes.

Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-33-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agokvm/clock: add support for confidential guest reset
Ani Sinha [Wed, 25 Feb 2026 03:49:36 +0000 (09:19 +0530)] 
kvm/clock: add support for confidential guest reset

Confidential guests change the KVM VM file descriptor upon reset and also create
new VCPU file descriptors against the new KVM VM file descriptor. We need to
save the clock state from kvm before KVM VM file descriptor changes and restore
it after. Also after VCPU file descriptors changed, we must call
KVM_KVMCLOCK_CTRL on the VCPU file descriptor to inform KVM that the VCPU is
in paused state.

Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-32-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agokvm/vcpu: add notifiers to inform vcpu file descriptor change
Ani Sinha [Wed, 25 Feb 2026 03:49:35 +0000 (09:19 +0530)] 
kvm/vcpu: add notifiers to inform vcpu file descriptor change

When new vcpu file descriptors are created and bound to the new kvm file
descriptor as a part of the confidential guest reset mechanism, various
subsystems needs to know about it. This change adds notifiers so that various
subsystems can take appropriate actions when vcpu fds change by registering
their handlers to this notifier.
Subsequent changes will register specific handlers to this notifier.

Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-31-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agoppc/openpic: create a new openpic device and reattach mem region on coco reset
Ani Sinha [Wed, 25 Feb 2026 03:49:34 +0000 (09:19 +0530)] 
ppc/openpic: create a new openpic device and reattach mem region on coco reset

For confidential guests during the reset process, the old KVM VM file
descriptor is closed and a new one is created. When a new file descriptor is
created, a new openpic device needs to be created against this new KVM VM file
descriptor as well. Additionally, existing memory region needs to be reattached
to this new openpic device and proper CPU attributes set associating new file
descriptor. This change makes this happen with the help of a callback handler
that gets called when the KVM VM file descriptor changes as a part of the
confidential guest reset process.

Reviewed-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-30-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agokvm/xen-emu: re-initialize capabilities during confidential guest reset
Ani Sinha [Wed, 25 Feb 2026 03:49:33 +0000 (09:19 +0530)] 
kvm/xen-emu: re-initialize capabilities during confidential guest reset

On confidential guests KVM virtual machine file descriptor changes as a
part of the guest reset process. Xen capabilities needs to be re-initialized in
KVM against the new file descriptor.

Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-29-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agohw/hyperv/vmbus: add support for confidential guest reset
Ani Sinha [Wed, 25 Feb 2026 03:49:32 +0000 (09:19 +0530)] 
hw/hyperv/vmbus: add support for confidential guest reset

On confidential guests when the KVM virtual machine file descriptor changes as
a part of the reset process, event file descriptors needs to be reassociated
with the new KVM VM file descriptor. This is achieved with the help of a
callback handler that gets called when KVM VM file descriptor changes during
the confidential guest reset process.

This patch is tested on non-confidential platform only.

Acked-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-28-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agokvm/hyperv: add synic feature to CPU only if its not enabled
Ani Sinha [Wed, 25 Feb 2026 03:49:31 +0000 (09:19 +0530)] 
kvm/hyperv: add synic feature to CPU only if its not enabled

We need to make sure that synic CPU feature is not already enabled. If it is,
trying to enable it again will result in the following assertion:

Unexpected error in object_property_try_add() at ../qom/object.c:1268:
qemu-system-x86_64: attempt to add duplicate property 'synic' to object (type 'host-x86_64-cpu')

So enable synic only if its not enabled already.

Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-27-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agokvm/i8254: add support for confidential guest reset
Ani Sinha [Wed, 25 Feb 2026 03:49:30 +0000 (09:19 +0530)] 
kvm/i8254: add support for confidential guest reset

A confidential guest reset involves closing the old virtual machine KVM file
descriptor and opening a new one. Since its a new KVM fd, PIT needs to be
re-initialized again. This is done with the help of a notifier which is invoked
upon KVM vm file descriptor change during the confidential guest reset process.

Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-26-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agokvm/i8254: refactor pit initialization into a helper
Ani Sinha [Wed, 25 Feb 2026 03:49:29 +0000 (09:19 +0530)] 
kvm/i8254: refactor pit initialization into a helper

The initialization code will be used again by VM file descriptor change
notifier callback in a subsequent change. So refactor common code into a new
helper function.

Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-25-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agohw/vfio: generate new file fd for pseudo device and rebind existing descriptors
Ani Sinha [Fri, 27 Feb 2026 07:24:45 +0000 (12:54 +0530)] 
hw/vfio: generate new file fd for pseudo device and rebind existing descriptors

Normally the vfio pseudo device file descriptor lives for the life of the VM.
However, when the kvm VM file descriptor changes, a new file descriptor
for the pseudo device needs to be generated against the new kvm VM descriptor.
Other existing vfio descriptors needs to be reattached to the new pseudo device
descriptor. This change performs the above steps.

Tested-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260227072445.406907-1-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agoi386/sev: add support for confidential guest reset
Ani Sinha [Wed, 25 Feb 2026 03:49:27 +0000 (09:19 +0530)] 
i386/sev: add support for confidential guest reset

When the KVM VM file descriptor changes as a part of the confidential guest
reset mechanism, it necessary to create a new confidential guest context and
re-encrypt the VM memory. This happens for SEV-ES and SEV-SNP virtual machines
as a part of SEV_LAUNCH_FINISH, SEV_SNP_LAUNCH_FINISH operations.

A new resettable interface for SEV module has been added. A new reset callback
for the reset 'exit' state has been implemented to perform the above operations
when the VM file descriptor has changed during VM reset.

Tracepoints has been added also for tracing purpose.

Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-23-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agoi386/sev: free existing launch update data and kernel hashes data on init
Ani Sinha [Wed, 25 Feb 2026 03:49:26 +0000 (09:19 +0530)] 
i386/sev: free existing launch update data and kernel hashes data on init

If there is existing launch update data and kernel hashes data, they need to be
freed when initialization code is executed. This is important for resettable
confidential guests where the initialization happens once every reset.

Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-22-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agoi386/sev: add notifiers only once
Ani Sinha [Wed, 25 Feb 2026 03:49:25 +0000 (09:19 +0530)] 
i386/sev: add notifiers only once

The various notifiers that are used needs to be installed only once not on
every initialization. This includes the vm state change notifier and others.
This change uses 'cgs->ready' flag to install the notifiers only one time,
the first time.

Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-21-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agoi386/sev: add migration blockers only once
Ani Sinha [Wed, 25 Feb 2026 03:49:24 +0000 (09:19 +0530)] 
i386/sev: add migration blockers only once

sev_launch_finish() and sev_snp_launch_finish() could be called multiple times
when the confidential guest is being reset/rebooted. The migration
blockers should not be added multiple times, once per invocation. This change
makes sure that the migration blockers are added only one time by adding the
migration blockers to the vm state change handler when the vm transitions to
the running state. Subsequent reboots do not change the state of the vm.

Reviewed-by: Prasad Pandit <pjp@fedoraproject.org>
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-20-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agoi386/tdx: add a pre-vmfd change notifier to reset tdx state
Ani Sinha [Wed, 25 Feb 2026 03:49:23 +0000 (09:19 +0530)] 
i386/tdx: add a pre-vmfd change notifier to reset tdx state

During reset, when the VM file descriptor is changed, the TDX state needs to be
re-initialized. A notifier callback is implemented to reset the old
state and free memory before the new state is initialized post VM file
descriptor change.

Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-19-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 months agoi386/tdx: finalize TDX guest state upon reset
Ani Sinha [Wed, 25 Feb 2026 03:49:22 +0000 (09:19 +0530)] 
i386/tdx: finalize TDX guest state upon reset

When the confidential virtual machine KVM file descriptor changes due to the
guest reset, some TDX specific setup steps needs to be done again. This
includes finalizing the initial guest launch state again. This change
re-executes some parts of the TDX setup during the device reset phaze using a
resettable interface. This finalizes the guest launch state again and locks
it in. Machine done notifier which was previously used is no longer needed as
the same code is now executed as a part of VM reset.

Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20260225035000.385950-18-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>