]> git.ipfire.org Git - thirdparty/qemu.git/log
thirdparty/qemu.git
3 months agoutil/log: add missing error reporting in qemu_log_trylock_with_err
Daniel P. Berrangé [Tue, 13 Jan 2026 11:52:02 +0000 (11:52 +0000)] 
util/log: add missing error reporting in qemu_log_trylock_with_err

One codepath that could return NULL failed to populate the errp
object.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoutil: avoid repeated prefix on incremental qemu_log calls
Daniel P. Berrangé [Fri, 29 Aug 2025 16:04:53 +0000 (17:04 +0100)] 
util: avoid repeated prefix on incremental qemu_log calls

There are three general patterns to QEMU log output

 1. Single complete message calls

      qemu_log("Some message\n");

 2. Direct use of fprintf

      FILE *f = qemu_log_trylock()
      fprintf(f, "...");
      fprintf(f, "...");
      fprintf(f, "...\n");
      qemu_log_unlock(f)

 3. Mixed use of qemu_log_trylock/qemu_log()

      FILE *f = qemu_log_trylock()
      qemu_log("....");
      qemu_log("....");
      qemu_log("....\n");
      qemu_log_unlock(f)

When message prefixes are enabled, the timestamp will be
unconditionally emitted for all qemu_log() calls. This
works fine in the 1st case, and has no effect in the 2nd
case. In the 3rd case, however, we get the timestamp
printed over & over in each fragment.

One can suggest that pattern (3) is pointless as it is
functionally identical to (2) but with extra indirection
and overhead. None the less we have a fair bit of code
that does this.

The qemu_log() call itself is nothing more than a wrapper
which does pattern (2) with a single fprintf() call.

One might question whether (2) should include the message
prefix in the same way that (1), but there are scenarios
where this could be inappropriate / unhelpful such as the
CPU register dumps or linux-user strace output.

This patch fixes the problem in pattern (3) by keeping
track of the call depth of qemu_log_trylock() and then
only emitting the the prefix when the starting depth
was zero. In doing this qemu_log_trylock_context() is
also introduced as a variant of qemu_log_trylock()
that emits the prefix. Callers doing to batch output
can thus choose whether a prefix is appropriate or
not.

Fixes: 012842c07552 (log: make '-msg timestamp=on' apply to all qemu_log usage)
Reported-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoutil: introduce some API docs for logging APIs
Daniel P. Berrangé [Wed, 24 Sep 2025 09:16:29 +0000 (10:16 +0100)] 
util: introduce some API docs for logging APIs

There is a gotcha with qemu_log() usage in a threaded process.
If fragments of a log message are output via qemu_log() it is
possible for messages from two threads to get mixed up. To
prevent this qemu_log_trylock() should be used, along with
fprintf(f) calls.

This is a subtle problem that needs to be explained in the
API docs to ensure correct usage.

In the Rust code, the log_mask_ln method which is conceptually
equivalent to the C qemu_log() call will unconditionally append
a newline so must only ever be used for complete log messages.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoutil: add API to fetch the current thread name
Daniel P. Berrangé [Fri, 29 Aug 2025 15:30:26 +0000 (16:30 +0100)] 
util: add API to fetch the current thread name

This will be used to include the thread name in error reports
in a later patch. It returns a const string stored in a thread
local to avoid memory allocation when it is called repeatedly
in a single thread. The thread name should be set at the very
start of the thread execution, which is the case when using
qemu_thread_create.

This uses the official thread APIs for fetching thread names,
so that it captures  names of threads spawned by code in 3rd
party libraries, not merely QEMU spawned thrads.

This also addresses the gap from the previous patch for setting
the name of the main thread. A constructor is used to initialize
the 'namebuf' thread-local in the main thread only.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoutil: set the name for the 'main' thread on Windows
Daniel P. Berrangé [Wed, 6 Aug 2025 14:56:37 +0000 (15:56 +0100)] 
util: set the name for the 'main' thread on Windows

The default main thread name is undefined, so use a constructor to
explicitly set it to 'main'. This constructor is marked to run early
as the thread name is intended to be used in error reporting / logs
which may be triggered very early in QEMU execution.

This is only done on Windows platforms, because on Linux (and possibly
other POSIX platforms) changing the main thread name has a side effect
of changing the process name reported by tools like 'ps' which fetch
from the file /proc/self/task/tid/comm, expecting it to be the binary
name.

The subsequent patch will address POSIX platforms in a different way.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoaudio: make jackaudio use qemu_thread_set_name
Daniel P. Berrangé [Fri, 29 Aug 2025 15:12:32 +0000 (16:12 +0100)] 
audio: make jackaudio use qemu_thread_set_name

This has greater portability than directly call pthread_setname_np,
which is only 1 out of 3 possible functions for pthreads that can
set the name.

