No description
Find a file
Geoffrey Thomas a4e31f5d8e linux-user: Hold the fd-trans lock across fork
If another thread is holding target_fd_trans_lock during a fork,
then the lock becomes permanently locked in the child and the
emulator deadlocks at the next interaction with the fd-trans table.
As with other locks, acquire the lock in fork_start() and release
it in fork_end().

Cc: qemu-stable@nongnu.org
Signed-off-by: Geoffrey Thomas <geofft@ldpreload.com>
Fixes: c093364f4d "fd-trans: Fix race condition on reallocation of the translation table."
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2846
Buglink: https://github.com/astral-sh/uv/issues/6105
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250314124742.4965-1-geofft@ldpreload.com>
(cherry picked from commit e4e839b2ee)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2025-07-13 11:23:43 +03:00
.github/workflows
.gitlab/issue_templates
.gitlab-ci.d meson.build: Set RUST_BACKTRACE for all tests 2025-03-14 12:54:33 +00:00
accel accel/tcg: Don't use TARGET_LONG_BITS in decode_sleb128 2025-05-07 16:42:10 +03:00
audio audio: fix size calculation in AUD_get_buffer_size_out() 2025-06-05 15:10:24 +03:00
authz
backends cryptodev: Fix error handling in cryptodev_lkcf_execute_task() 2025-03-19 07:53:11 +01:00
block qcow2: Don't crash qemu-img info with missing crypto header 2025-04-08 12:13:17 +02:00
bsd-user exec/cpu-all: remove BSWAP_NEEDED 2025-03-21 12:53:36 +01:00
chardev
common-user common-user/host/riscv: use tail pseudoinstruction for calling tail 2025-05-20 09:56:01 +03:00
configs hw/arm: Do not build VMapple machine by default 2025-04-03 16:11:09 -07:00
contrib
crypto
disas
docs Revert "Drop support for Python 3.8" 2025-05-28 10:49:31 +03:00
dump
ebpf
fpu
fsdev
gdb-xml
gdbstub
host/include host/include/loongarch64: Fix inline assembly compatibility with Clang 2025-03-21 11:31:56 +08:00
hw hw/arm/fsl-imx8mp: Wire VIRQ and VFIQ 2025-07-13 11:16:36 +03:00
include vhost: Don't set vring call if guest notifier is unused 2025-06-02 23:49:34 +03:00
io
libdecnumber
linux-headers
linux-user linux-user: Hold the fd-trans lock across fork 2025-07-13 11:23:43 +03:00
migration migration: Allow caps to be set when preempt or multifd cap enabled 2025-05-22 23:13:03 +03:00
monitor
nbd
net error: Strip trailing '\n' from an error string argument 2025-03-19 07:53:26 +01:00
pc-bios ppc/pnv: Add a default formatted PNOR image 2025-03-11 22:43:31 +10:00
plugins plugins/loader: fix deadlock when resetting/uninstalling a plugin 2025-04-09 10:35:29 +01:00
po
python Revert "Drop support for Python 3.8" 2025-05-28 10:49:31 +03:00
qapi qapi/misc-target: Fix the doc to distinguish query-sgx and query-sgx-capabilities 2025-05-22 16:09:32 +03:00
qga qga/qapi-schema: Add a proper introduction 2025-04-08 09:04:34 +02:00
qobject
qom
replay
roms ppc/pnv: Make HOMER memory a RAM region 2025-03-11 22:43:30 +10:00
rust rust: hpet: fix decoding of timer registers 2025-03-21 19:34:36 +01:00
scripts Revert "Drop support for Python 3.8" 2025-05-28 10:49:31 +03:00
scsi
semihosting
stats
storage-daemon storage-daemon/qapi/qapi-schema: Add a proper introduction 2025-04-08 09:04:34 +02:00
stubs
subprojects
system system/main: transfer replay mutex ownership from main thread to main loop thread 2025-04-14 11:03:16 -04:00
target target/arm: Don't enforce NSE,NS check for EL3->EL3 returns 2025-07-13 11:16:20 +03:00
tcg tcg: Fix constant propagation in tcg_reg_alloc_dup 2025-07-01 22:02:27 +03:00
tests iotests: fix 240 2025-06-05 23:59:13 +03:00
tools
trace trace/control-target: cleanup headers and make compilation unit common 2025-03-11 10:11:29 +08:00
ui ui/vnc: fix tight palette pixel encoding for 8/16-bpp formats 2025-05-30 15:26:28 +03:00
util util/cacheflush: Make first DSB unconditional on aarch64 2025-03-14 12:54:33 +00:00
.b4-config
.dir-locals.el
.editorconfig
.exrc
.gdbinit
.git-blame-ignore-revs
.gitattributes
.gitignore
.gitlab-ci.yml
.gitmodules
.gitpublish
.mailmap mailmap: Update email address for Akihiko Odaki 2025-03-21 11:15:18 +03:00
.patchew.yml
.readthedocs.yml
.travis.yml
block.c
blockdev-nbd.c
blockdev.c
blockjob.c
configure Revert "Drop support for Python 3.8" 2025-05-28 10:49:31 +03:00
COPYING
COPYING.LIB
cpu-common.c
cpu-target.c
event-loop-base.c
gitdm.config
hmp-commands-info.hx
hmp-commands.hx
iothread.c
job-qmp.c
job.c test-bdrv-drain: Fix data races 2025-04-08 15:00:01 +02:00
Kconfig
Kconfig.host
LICENSE
MAINTAINERS Fifth RISC-V PR for 10.0 2025-03-28 08:06:53 -04:00
Makefile Makefile: "make dist" generates a .xz, not .bz2 2025-03-21 11:13:52 +03:00
meson.build meson: Use osdep_prefix for strchrnul() 2025-04-29 10:07:56 +03:00
meson_options.txt Revert "meson.build: default to -gsplit-dwarf for debug info" 2025-03-17 14:22:07 +01:00
module-common.c
os-posix.c
os-win32.c
page-target.c
page-vary-common.c
page-vary-target.c
pythondeps.toml
qemu-bridge-helper.c
qemu-edid.c
qemu-img-cmds.hx
qemu-img.c qemu-img: fix division by zero in bench_cb() for zero-sized images 2025-04-08 12:13:17 +02:00
qemu-io-cmds.c
qemu-io.c
qemu-keymap.c
qemu-nbd.c
qemu-options.hx qemu-options.hx: Fix reversed description of icount sleep behavior 2025-06-17 23:30:17 +03:00
qemu.nsi
qemu.sasl
README.rst
replication.c
trace-events
VERSION Update version for 10.0.2 release 2025-05-28 10:55:26 +03:00
version.rc