The new API requires a trampoline function, since it can only set
the name of the current thread.

Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoutil: expose qemu_thread_set_name
Daniel P. Berrangé [Fri, 29 Aug 2025 14:51:07 +0000 (15:51 +0100)] 
util: expose qemu_thread_set_name

The ability to set the thread name needs to be used in a number
of places, so expose the current impls as public methods.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoutil: fix race setting thread name on Win32
Daniel P. Berrangé [Tue, 10 Feb 2026 17:24:43 +0000 (17:24 +0000)] 
util: fix race setting thread name on Win32

The call to set the thread name on Win32 platforms is done by the parent
thread, after _beginthreadex() returns. At this point the new child
thread is potentially already executing its start method. To ensure the
thread name is guaranteed to be set before any "interesting" code starts
executing, it must be done in the start method of the child thread itself.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agosystem: unconditionally enable thread naming
Daniel P. Berrangé [Wed, 6 Aug 2025 12:37:52 +0000 (13:37 +0100)] 
system: unconditionally enable thread naming

When thread naming was introduced years ago, it was disabled by
default and put behind a command line flag:

  commit 8f480de0c91a18d550721f8d9af969ebfbda0793
  Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
  Date:   Thu Jan 30 10:20:31 2014 +0000

    Add 'debug-threads' suboption to --name

This was done based on a concern that something might depend
on the historical thread naming. Thread names, however, were
never promised to be part of QEMU's public API. The defaults
will vary across platforms, so no assumptions should ever be
made about naming.

An opt-in behaviour is also unfortunately incompatible with
RCU which creates its thread from an constructor function
which is run before command line args are parsed. Thus the
RCU thread lacks any name.

libvirt has unconditionally enabled debug-threads=yes on all
VMs it creates for 10 years. Interestingly this DID expose a
bug in libvirt, as it parsed /proc/$PID/stat and could not
cope with a space in the thread name. This was a latent
pre-existing bug in libvirt though, and not a part of QEMU's
API.

Having thread names always available, will allow thread names
to be included in error reports and log messags QEMU prints
by default, which will improve ability to triage QEMU bugs.

Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agomonitor: initialize global data from a constructor
Daniel P. Berrangé [Wed, 6 Aug 2025 12:49:05 +0000 (13:49 +0100)] 
monitor: initialize global data from a constructor

Some monitor functions, most notably, monitor_cur() rely on global
data being initialized by 'monitor_init_globals()'. The latter is
called relatively late in startup. If code triggers error_report()
before monitor_init_globals() is called, QEMU will abort when
accessing the uninitialized monitor mutex.

The critical monitor global data must be initialized from a
constructor function, to improve the guarantee that it is done
before any possible calls to monitor_cur(). Not only that, but
the constructor must be marked to run before the default
constructor in case any of them trigger error reporting.

Note in particular that the RCU constructor will spawn a background
thread so we might even have non-constructor QEMU code running
concurrently with other constructors.

As a general note, constructors should be extrememly careful
about what QEMU code they invoke, as it cannot be guaranteed that
the process is fully initialized and so not all normal QEMU API
rules apply.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Fixes: e69ee454b5f9 (monitor: Make current monitor a per-coroutine property)
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 months agoinclude: define constant for early constructor priority
Daniel P. Berrangé [Wed, 6 Aug 2025 14:23:13 +0000 (15:23 +0100)] 
include: define constant for early constructor priority

Functions marked with __attribute__((__constructor__)) will be
invoked in linker order. In theory this is well defined, but
in practice, it is hard to determine what this order will be
with the layers of indirection through meson, ninja and the
static libraries QEMU builds.

Notably, the order currently appears different between Linux
and Windows (as tested with Wine on Linux). This can cause
problems when certain QEMU constructors have a dependancy on
other QEMU constructors.

To address this define a QEMU_CONSTRUCTOR_EARLY constant which
provides a priority value that will run before other default
constructors. This is to be used for QEMU constructors that
are themselves self-contained, but may be relied upon by other
constructors.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 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>
3 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>
3 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>
3 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>
3 months agoMerge tag 'pull-request-2026-03-05' of https://gitlab.com/thuth/qemu into staging
Peter Maydell [Thu, 5 Mar 2026 16:58:20 +0000 (16:58 +0000)] 
Merge tag 'pull-request-2026-03-05' of https://gitlab.com/thuth/qemu into staging

* Remove deprecated i440fx and q35 machine types -2.8 up to -2.12
* Remove the related hw_compat handling in various devices

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmmpWuMACgkQLtnXdP5w
# LbXSjhAAoJ/vG6HZeuyrUzE9jkVToOpUF7d72usWS8NP07KYgKNp0kVQ/5C/QQ2s
# PR7jdWSQT7Vl+iyzvNdSV+y64rdk3XcdCrbeDXA9N4+yqWNEbq2MYECYQAW18xBR
# i8g1e9+Y/yi4yXV7U76Jx7R89btVzRdbrENlypKS2wf5wXA5m8HUegxhl8NC59eg
# u3tjZgG+tr2Fkdhs8EPA1p8naDXd00fy3imgpzN4VhGzdXTzHtH/fa5UDMjBRJtc
# NheCC4Oe0EglhDQrj+uxVf8aklCXDhSXHRKqGOOTP65z41J4gBL0k2zATAReYp3G
# RhOMtEl66U+XOFeKYxh55zS3OAK6i/Yx9K7EQwZNbZks8DJhO23Ai3TZWg086mFg
# bxr2cSpo5JKdpiQeL28GQTYA/f0wNwcn9Q01QrerfO0VTXsW4pC3rc4HukJOwp/b
# KozT4se7VtxzlJVJ7oCAYYjqiw+DZc4z7tbf/fcvyNsnHAkJB3gHeb3lJB/PW0je
# eh2N2q4Qe20ewbJbl+l+BisQ3XTDUQRf46d8iw0flvvpeAgw1Raw7cpTS+tg52wU
# UzVl8slrQcDf8Mm+BMfbcmmO7W2Zhl7c7+7RXmDVrRiHdnR4jkRcGyk4HzEObqjs
# dyYW3h2Z519TVCDdxpF6MQNy+Za9UlOOBmR0WfhRueoNM4ebCuA=
# =QYGn
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu Mar  5 10:28:51 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-05' of https://gitlab.com/thuth/qemu: (28 commits)
  hw/display/vga-pci: Do not expose the 'global-vmstate' property
  hw/audio/hda-codec: Remove HDAAudioState::use_timer field
  hw/core/machine: Remove hw_compat_2_12[] array
  hw/core/machine: Remove hw_compat_2_11[] array
  hw/input/virtio-input: Remove VirtIOInputHID::wheel_axis field
  hw/core/machine: Remove hw_compat_2_10[] array
  hw/i386/pc: Remove pc_compat_2_12[] array
  hw/i386/pc: Remove deprecated pc-q35-2.12 and pc-i440fx-2.12 machines
  hw/i386/pc: Remove pc_compat_2_11[] array
  hw/i386/pc: Remove deprecated pc-q35-2.11 and pc-i440fx-2.11 machines
  hw/i386/pc: Remove pc_compat_2_10[] array
  hw/i386/pc: Remove deprecated pc-q35-2.10 and pc-i440fx-2.10 machines
  tests/qtest/test-x86-cpuid-compat: Remove the test with the i440fx-2.9 machine
  hw/i386/x86-iommu: Remove X86IOMMUState::pt_supported field
  hw/pci-bridge/gen_pcie_rp: Remove GenPCIERootPort::migrate_msix field
  hw/net/virtio-net: Remove VirtIONet::mtu_bypass_backend field
  hw/core/machine: Remove hw_compat_2_9[] array
  hw/i386/pc: Remove pc_compat_2_9[] array
  hw/i386/pc: Remove deprecated pc-q35-2.9 and pc-i440fx-2.9 machines
  hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_INIT_PM definition
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 months agoMerge tag 'pull-loongarch-20260302' of https://github.com/gaosong715/qemu into staging
Peter Maydell [Thu, 5 Mar 2026 10:48:38 +0000 (10:48 +0000)] 
Merge tag 'pull-loongarch-20260302' of https://github.com/gaosong715/qemu into staging

pull-loongarch-20260302

# -----BEGIN PGP SIGNATURE-----
#
# iLMEAAEKAB0WIQTKRzxE1qCcGJoZP81FK5aFKyaCFgUCaaVgvwAKCRBFK5aFKyaC
# FsyvA/oD4HhxbCjv6ukdYHkSj3rMxo0aTV9RzNSUGhdrC4v6LPnRf2JeEV9K65BU
# HEctYSMI64iasQBQx1FruFlVMJz+mYhHwv+FvE94TrZq1lTmbYdO1qOTChO+m+60
# B2qtT3pORejLLeawHighD9d8MkbNlXsysSMFRn4PwRYvFmYY9w==
# =CYNU
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon Mar  2 10:04:47 2026 GMT
# gpg:                using RSA key CA473C44D6A09C189A193FCD452B96852B268216
# gpg: Good signature from "Song Gao <gaosong@loongson.cn>" [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: CA47 3C44 D6A0 9C18 9A19  3FCD 452B 9685 2B26 8216

* tag 'pull-loongarch-20260302' of https://github.com/gaosong715/qemu:
  target/loongarch: Add some CPUCFG bits with host CPU model
  target/loongarch: Add host CPU model in kvm mode
  target/loongarch: Add generic CPU model information
  target/loongarch: Add default cpucfg3 with LA464 CPU
  target/loongarch: Add detailed information with CPU Product ID
  target/loongarch: Add property set with query-cpu-model-expansion
  target/loongarch: Add full type support with query-cpu-model-expansion
  target/loongarch: Add missing vCPU features with QMP method

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 months agohw/display/vga-pci: Do not expose the 'global-vmstate' property
Philippe Mathieu-Daudé [Thu, 1 May 2025 23:01:28 +0000 (01:01 +0200)] 
hw/display/vga-pci: Do not expose the 'global-vmstate' property