===========
QEMU README
===========

QEMU is a generic and open source machine & userspace emulator and
virtualizer.

QEMU is capable of emulating a complete machine in software without any
need for hardware virtualization support. By using dynamic translation,
it achieves very good performance. QEMU can also integrate with the Xen
and KVM hypervisors to provide emulated hardware while allowing the
hypervisor to manage the CPU. With hypervisor support, QEMU can achieve
near native performance for CPUs. When QEMU emulates CPUs directly it is
capable of running operating systems made for one machine (e.g. an ARMv7
board) on a different machine (e.g. an x86_64 PC board).

QEMU is also capable of providing userspace API virtualization for Linux
and BSD kernel interfaces. This allows binaries compiled against one
architecture ABI (e.g. the Linux PPC64 ABI) to be run on a host using a
different architecture ABI (e.g. the Linux x86_64 ABI). This does not
involve any hardware emulation, simply CPU and syscall emulation.

QEMU aims to fit into a variety of use cases. It can be invoked directly
by users wishing to have full control over its behaviour and settings.
It also aims to facilitate integration into higher level management
layers, by providing a stable command line interface and monitor API.
It is commonly invoked indirectly via the libvirt library when using
open source applications such as oVirt, OpenStack and virt-manager.

QEMU as a whole is released under the GNU General Public License,
version 2. For full licensing details, consult the LICENSE file.