The "global-vmstate" property is 'false' by default, and was only
set to 'true' in the hw_compat_2_12[] array. We removed all machines
using that array. Stop exposing that property on the PCI devices.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501230129.2596-11-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 months agohw/audio/hda-codec: Remove HDAAudioState::use_timer field
Philippe Mathieu-Daudé [Thu, 1 May 2025 23:01:27 +0000 (01:01 +0200)] 
hw/audio/hda-codec: Remove HDAAudioState::use_timer field

The HDAAudioState::use_timer boolean was only set in the
hw_compat_2_12[] array, via the 'use-timer=false' property.
We removed all machines using that array, lets remove that
property and all the code around it, like the compatibility
callbacks.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501230129.2596-10-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
[thuth: Rebased the patch to current master branch, fixed conflicts]
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 months agohw/core/machine: Remove hw_compat_2_12[] array
Philippe Mathieu-Daudé [Thu, 1 May 2025 23:01:26 +0000 (01:01 +0200)] 
hw/core/machine: Remove hw_compat_2_12[] array

The hw_compat_2_12[] array was only used by the pc-q35-2.12,
pc-i440fx-2.12 and s390-ccw-virtio-2.12 machines, which got
removed. Remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501230129.2596-9-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 months agohw/core/machine: Remove hw_compat_2_11[] array
Philippe Mathieu-Daudé [Thu, 1 May 2025 23:01:22 +0000 (01:01 +0200)] 
hw/core/machine: Remove hw_compat_2_11[] array

The hw_compat_2_11[] array was only used by the pc-q35-2.11,
pc-i440fx-2.11 and s390-ccw-virtio-2.11 machines, which got
removed. Remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501230129.2596-5-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 months agohw/input/virtio-input: Remove VirtIOInputHID::wheel_axis field
Philippe Mathieu-Daudé [Thu, 1 May 2025 23:01:21 +0000 (01:01 +0200)] 
hw/input/virtio-input: Remove VirtIOInputHID::wheel_axis field

The VirtIOInputHID::wheel_axis boolean was only set in the
hw_compat_2_10[] array, via the 'wheel-axis=false' property.
We removed all machines using that array, lets remove that
property and all the code around it. There is only one
virtio_input_config[] version for each device, rename it
removing the '_v2' suffix.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501230129.2596-4-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 months agohw/core/machine: Remove hw_compat_2_10[] array
Philippe Mathieu-Daudé [Thu, 1 May 2025 23:01:20 +0000 (01:01 +0200)] 
hw/core/machine: Remove hw_compat_2_10[] array

The hw_compat_2_10[] array was only used by the pc-q35-2.10,
pc-i440fx-2.10 and s390-ccw-virtio-2.10 machines, which got
removed. Remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501230129.2596-3-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 months agohw/i386/pc: Remove pc_compat_2_12[] array
Philippe Mathieu-Daudé [Thu, 1 May 2025 22:35:22 +0000 (00:35 +0200)] 
hw/i386/pc: Remove pc_compat_2_12[] array

The pc_compat_2_12[] array was only used by the pc-q35-2.12
and pc-i440fx-2.12 machines, which got removed. Remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501223522.99772-9-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 months agohw/i386/pc: Remove deprecated pc-q35-2.12 and pc-i440fx-2.12 machines
Philippe Mathieu-Daudé [Thu, 1 May 2025 22:35:21 +0000 (00:35 +0200)] 
hw/i386/pc: Remove deprecated pc-q35-2.12 and pc-i440fx-2.12 machines

These machines has been supported for a period of more than 6 years.
According to our versioned machine support policy (see commit
ce80c4fa6ff "docs: document special exception for machine type
deprecation & removal") they can now be removed.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501223522.99772-8-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 months agohw/i386/pc: Remove pc_compat_2_11[] array
Philippe Mathieu-Daudé [Thu, 1 May 2025 22:35:20 +0000 (00:35 +0200)] 
hw/i386/pc: Remove pc_compat_2_11[] array

The pc_compat_2_11[] array was only used by the pc-q35-2.11
and pc-i440fx-2.11 machines, which got removed. Remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501223522.99772-7-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 months agohw/i386/pc: Remove deprecated pc-q35-2.11 and pc-i440fx-2.11 machines
Philippe Mathieu-Daudé [Thu, 1 May 2025 22:35:19 +0000 (00:35 +0200)] 
hw/i386/pc: Remove deprecated pc-q35-2.11 and pc-i440fx-2.11 machines

These machines has been supported for a period of more than 6 years.
According to our versioned machine support policy (see commit
ce80c4fa6ff "docs: document special exception for machine type
deprecation & removal") they can now be removed.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501223522.99772-6-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 months agohw/i386/pc: Remove pc_compat_2_10[] array
Philippe Mathieu-Daudé [Thu, 1 May 2025 22:35:16 +0000 (00:35 +0200)] 
hw/i386/pc: Remove pc_compat_2_10[] array

The pc_compat_2_10[] array was only used by the pc-q35-2.10
and pc-i440fx-2.10 machines, which got removed. Remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501223522.99772-3-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 months agohw/i386/pc: Remove deprecated pc-q35-2.10 and pc-i440fx-2.10 machines
Philippe Mathieu-Daudé [Thu, 1 May 2025 22:35:15 +0000 (00:35 +0200)] 
hw/i386/pc: Remove deprecated pc-q35-2.10 and pc-i440fx-2.10 machines

These machines has been supported for a period of more than 6 years.
According to our versioned machine support policy (see commit
ce80c4fa6ff "docs: document special exception for machine type
deprecation & removal") they can now be removed.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501223522.99772-2-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 months agotests/qtest/test-x86-cpuid-compat: Remove the test with the i440fx-2.9 machine
Thomas Huth [Wed, 25 Feb 2026 09:20:24 +0000 (10:20 +0100)] 
tests/qtest/test-x86-cpuid-compat: Remove the test with the i440fx-2.9 machine

The machine has been removed, so the related test can now be removed, too.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260225092024.794595-17-thuth@redhat.com>

3 months agohw/i386/x86-iommu: Remove X86IOMMUState::pt_supported field
Philippe Mathieu-Daudé [Wed, 25 Feb 2026 09:20:23 +0000 (10:20 +0100)] 
hw/i386/x86-iommu: Remove X86IOMMUState::pt_supported field

The X86IOMMUState::pt_supported boolean was only set in
the hw_compat_2_9[] array, via the 'pt=off' property. We
removed all machines using that array, lets remove that
property and all the code around it, always setting the
VTD_ECAP_PT capability.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501210456.89071-19-philmd@linaro.org>
[thuth: Dropped the hunks that were already merged via commit 31753d5a336f]
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260225092024.794595-16-thuth@redhat.com>

3 months agohw/pci-bridge/gen_pcie_rp: Remove GenPCIERootPort::migrate_msix field
Philippe Mathieu-Daudé [Wed, 25 Feb 2026 09:20:22 +0000 (10:20 +0100)] 
hw/pci-bridge/gen_pcie_rp: Remove GenPCIERootPort::migrate_msix field

The GenPCIERootPort::migrate_msix boolean was only set in
the hw_compat_2_9[] array, via the 'x-migrate-msix=false'
property. We removed all machines using that array, lets
remove that property and all the code around it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501210456.89071-18-philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260225092024.794595-15-thuth@redhat.com>

3 months agohw/net/virtio-net: Remove VirtIONet::mtu_bypass_backend field
Philippe Mathieu-Daudé [Wed, 25 Feb 2026 09:20:21 +0000 (10:20 +0100)] 
hw/net/virtio-net: Remove VirtIONet::mtu_bypass_backend field

The VirtIONet::mtu_bypass_backend boolean was only set in
the hw_compat_2_9[] array, via the 'x-mtu-bypass-backend=off'
property. We removed all machines using that array, lets remove
that property and all the code around it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501210456.89071-17-philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
[thuth: Adjusted patch for latest changes in the master branch]
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260225092024.794595-14-thuth@redhat.com>

3 months agohw/core/machine: Remove hw_compat_2_9[] array
Philippe Mathieu-Daudé [Wed, 25 Feb 2026 09:20:20 +0000 (10:20 +0100)] 
hw/core/machine: Remove hw_compat_2_9[] array

The hw_compat_2_9[] array was only used by the pc-q35-2.9 and
pc-i440fx-2.9 machines, which got removed. Remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501210456.89071-16-philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260225092024.794595-13-thuth@redhat.com>

3 months agohw/i386/pc: Remove pc_compat_2_9[] array
Philippe Mathieu-Daudé [Wed, 25 Feb 2026 09:20:19 +0000 (10:20 +0100)] 
hw/i386/pc: Remove pc_compat_2_9[] array

The pc_compat_2_9[] array was only used by the pc-q35-2.9
and pc-i440fx-2.9 machines, which got removed. Remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501210456.89071-15-philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260225092024.794595-12-thuth@redhat.com>

3 months agohw/i386/pc: Remove deprecated pc-q35-2.9 and pc-i440fx-2.9 machines
Philippe Mathieu-Daudé [Wed, 25 Feb 2026 09:20:18 +0000 (10:20 +0100)] 
hw/i386/pc: Remove deprecated pc-q35-2.9 and pc-i440fx-2.9 machines

These machines has been supported for a period of more than 6 years.
According to our versioned machine support policy (see commit
ce80c4fa6ff "docs: document special exception for machine type
deprecation & removal") they can now be removed.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501210456.89071-14-philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260225092024.794595-11-thuth@redhat.com>

3 months agohw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_INIT_PM definition
Philippe Mathieu-Daudé [Wed, 25 Feb 2026 09:20:17 +0000 (10:20 +0100)] 
hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_INIT_PM definition

VIRTIO_PCI_FLAG_INIT_PM was only used by the hw_compat_2_8[]
array, via the 'x-pcie-pm-init=off' property. We removed all
machines using that array, lets remove all the code around
VIRTIO_PCI_FLAG_INIT_PM (see commit 9a4c0e220d8 for similar
VIRTIO_PCI_FLAG_* enum removal).

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501210456.89071-11-philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260225092024.794595-10-thuth@redhat.com>

3 months agohw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_INIT_LNKCTL definition
Philippe Mathieu-Daudé [Wed, 25 Feb 2026 09:20:16 +0000 (10:20 +0100)] 
hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_INIT_LNKCTL definition

VIRTIO_PCI_FLAG_INIT_LNKCTL was only used by the hw_compat_2_8[]
array, via the 'x-pcie-lnkctl-init=off' property. We removed all
machines using that array, lets remove all the code around
VIRTIO_PCI_FLAG_INIT_LNKCTL (see commit 9a4c0e220d8 for similar
VIRTIO_PCI_FLAG_* enum removal).

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501210456.89071-10-philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260225092024.794595-9-thuth@redhat.com>

3 months agohw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_INIT_DEVERR definition
Philippe Mathieu-Daudé [Wed, 25 Feb 2026 09:20:15 +0000 (10:20 +0100)] 
hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_INIT_DEVERR definition

VIRTIO_PCI_FLAG_INIT_DEVERR was only used by the hw_compat_2_8[]
array, via the 'x-pcie-deverr-init=off' property. We removed all
machines using that array, lets remove all the code around
VIRTIO_PCI_FLAG_INIT_DEVERR (see commit 9a4c0e220d8 for similar
VIRTIO_PCI_FLAG_* enum removal).

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501210456.89071-9-philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260225092024.794595-8-thuth@redhat.com>

3 months agohw/pci/pcie: Remove QEMU_PCIE_EXTCAP_INIT definition
Philippe Mathieu-Daudé [Wed, 25 Feb 2026 09:20:14 +0000 (10:20 +0100)] 
hw/pci/pcie: Remove QEMU_PCIE_EXTCAP_INIT definition

QEMU_PCIE_EXTCAP_INIT was only used by the hw_compat_2_8[]
array, via the 'x-pcie-extcap-init=off' property. We removed
all machines using that array, let's remove all the code around
QEMU_PCIE_EXTCAP_INIT.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501210456.89071-8-philmd@linaro.org>
[thuth: Don't remove pci_set_long(), execute it always instead]
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260225092024.794595-7-thuth@redhat.com>

3 months agohw/block/pflash: Remove PFlashCFI01::old_multiple_chip_handling field
Philippe Mathieu-Daudé [Wed, 25 Feb 2026 09:20:13 +0000 (10:20 +0100)] 
hw/block/pflash: Remove PFlashCFI01::old_multiple_chip_handling field

The PFlashCFI01::old_multiple_chip_handling boolean was only set
in the hw_compat_2_8[] array, via the 'old-multiple-chip-handling=on'
property. We removed all machines using that array, let's remove that
property and all the code around it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501210456.89071-7-philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260225092024.794595-6-thuth@redhat.com>

3 months agohw/core/machine: Remove hw_compat_2_8[] array
Philippe Mathieu-Daudé [Wed, 25 Feb 2026 09:20:12 +0000 (10:20 +0100)] 
hw/core/machine: Remove hw_compat_2_8[] array

The hw_compat_2_8[] array was only used by the pc-q35-2.8 and
pc-i440fx-2.8 machines, which got removed. Remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501210456.89071-6-philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260225092024.794595-5-thuth@redhat.com>

3 months agohw/i386/kvm: Remove KVMClockState::mach_use_reliable_get_clock field
Philippe Mathieu-Daudé [Wed, 25 Feb 2026 09:20:11 +0000 (10:20 +0100)] 
hw/i386/kvm: Remove KVMClockState::mach_use_reliable_get_clock field

The KVMClockState::mach_use_reliable_get_clock boolean was only
used by the pc-q35-2.8 and pc-i440fx-2.8 machines, which got removed.
Remove it, along with the 'x-mach-use-reliable-get-clock' property.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501210456.89071-5-philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260225092024.794595-4-thuth@redhat.com>

3 months agohw/i386/pc: Remove pc_compat_2_8[] array
Philippe Mathieu-Daudé [Wed, 25 Feb 2026 09:20:10 +0000 (10:20 +0100)] 
hw/i386/pc: Remove pc_compat_2_8[] array

The pc_compat_2_8[] array was only used by the pc-q35-2.8
and pc-i440fx-2.8 machines, which got removed. Remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250501210456.89071-3-philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260225092024.794595-3-thuth@redhat.com>

3 months agohw/i386/pc: Remove deprecated pc-q35-2.8 and pc-i440fx-2.8 machines
Philippe Mathieu-Daudé [Wed, 25 Feb 2026 09:20:09 +0000 (10:20 +0100)] 
hw/i386/pc: Remove deprecated pc-q35-2.8 and pc-i440fx-2.8 machines

These machines has been supported for a period of more than 6 years.
According to our versioned machine support policy (see commit
ce80c4fa6ff "docs: document special exception for machine type
deprecation & removal") they can now be removed.

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

3 months agomirror: Fix missed dirty bitmap writes during startup
Kevin Wolf [Thu, 19 Feb 2026 20:24:46 +0000 (21:24 +0100)] 
mirror: Fix missed dirty bitmap writes during startup

Currently, mirror disables the block layer's dirty bitmap before its own
replacement is working. This means that during startup, there is a
window in which the allocation status of blocks in the source has
already been checked, but new writes coming in aren't tracked yet,
resulting in a corrupted copy:

1. Dirty bitmap is disabled in mirror_start_job()
2. Some request are started in mirror_top_bs while s->job == NULL
3. mirror_dirty_init() -> bdrv_co_is_allocated_above() runs and because
   the request hasn't completed yet, the block isn't allocated
4. The request completes, still sees s->job == NULL and skips the
   bitmap, and nothing else will mark it dirty either

One ingredient is that mirror_top_opaque->job is only set after the
job is fully initialized. For the rationale, see commit 32125b1460
("mirror: Fix access of uninitialised fields during start").

Fix this by giving mirror_top_bs access to dirty_bitmap and enabling it
to track writes from the beginning. Disabling the block layer's tracking
and enabling the mirror_top_bs one happens in a drained section, so
there is no danger of races with in-flight requests any more. All of
this happens well before the block allocation status is checked, so we
can be sure that no writes will be missed.

Cc: qemu-stable@nongnu.org
Closes: https://gitlab.com/qemu-project/qemu/-/issues/3273
Fixes: 32125b14606a ('mirror: Fix access of uninitialised fields during start')
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20260219202446.312493-1-kwolf@redhat.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Jean-Louis Dupond <jean-louis@dupond.be>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
3 months agoblock/curl: fix concurrent completion handling
Antoine Damhet [Thu, 12 Feb 2026 16:27:24 +0000 (17:27 +0100)] 
block/curl: fix concurrent completion handling

curl_multi_check_completion would bail upon the first completed
transfer even if more completion messages were available thus leaving
some in flight IOs stuck.

Rework a bit the loop to make the iterations clearer and drop the breaks.

The original hang can be somewhat reproduced with the following command:

$ qemu-img convert -p -m 16 -O qcow2 -c --image-opts \
  'file.driver=https,file.url=https://scaleway.testdebit.info/10G.iso,file.readahead=1M' \
  /tmp/test.qcow2

Fixes: 1f2cead32443 ("curl: Ensure all informationals are checked for completion")
Cc: qemu-stable@nongnu.org
Signed-off-by: Antoine Damhet <adamhet@scaleway.com>
Message-ID: <20260212162730.440855-2-adamhet@scaleway.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
3 months agohmp_nbd_server_start: Don't ask for backing image data
Peter Krempa [Wed, 4 Feb 2026 13:15:44 +0000 (14:15 +0100)] 
hmp_nbd_server_start: Don't ask for backing image data

'hmp_nbd_server_start' uses only the device name from the data returned
from 'qmp_query_block', thus no backing file information. Use the new
options to suppress asking for the unused parts to save on resources.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <df71ca72a96d870758695ac57772fcfb87dc8fa0.1770210044.git.pkrempa@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
3 months agoblock: Wire up 'flat' mode also for 'query-block'
Peter Krempa [Wed, 4 Feb 2026 13:15:43 +0000 (14:15 +0100)] 
block: Wire up 'flat' mode also for 'query-block'

Some time ago (commit facda5443f5a8) I've added 'flat' mode (which
omits 'backing-image' key in reply) to 'query-named-block-nodes' to
minimize the size of the returned JSON for deeper backing chains.

While 'query-block' behaved slightly better it turns out that in libvirt
we do call 'query-block' to figure out some information about the
block device (e.g. throttling info) but we don't look at the backing
chain itself.

Wire up 'flat' for 'query-block' so that libvirt can ask for an
abbreviated output. The implementation is much simpler as the internals
are shared with 'query-named-block-nodes'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <f4476e9f7e8fda74c02be3f806acaa9aa2df4d9a.1770210044.git.pkrempa@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
3 months agoblock/vmdk: fix OOB read in vmdk_read_extent()
Halil Oktay (oblivionsage) [Tue, 10 Feb 2026 12:33:25 +0000 (13:33 +0100)] 
block/vmdk: fix OOB read in vmdk_read_extent()

Bounds check for marker.size doesn't account for the 12-byte marker
header, allowing zlib to read past the allocated buffer.

Move the check inside the has_marker block and subtract the marker size.

Fixes: CVE-2026-2243
Reported-by: Halil Oktay (oblivionsage) <cookieandcream560@gmail.com>
Signed-off-by: Halil Oktay (oblivionsage) <cookieandcream560@gmail.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
3 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>
3 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>
3 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>
3 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>
3 months agotarget/loongarch: Add some CPUCFG bits with host CPU model
Bibo Mao [Wed, 25 Feb 2026 01:41:31 +0000 (09:41 +0800)] 
target/loongarch: Add some CPUCFG bits with host CPU model

Some CPUCFG capability bits depend on KVM host hypervsior and they
are detected on QEMU. However some CPUCFG bits are irrelative with
hypervsior, here these bits are checked from host machine and set
for VM with host CPU model.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
3 months agotarget/loongarch: Add host CPU model in kvm mode
Bibo Mao [Wed, 25 Feb 2026 01:41:30 +0000 (09:41 +0800)] 
target/loongarch: Add host CPU model in kvm mode

Host CPU model is basically the same with max CPU model, except Product
ID and CPU model name. With host CPU model, Product ID comes from
cpucfg0 and CPU model comes from /proc/cpuinfo.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
3 months agotarget/loongarch: Add generic CPU model information
Bibo Mao [Wed, 25 Feb 2026 01:41:29 +0000 (09:41 +0800)] 
target/loongarch: Add generic CPU model information

On LoongArch system, CPU model name comes from IOCSR register
LOONGARCH_IOCSR_VENDOR and LOONGARCH_IOCSR_CPUNAME. Its value
can be initialized when CPU is created.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
3 months agotarget/loongarch: Add default cpucfg3 with LA464 CPU
Bibo Mao [Wed, 25 Feb 2026 01:41:28 +0000 (09:41 +0800)] 
target/loongarch: Add default cpucfg3 with LA464 CPU

The features shown in cpucfg3 mostly are relative with cache capability,
QEMU does not support cache emulation and discard these features.
However it will be better if it is the same with host machine.

Here add default cpucfg3 feature information with LA464 CPU.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
3 months agotarget/loongarch: Add detailed information with CPU Product ID
Bibo Mao [Wed, 25 Feb 2026 01:41:27 +0000 (09:41 +0800)] 
target/loongarch: Add detailed information with CPU Product ID

CPUCFG0 is LoongArch CPU Product ID, it is a combination of Vendor ID,
Series ID and Product ID, here is the layout:
 +-------------+----------------+------------+----------------+
 | Reserved    | Vendor  ID     | Series ID  |  Product ID    |
 +-------------+----------------+------------+----------------+
  31         24 23            16 15        12 11              0

Here adds detailed information with CPUCFG0, it is convenient to add
such information with host or LA664 CPU type in future.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Song Gao <gaosong@loongson.cn>
3 months agotarget/loongarch: Add property set with query-cpu-model-expansion
Bibo Mao [Mon, 19 Jan 2026 10:07:02 +0000 (18:07 +0800)] 
target/loongarch: Add property set with query-cpu-model-expansion

On LoongArch with QMP command query-cpu-model-expansion, property
setting is not supported witch command such as:
  query-cpu-model-expansion type=static model={"name":"max","props":{"lasx":false}}

Here add property setting support with QMP command.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
3 months agotarget/loongarch: Add full type support with query-cpu-model-expansion
Bibo Mao [Mon, 19 Jan 2026 10:07:01 +0000 (18:07 +0800)] 
target/loongarch: Add full type support with query-cpu-model-expansion

On LoongArch with QMP command query-cpu-model-expansion, only static
type is supported, full type is not supported. Here add full type support
with QMP cpu model query command.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
3 months agotarget/loongarch: Add missing vCPU features with QMP method
Bibo Mao [Mon, 19 Jan 2026 10:07:00 +0000 (18:07 +0800)] 
target/loongarch: Add missing vCPU features with QMP method

Feature msgint and ptw is missing with QMP method, such as:
  query-cpu-model-expansion type=static model={"name":"max"}

Here add missing features in cpu_model_advertised_features array.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>

3 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>

3 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>

3 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>

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>