Documentation
=============

Documentation can be found hosted online at
`<https://www.qemu.org/documentation/>`_. The documentation for the
current development version that is available at
`<https://www.qemu.org/docs/master/>`_ is generated from the ``docs/``
folder in the source tree, and is built by `Sphinx
<https://www.sphinx-doc.org/en/master/>`_.


Building
========

QEMU is multi-platform software intended to be buildable on all modern
Linux platforms, OS-X, Win32 (via the Mingw64 toolchain) and a variety
of other UNIX targets. The simple steps to build QEMU are:


.. code-block:: shell

  mkdir build
  cd build
  ../configure
  make

Additional information can also be found online via the QEMU website:

* `<https://wiki.qemu.org/Hosts/Linux>`_
* `<https://wiki.qemu.org/Hosts/Mac>`_
* `<https://wiki.qemu.org/Hosts/W32>`_


Submitting patches
==================

The QEMU source code is maintained under the GIT version control system.

.. code-block:: shell

   git clone https://gitlab.com/qemu-project/qemu.git

When submitting patches, one common approach is to use 'git
format-patch' and/or 'git send-email' to format & send the mail to the
qemu-devel@nongnu.org mailing list. All patches submitted must contain
a 'Signed-off-by' line from the author. Patches should follow the
guidelines set out in the `style section
<https://www.qemu.org/docs/master/devel/style.html>`_ of
the Developers Guide.

Additional information on submitting patches can be found online via
the QEMU website:

* `<https://wiki.qemu.org/Contribute/SubmitAPatch>`_
* `<https://wiki.qemu.org/Contribute/TrivialPatches>`_

The QEMU website is also maintained under source control.

.. code-block:: shell

  git clone https://gitlab.com/qemu-project/qemu-web.git

* `<https://www.qemu.org/2017/02/04/the-new-qemu-website-is-up/>`_

A 'git-publish' utility was created to make above process less
cumbersome, and is highly recommended for making regular contributions,
or even just for sending consecutive patch series revisions. It also
requires a working 'git send-email' setup, and by default doesn't
automate everything, so you may want to go through the above steps
manually for once.

For installation instructions, please go to:

*  `<https://github.com/stefanha/git-publish>`_

The workflow with 'git-publish' is:

.. code-block:: shell

  $ git checkout master -b my-feature
  $ # work on new commits, add your 'Signed-off-by' lines to each
  $ git publish

Your patch series will be sent and tagged as my-feature-v1 if you need to refer
back to it in the future.

Sending v2:

.. code-block:: shell

  $ git checkout my-feature # same topic branch
  $ # making changes to the commits (using 'git rebase', for example)
  $ git publish

Your patch series will be sent with 'v2' tag in the subject and the git tip
will be tagged as my-feature-v2.

Bug reporting
=============

The QEMU project uses GitLab issues to track bugs. Bugs
found when running code built from QEMU git or upstream released sources
should be reported via:

* `<https://gitlab.com/qemu-project/qemu/-/issues>`_

If using QEMU via an operating system vendor pre-built binary package, it
is preferable to report bugs to the vendor's own bug tracker first. If
the bug is also known to affect latest upstream code, it can also be
reported via GitLab.

For additional information on bug reporting consult:

* `<https://wiki.qemu.org/Contribute/ReportABug>`_


ChangeLog
=========

For version history and release notes, please visit
`<https://wiki.qemu.org/ChangeLog/>`_ or look at the git history for
more detailed information.


Contact
=======

The QEMU community can be contacted in a number of ways, with the two
main methods being email and IRC:

* `<mailto:qemu-devel@nongnu.org>`_
* `<https://lists.nongnu.org/mailman/listinfo/qemu-devel>`_
* #qemu on irc.oftc.net

Information on additional methods of contacting the community can be
found online via the QEMU website:

* `<https://wiki.qemu.org/Contribute/StartHere>`_