[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] 07b2c8: s390x/pci: avoid double enable/disabl
From: |
Peter Maydell |
Subject: |
[Qemu-commits] [qemu/qemu] 07b2c8: s390x/pci: avoid double enable/disable of aif |
Date: |
Sat, 20 Jan 2024 04:51:23 -0800 |
Branch: refs/heads/staging
Home: https://github.com/qemu/qemu
Commit: 07b2c8e034d80ff92e202405c494d2ff80fcf848
https://github.com/qemu/qemu/commit/07b2c8e034d80ff92e202405c494d2ff80fcf848
Author: Matthew Rosato <mjrosato@linux.ibm.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M hw/s390x/s390-pci-kvm.c
M include/hw/s390x/s390-pci-bus.h
Log Message:
-----------
s390x/pci: avoid double enable/disable of aif
Use a flag to keep track of whether AIF is currently enabled. This can be
used to avoid enabling/disabling AIF multiple times as well as to determine
whether or not it should be disabled during reset processing.
Fixes: d0bc7091c2 ("s390x/pci: enable adapter event notification for
interpreted devices")
Reported-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-ID: <20240118185151.265329-2-mjrosato@linux.ibm.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 30e35258e25c75c9d799c34fd89afcafffb37084
https://github.com/qemu/qemu/commit/30e35258e25c75c9d799c34fd89afcafffb37084
Author: Matthew Rosato <mjrosato@linux.ibm.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M hw/s390x/s390-pci-kvm.c
Log Message:
-----------
s390x/pci: refresh fh before disabling aif
Typically we refresh the host fh during CLP enable, however it's possible
that the device goes through multiple reset events before the guest
performs another CLP enable. Let's handle this for now by refreshing the
host handle from vfio before disabling aif.
Fixes: 03451953c7 ("s390x/pci: reset ISM passthrough devices on shutdown and
system reset")
Reported-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-ID: <20240118185151.265329-3-mjrosato@linux.ibm.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 68c691ca99a2538d6a53a70ce8a9ce06ee307ff1
https://github.com/qemu/qemu/commit/68c691ca99a2538d6a53a70ce8a9ce06ee307ff1
Author: Matthew Rosato <mjrosato@linux.ibm.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M hw/s390x/s390-pci-bus.c
M hw/s390x/s390-virtio-ccw.c
M include/hw/s390x/s390-pci-bus.h
Log Message:
-----------
s390x/pci: drive ISM reset from subsystem reset
ISM devices are sensitive to manipulation of the IOMMU, so the ISM device
needs to be reset before the vfio-pci device is reset (triggering a full
UNMAP). In order to ensure this occurs, trigger ISM device resets from
subsystem_reset before triggering the PCI bus reset (which will also
trigger vfio-pci reset). This only needs to be done for ISM devices
which were enabled for use by the guest.
Further, ensure that AIF is disabled as part of the reset event.
Fixes: ef1535901a ("s390x: do a subsystem reset before the unprotect on reboot")
Fixes: 03451953c7 ("s390x/pci: reset ISM passthrough devices on shutdown and
system reset")
Reported-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-ID: <20240118185151.265329-4-mjrosato@linux.ibm.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 48c1c25a55cdf02d21b1781531e21299736b193a
https://github.com/qemu/qemu/commit/48c1c25a55cdf02d21b1781531e21299736b193a
Author: Thomas Huth <thuth@redhat.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M docs/about/deprecated.rst
M docs/about/removed-features.rst
M qemu-options.hx
M system/vl.c
Log Message:
-----------
qemu-options: Remove the deprecated -no-hpet option
It's been marked as deprecated since QEMU 8.0, so it should be fine
to remove this now.
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240118103759.130748-2-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 4a6410104491b703116cd12ef18a61d13cb5a23f
https://github.com/qemu/qemu/commit/4a6410104491b703116cd12ef18a61d13cb5a23f
Author: Thomas Huth <thuth@redhat.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M docs/about/deprecated.rst
M docs/about/removed-features.rst
M docs/specs/tpm.rst
M hw/i386/pc.c
M qemu-options.hx
M system/vl.c
Log Message:
-----------
qemu-options: Remove the deprecated -no-acpi option
It's been marked as deprecated since QEMU 8.0, so it should be fine
to remove this now.
Message-ID: <20240118103759.130748-3-thuth@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 2582489fecd6042d69e1fa060ab5ff89f4cef550
https://github.com/qemu/qemu/commit/2582489fecd6042d69e1fa060ab5ff89f4cef550
Author: Thomas Huth <thuth@redhat.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M docs/about/deprecated.rst
M docs/about/removed-features.rst
M qemu-options.hx
M system/vl.c
Log Message:
-----------
qemu-options: Remove the deprecated -async-teardown option
It's been marked as deprecated since QEMU 8.1 (and was only available
since QEMU 8.0 anyway), so it should be fine to remove this now.
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240118103759.130748-4-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 1e7886e9e2068a4d83c1a05011cf21e638090ec5
https://github.com/qemu/qemu/commit/1e7886e9e2068a4d83c1a05011cf21e638090ec5
Author: Thomas Huth <thuth@redhat.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M docs/about/deprecated.rst
M docs/about/removed-features.rst
M qemu-options.hx
M system/vl.c
Log Message:
-----------
qemu-options: Remove the deprecated -chroot option
It's been marked as deprecated since QEMU 8.1, so it should be fine
to remove this now.
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240118103759.130748-5-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: fe17522d854aa7da4c01ca80ef194af4c2aaead3
https://github.com/qemu/qemu/commit/fe17522d854aa7da4c01ca80ef194af4c2aaead3
Author: Philippe Mathieu-Daudé <philmd@linaro.org>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M docs/about/deprecated.rst
M qapi/run-state.json
M system/runstate.c
M tests/qemu-iotests/183.out
M tests/qemu-iotests/234.out
M tests/qemu-iotests/262.out
M tests/qemu-iotests/280.out
Log Message:
-----------
qapi: Remove deprecated 'singlestep' member of StatusInfo
This member has been deprecated before the 8.1 release, in commit
34c18203d4 ("qmp: Deprecate 'singlestep' member of StatusInfo").
Time to drop it.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240117151430.29235-2-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 97b6e1d35f35463307bf9086b7a3fd8bf3212a19
https://github.com/qemu/qemu/commit/97b6e1d35f35463307bf9086b7a3fd8bf3212a19
Author: Philippe Mathieu-Daudé <philmd@linaro.org>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M docs/about/deprecated.rst
M docs/about/removed-features.rst
M hmp-commands.hx
M tests/qtest/test-hmp.c
Log Message:
-----------
hmp: Remove deprecated 'singlestep' command
This command has been deprecated before the 8.1 release,
in commit e9ccfdd91d ("hmp: Add 'one-insn-per-tb' command
equivalent to 'singlestep'"). Time to drop it.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: "Dr. David Alan Gilbert" <dave@treblig.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240117151430.29235-3-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: c61a0d31f8db4cb6c54e473e9a44dca616969414
https://github.com/qemu/qemu/commit/c61a0d31f8db4cb6c54e473e9a44dca616969414
Author: Philippe Mathieu-Daudé <philmd@linaro.org>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M bsd-user/main.c
M docs/about/deprecated.rst
M docs/about/removed-features.rst
M docs/user/main.rst
M linux-user/main.c
M qemu-options.hx
M system/vl.c
Log Message:
-----------
cli: Remove deprecated '-singlestep' command line option
This option has been deprecated before the 8.1 release,
in commit 12fd0f41d0 ("Document that -singlestep command
line option is deprecated"). Time to drop it.
Inspired-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240117151430.29235-4-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: 4a27d97c80b90215b33a092a1c3a5efcc987b582
https://github.com/qemu/qemu/commit/4a27d97c80b90215b33a092a1c3a5efcc987b582
Author: Philippe Mathieu-Daudé <philmd@linaro.org>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M tests/vm/netbsd
Log Message:
-----------
tests/vm/netbsd: Remove missing py311-expat package
Since the pkgsrc-2023Q3 release [*], the py-expat package has been
merged into the base 'python' package:
- Several packages have been folded into base packages. While the
result is simpler, those updating may need to force-remove the
secondary packages, depending on the update method. When doing
make replace, one has to pkg_delete -f the secondary packages.
pkgin handles at least the python packages correctly, removing the
split package when updating python. Specific packages and the
former packages now included:
* cairo: cairo-gobject
* python: py-cElementTree py-curses py-cursespanel py-expat
py-readline py-sqlite3
Remove py311-expat from the package list in order to avoid:
### Installing packages ...
processing remote summary
(http://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/9.3/All)...
database for http://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/9.3/All
is up-to-date
py311-expat is not available in the repository
...
calculating dependencies.../py311-expat is not available in the repository
pkg_install error log can be found in /var/db/pkgin/pkg_install-err.log
[*] https://mail-index.netbsd.org/netbsd-announce/2024/01/01/msg000360.html
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2109
Tested-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240117140746.23511-1-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Commit: b080f425c8ed44a69875eb69f37f6456405d3296
https://github.com/qemu/qemu/commit/b080f425c8ed44a69875eb69f37f6456405d3296
Author: Ari Sundholm <ari@tuxera.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M block/blklogwrites.c
Log Message:
-----------
block/blklogwrites: Fix a bug when logging "write zeroes" operations.
There is a bug in the blklogwrites driver pertaining to logging "write
zeroes" operations, causing log corruption. This can be easily observed
by setting detect-zeroes to something other than "off" for the driver.
The issue is caused by a concurrency bug pertaining to the fact that
"write zeroes" operations have to be logged in two parts: first the log
entry metadata, then the zeroed-out region. While the log entry
metadata is being written by bdrv_co_pwritev(), another operation may
begin in the meanwhile and modify the state of the blklogwrites driver.
This is as intended by the coroutine-driven I/O model in QEMU, of
course.
Unfortunately, this specific scenario is mishandled. A short example:
1. Initially, in the current operation (#1), the current log sector
number in the driver state is only incremented by the number of sectors
taken by the log entry metadata, after which the log entry metadata is
written. The current operation yields.
2. Another operation (#2) may start while the log entry metadata is
being written. It uses the current log position as the start offset for
its log entry. This is in the sector right after the operation #1 log
entry metadata, which is bad!
3. After bdrv_co_pwritev() returns (#1), the current log sector
number is reread from the driver state in order to find out the start
offset for bdrv_co_pwrite_zeroes(). This is an obvious blunder, as the
offset will be the sector right after the (misplaced) operation #2 log
entry, which means that the zeroed-out region begins at the wrong
offset.
4. As a result of the above, the log is corrupt.
Fix this by only reading the driver metadata once, computing the
offsets and sizes in one go (including the optional zeroed-out region)
and setting the log sector number to the appropriate value for the next
operation in line.
Signed-off-by: Ari Sundholm <ari@tuxera.com>
Cc: qemu-stable@nongnu.org
Message-ID: <20240109184646.1128475-1-megari@gmx.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 14f2a372ee1c3779de61fb2d08cb231c478de882
https://github.com/qemu/qemu/commit/14f2a372ee1c3779de61fb2d08cb231c478de882
Author: Kevin Wolf <kwolf@redhat.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M qapi/string-output-visitor.c
Log Message:
-----------
string-output-visitor: Fix (pseudo) struct handling
Commit ff32bb53 tried to get minimal struct support into the string
output visitor by just making it return "<omitted>". Unfortunately, it
forgot that the caller will still make more visitor calls for the
content of the struct.
If the struct is contained in a list, such as IOThreadVirtQueueMapping,
in the better case its fields show up as separate list entries. In the
worse case, it contains another list, and the string output visitor
doesn't support nested lists and asserts that this doesn't happen. So as
soon as the optional "vqs" field in IOThreadVirtQueueMapping is
specified, we get a crash.
This can be reproduced with the following command line:
echo "info qtree" | ./qemu-system-x86_64 \
-object iothread,id=t0 \
-blockdev null-co,node-name=disk \
-device '{"driver": "virtio-blk-pci", "drive": "disk",
"iothread-vq-mapping": [{"iothread": "t0", "vqs": [0]}]}' \
-monitor stdio
Fix the problem by counting the nesting level of structs and ignoring
any visitor calls for values (apart from start/end_struct) while we're
not on the top level.
Lists nested directly within lists remain unimplemented, as we don't
currently have a use case for them.
Fixes: ff32bb53476539d352653f4ed56372dced73a388
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2069
Reported-by: Aihua Liang <aliang@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20240109181717.42493-1-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 5ce5461bc4da6f14f0b75828abbb254a8e23d3dc
https://github.com/qemu/qemu/commit/5ce5461bc4da6f14f0b75828abbb254a8e23d3dc
Author: Peter Krempa <pkrempa@redhat.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M block.c
M block/commit.c
M blockdev.c
M include/block/block-global-state.h
M include/block/block_int-common.h
M include/block/block_int-global-state.h
M qapi/block-core.json
M tests/unit/test-bdrv-drain.c
Log Message:
-----------
commit: Allow users to request only format driver names in backing file format
Introduce a new flag 'backing-mask-protocol' for the block-commit QMP
command which instructs the internals to use 'raw' instead of the
protocol driver in case when a image is used without a dummy 'raw'
wrapper.
The flag is designed such that it can be always asserted by management
tools even when there isn't any update to backing files.
The flag will be used by libvirt so that the backing images still
reference the proper format even when libvirt will stop using the dummy
raw driver (raw driver with no other config). Libvirt needs this so that
the images stay compatible with older libvirt versions which didn't
expect that a protocol driver name can appear in the backing file format
field.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-ID:
<2cb46e37093ce793ea1604abc8bbb90f4c8e434b.1701796348.git.pkrempa@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: bc8c0b95dc9615df9c5ebd9e39186b2e825e6ab7
https://github.com/qemu/qemu/commit/bc8c0b95dc9615df9c5ebd9e39186b2e825e6ab7
Author: Peter Krempa <pkrempa@redhat.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M block/monitor/block-hmp-cmds.c
M block/stream.c
M blockdev.c
M include/block/block_int-global-state.h
M qapi/block-core.json
Log Message:
-----------
stream: Allow users to request only format driver names in backing file format
Introduce a new flag 'backing-mask-protocol' for the block-stream QMP
command which instructs the internals to use 'raw' instead of the
protocol driver in case when a image is used without a dummy 'raw'
wrapper.
The flag is designed such that it can be always asserted by management
tools even when there isn't any update to backing files.
The flag will be used by libvirt so that the backing images still
reference the proper format even when libvirt will stop using the dummy
raw driver (raw driver with no other config). Libvirt needs this so that
the images stay compatible with older libvirt versions which didn't
expect that a protocol driver name can appear in the backing file format
field.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-ID:
<bbee9a0a59748a8893289bf8249f568f0d587e62.1701796348.git.pkrempa@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 5dea5d6b0e16c4e02f1e8b23f5880c8c05714b84
https://github.com/qemu/qemu/commit/5dea5d6b0e16c4e02f1e8b23f5880c8c05714b84
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M tests/qemu-iotests/iotests.py
Log Message:
-----------
iotests: add filter_qmp_generated_node_ids()
Add a filter function for QMP responses that contain QEMU's
automatically generated node ids. The ids change between runs and must
be masked in the reference output.
The next commit will use this new function.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240118144823.1497953-2-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 8b57e45dac5b4fce9a1efb80197815469406c3fa
https://github.com/qemu/qemu/commit/8b57e45dac5b4fce9a1efb80197815469406c3fa
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M tests/qemu-iotests/141
M tests/qemu-iotests/141.out
Log Message:
-----------
iotests: port 141 to Python for reliable QMP testing
The common.qemu bash functions allow tests to interact with the QMP
monitor of a QEMU process. I spent two days trying to update 141 when
the order of the test output changed, but found it would still fail
occassionally because printf() and QMP events race with synchronous QMP
communication.
I gave up and ported 141 to the existing Python API for QMP tests. The
Python API is less affected by the order in which QEMU prints output
because it does not print all QMP traffic by default.
The next commit changes the order in which QMP messages are received.
Make 141 reliable first.
Cc: Hanna Czenczek <hreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240118144823.1497953-3-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 6ab9622eaac6c3bcd31b8d64fb5712835d58a846
https://github.com/qemu/qemu/commit/6ab9622eaac6c3bcd31b8d64fb5712835d58a846
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M monitor/qmp.c
M qapi/qmp-dispatch.c
M tests/qemu-iotests/060.out
M tests/qemu-iotests/071.out
M tests/qemu-iotests/081.out
M tests/qemu-iotests/087.out
M tests/qemu-iotests/108.out
M tests/qemu-iotests/109
M tests/qemu-iotests/109.out
M tests/qemu-iotests/117.out
M tests/qemu-iotests/120.out
M tests/qemu-iotests/127.out
M tests/qemu-iotests/140.out
M tests/qemu-iotests/143.out
M tests/qemu-iotests/156.out
M tests/qemu-iotests/176.out
M tests/qemu-iotests/182.out
M tests/qemu-iotests/183.out
M tests/qemu-iotests/184.out
M tests/qemu-iotests/185
M tests/qemu-iotests/185.out
M tests/qemu-iotests/191.out
M tests/qemu-iotests/195.out
M tests/qemu-iotests/223.out
M tests/qemu-iotests/227.out
M tests/qemu-iotests/247.out
M tests/qemu-iotests/273.out
M tests/qemu-iotests/308
M tests/qemu-iotests/308.out
M tests/qemu-iotests/tests/file-io-error
M tests/qemu-iotests/tests/iothreads-resize.out
M tests/qemu-iotests/tests/qsd-jobs.out
Log Message:
-----------
monitor: only run coroutine commands in qemu_aio_context
monitor_qmp_dispatcher_co() runs in the iohandler AioContext that is not
polled during nested event loops. The coroutine currently reschedules
itself in the main loop's qemu_aio_context AioContext, which is polled
during nested event loops. One known problem is that QMP device-add
calls drain_call_rcu(), which temporarily drops the BQL, leading to all
sorts of havoc like other vCPU threads re-entering device emulation code
while another vCPU thread is waiting in device emulation code with
aio_poll().
Paolo Bonzini suggested running non-coroutine QMP handlers in the
iohandler AioContext. This avoids trouble with nested event loops. His
original idea was to move coroutine rescheduling to
monitor_qmp_dispatch(), but I resorted to moving it to qmp_dispatch()
because we don't know if the QMP handler needs to run in coroutine
context in monitor_qmp_dispatch(). monitor_qmp_dispatch() would have
been nicer since it's associated with the monitor implementation and not
as general as qmp_dispatch(), which is also used by qemu-ga.
A number of qemu-iotests need updated .out files because the order of
QMP events vs QMP responses has changed.
Solves Issue #1933.
Cc: qemu-stable@nongnu.org
Fixes: 7bed89958bfbf40df9ca681cefbdca63abdde39d ("device_core: use
drain_call_rcu in in qmp_device_add")
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2215192
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2214985
Buglink: https://issues.redhat.com/browse/RHEL-17369
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240118144823.1497953-4-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Tested-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 806244af64c88faf10e15df34ccbc427529ca96a
https://github.com/qemu/qemu/commit/806244af64c88faf10e15df34ccbc427529ca96a
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M hw/block/dataplane/meson.build
R hw/block/dataplane/trace-events
R hw/block/dataplane/trace.h
R hw/block/dataplane/virtio-blk.c
R hw/block/dataplane/virtio-blk.h
M hw/block/virtio-blk.c
M include/hw/virtio/virtio-blk.h
M meson.build
Log Message:
-----------
virtio-blk: move dataplane code into virtio-blk.c
The dataplane code used to be significantly different from the
non-dataplane code and therefore had a separate source file.
Over time the difference has gotten smaller because the I/O code paths
were unified. Nowadays the distinction between the VirtIOBlock and
VirtIOBlockDataPlane structs is more of an inconvenience that hinders
code simplification.
Move hw/block/dataplane/virtio-blk.c into hw/block/virtio-blk.c, merging
VirtIOBlockDataPlane's fields into VirtIOBlock.
hw/block/virtio-blk.c used VirtIOBlock->dataplane to check if
virtio_blk_data_plane_create() was successful. This is not necessary
because ->dataplane_started and ->dataplane_disabled can be used
instead. This patch makes those changes in order to drop
VirtIOBlock->dataplane.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240119135748.270944-2-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 33e7ad9df01c3d1567e6a3f3cdac5aa3680474eb
https://github.com/qemu/qemu/commit/33e7ad9df01c3d1567e6a3f3cdac5aa3680474eb
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M hw/block/virtio-blk.c
Log Message:
-----------
virtio-blk: rename dataplane create/destroy functions
virtio_blk_data_plane_create() and virtio_blk_data_plane_destroy() are
actually about s->vq_aio_context[] rather than managing
dataplane-specific state.
As a prerequisite to using s->vq_aio_context[] in all code paths (even
when dataplane is not used), rename these functions to reflect that they
just manage s->vq_aio_context and call them regardless of whether or not
dataplane is in use.
Note that virtio-blk supports running with -device
virtio-blk-pci,ioevent=off where the vCPU thread enters the device
emulation code. In this mode ioeventfd is not used for virtqueue
processing. However, we still want to initialize s->vq_aio_context[] to
qemu_aio_context in that case since I/O completion callbacks will be
invoked in the main loop thread.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240119135748.270944-3-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: d6317918c85cfd2ac20bee7a0a32c7d8a362b52f
https://github.com/qemu/qemu/commit/d6317918c85cfd2ac20bee7a0a32c7d8a362b52f
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M hw/block/virtio-blk.c
M include/hw/virtio/virtio-blk.h
Log Message:
-----------
virtio-blk: rename dataplane to ioeventfd
The dataplane code is really about using ioeventfd. It's used both for
IOThreads (what we think of as dataplane) and for the core virtio-pci
code's ioeventfd feature (which is enabled by default and used when no
IOThread has been specified). Rename the code to reflect this.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240119135748.270944-4-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 399ca379c2be256a576c731a52a40b78703c2088
https://github.com/qemu/qemu/commit/399ca379c2be256a576c731a52a40b78703c2088
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M hw/block/virtio-blk.c
Log Message:
-----------
virtio-blk: restart s->rq reqs in vq AioContexts
A virtio-blk device with the iothread-vq-mapping parameter has
per-virtqueue AioContexts. It is not thread-safe to process s->rq
requests in the BlockBackend AioContext since that may be different from
the virtqueue's AioContext to which this request belongs. The code
currently races and could crash.
Adapt virtio_blk_dma_restart_cb() to first split s->rq into per-vq lists
and then schedule a BH each vq's AioContext as necessary. This way
requests are safely processed in their vq's AioContext.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240119135748.270944-5-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: a4c0be27f4c48907c98c52bb9f31f8f8fe52598b
https://github.com/qemu/qemu/commit/a4c0be27f4c48907c98c52bb9f31f8f8fe52598b
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M hw/block/virtio-blk.c
Log Message:
-----------
virtio-blk: tolerate failure to set BlockBackend AioContext
We no longer rely on setting the AioContext since the block layer
IO_CODE APIs can be called from any thread. Now it's just a hint to help
block jobs and other operations co-locate themselves in a thread with
the guest I/O requests. Keep going if setting the AioContext fails.
Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240119135748.270944-6-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 7f48a496cd6bbc5bbcfc7525794afaacc25ddb19
https://github.com/qemu/qemu/commit/7f48a496cd6bbc5bbcfc7525794afaacc25ddb19
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M hw/block/virtio-blk.c
Log Message:
-----------
virtio-blk: always set ioeventfd during startup
When starting ioeventfd it is common practice to set the event notifier
so that the ioeventfd handler is triggered to run immediately. There may
be no requests waiting to be processed, but the idea is that if a
request snuck in then we guarantee that it will be detected.
One scenario where self-triggering the ioeventfd is necessary is when
virtio_blk_handle_output() is called from a vCPU thread before the
VIRTIO Device Status transitions to DRIVER_OK. In that case we need to
self-trigger the ioeventfd so that the kick handled by the vCPU thread
causes the vq AioContext thread to take over handling the request(s).
Fixes: b6948ab01df0 ("virtio-blk: add iothread-vq-mapping parameter")
Reported-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240119135748.270944-7-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: ced0d71c5270bed828ed2bd4b116ddfb12862bf9
https://github.com/qemu/qemu/commit/ced0d71c5270bed828ed2bd4b116ddfb12862bf9
Author: Ari Sundholm <ari@tuxera.com>
Date: 2024-01-19 (Fri, 19 Jan 2024)
Changed paths:
M block/blklogwrites.c
Log Message:
-----------
block/blklogwrites: Protect mutable driver state with a mutex.
During the review of a fix for a concurrency issue in blklogwrites,
it was found that the driver needs an additional fix when enabling
multiqueue, which is a new feature introduced in QEMU 9.0, as the
driver state may be read and written by multiple threads at the same
time, which was not the case when the driver was originally written.
Fix the multi-threaded scenario by introducing a mutex to protect the
mutable fields in the driver state, and always having the mutex locked
by the current thread when accessing them. Also use the mutex and a
CoQueue to ensure that the super block is not being written to by
multiple threads concurrently and updates are properly serialized.
Additionally, add the const qualifier to a few BDRVBlkLogWritesState
pointer targets in contexts where the driver state is not written to.
Signed-off-by: Ari Sundholm <ari@tuxera.com>
Message-ID: <20240119162913.2620245-1-ari@tuxera.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit: 313aa1030a91e1483e10bb1da425ac0554d07692
https://github.com/qemu/qemu/commit/313aa1030a91e1483e10bb1da425ac0554d07692
Author: Peter Maydell <peter.maydell@linaro.org>
Date: 2024-01-20 (Sat, 20 Jan 2024)
Changed paths:
M bsd-user/main.c
M docs/about/deprecated.rst
M docs/about/removed-features.rst
M docs/specs/tpm.rst
M docs/user/main.rst
M hmp-commands.hx
M hw/i386/pc.c
M hw/s390x/s390-pci-bus.c
M hw/s390x/s390-pci-kvm.c
M hw/s390x/s390-virtio-ccw.c
M include/hw/s390x/s390-pci-bus.h
M linux-user/main.c
M qapi/run-state.json
M qemu-options.hx
M system/runstate.c
M system/vl.c
M tests/qemu-iotests/183.out
M tests/qemu-iotests/234.out
M tests/qemu-iotests/262.out
M tests/qemu-iotests/280.out
M tests/qtest/test-hmp.c
M tests/vm/netbsd
Log Message:
-----------
Merge tag 'pull-request-2024-01-19' of https://gitlab.com/thuth/qemu into
staging
- Fix s390x ISM reset
- Remove deprecated CLI options -no-hpet, -no-acpi, -async-teardown,
-chroot and -singlestep
- Fix installation of the netbsd VM
# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmWqk40RHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbVb+w//XuWdXzDDof0CsOMhMzBaKLznJ+Qbo4Wr
# S5vNJsiJe3KfI3DJa/ZSO2+lwyFpMPjp3aRSm9rAaw2ErejtfGZMSHj5/BGYuHVM
# x0VlHWnTEe/7NpG2mRwlxntPyYOtFCQ+xCo4YS9fpLLYSQFNhGMyOyfCobVZc1/A
# TDFrS5v1Su1HgYNL6GuyXK8k56ytidBxhuYtfLkR01liUDU1rmTWFcLxrXUwI7Hr
# nfamp/W6G9OJ3co0ysYChM8SvXQzCGPBxzGQjrcHpaL7otTW5yliJcNPwyzGdyLU
# G+5AcdJ8wT+ONonf3KkUTbxS2J2OHzIGCZpqVWGU0h5Yv43zMpNATUmbUPM0H0l4
# mqtUf4bSyhNwClKdkEWJyvEwNRTIHxWerMgaNp9ntEM3Ac0/3HiOXV/DZOKL04Im
# hRHRySSMlyo6Pnnn2fHj3naalKHNVikbvPVR3i8wdYuQ423D35cU8M+yJpJ3Bllt
# 5YgScDkVjifan5SmWVdtQ9bgyrdeQHFa9V1iUjxQx5JfAv8w4RBmats8UYrYm/mF
# Zrx/zdpL5wneslWwPqLp/gOb5lt8tF4vt0sLgpNa6SxI9Pgz/GhPvuhmfheML17l
# znbGEx5q3vqivszZkm8penydut4rbpp6GcoftbI9sIgqfNuuY1d/FZRlb32RTdxH
# 1TUiQfGQqbA=
# =ytHA
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 19 Jan 2024 15:21:49 GMT
# gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg: issuer "thuth@redhat.com"
# 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>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5
* tag 'pull-request-2024-01-19' of https://gitlab.com/thuth/qemu:
tests/vm/netbsd: Remove missing py311-expat package
cli: Remove deprecated '-singlestep' command line option
hmp: Remove deprecated 'singlestep' command
qapi: Remove deprecated 'singlestep' member of StatusInfo
qemu-options: Remove the deprecated -chroot option
qemu-options: Remove the deprecated -async-teardown option
qemu-options: Remove the deprecated -no-acpi option
qemu-options: Remove the deprecated -no-hpet option
s390x/pci: drive ISM reset from subsystem reset
s390x/pci: refresh fh before disabling aif
s390x/pci: avoid double enable/disable of aif
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Commit: 84b1da2ee3c3ebbf26ce9ead5001cd9fecc978dd
https://github.com/qemu/qemu/commit/84b1da2ee3c3ebbf26ce9ead5001cd9fecc978dd
Author: Peter Maydell <peter.maydell@linaro.org>
Date: 2024-01-20 (Sat, 20 Jan 2024)
Changed paths:
M block.c
M block/blklogwrites.c
M block/commit.c
M block/monitor/block-hmp-cmds.c
M block/stream.c
M blockdev.c
M hw/block/dataplane/meson.build
R hw/block/dataplane/trace-events
R hw/block/dataplane/trace.h
R hw/block/dataplane/virtio-blk.c
R hw/block/dataplane/virtio-blk.h
M hw/block/virtio-blk.c
M include/block/block-global-state.h
M include/block/block_int-common.h
M include/block/block_int-global-state.h
M include/hw/virtio/virtio-blk.h
M meson.build
M monitor/qmp.c
M qapi/block-core.json
M qapi/qmp-dispatch.c
M qapi/string-output-visitor.c
M tests/qemu-iotests/060.out
M tests/qemu-iotests/071.out
M tests/qemu-iotests/081.out
M tests/qemu-iotests/087.out
M tests/qemu-iotests/108.out
M tests/qemu-iotests/109
M tests/qemu-iotests/109.out
M tests/qemu-iotests/117.out
M tests/qemu-iotests/120.out
M tests/qemu-iotests/127.out
M tests/qemu-iotests/140.out
M tests/qemu-iotests/141
M tests/qemu-iotests/141.out
M tests/qemu-iotests/143.out
M tests/qemu-iotests/156.out
M tests/qemu-iotests/176.out
M tests/qemu-iotests/182.out
M tests/qemu-iotests/183.out
M tests/qemu-iotests/184.out
M tests/qemu-iotests/185
M tests/qemu-iotests/185.out
M tests/qemu-iotests/191.out
M tests/qemu-iotests/195.out
M tests/qemu-iotests/223.out
M tests/qemu-iotests/227.out
M tests/qemu-iotests/247.out
M tests/qemu-iotests/273.out
M tests/qemu-iotests/308
M tests/qemu-iotests/308.out
M tests/qemu-iotests/iotests.py
M tests/qemu-iotests/tests/file-io-error
M tests/qemu-iotests/tests/iothreads-resize.out
M tests/qemu-iotests/tests/qsd-jobs.out
M tests/unit/test-bdrv-drain.c
Log Message:
-----------
Merge tag 'for-upstream' of https://repo.or.cz/qemu/kevin into staging
Block layer patches
- virtio-blk: Multiqueue fixes and cleanups
- blklogwrites: Fixes for write_zeroes and superblock update races
- commit/stream: Allow users to request only format driver names in
backing file format
- monitor: only run coroutine commands in qemu_aio_context
# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEE3D3rFZqa+V09dFb+fwmycsiPL9YFAmWqu4ARHGt3b2xmQHJl
# ZGhhdC5jb20ACgkQfwmycsiPL9YrkBAAhCblSyeS+M/BXljSgDB7tyXeHmfYJlIT
# PUBaikRkE4I6ccsosewriGyyBeteEOq8uWc2dYhRkLAED9KVG9Oxg5gQt3GS+Yhn
# UKN4F3+OSa1yJNm+iIb1i7tYoM19F70oQ/LtDgpcqV0wF9lof1nwdLuUcHVRE1g1
# 4WXDGNAy9cISG0pbZ94H3uG4OvQR68BIB3x/SH4iywsxZsMJXm6960c/meRvZcbX
# dDqCSC3Dn5mg/2ozSGL4uUT2t0Bv6l/fv3uGO9vsPEQ9d+TIjeORSW4ISuRA2jry
# rCZq2hN0rh6Lx2YROsnCfqBmhc+JW3BzqTcWmboqVuvBblT7CZJuRExYid+/UlWR
# d6jKfyme09Aiysgksyox87h3GmSClSA6WF2ZXmAilb1xhOV9mZk2naWHuNJfz9pD
# KTSpNeKYXx+UJfDTbhgtPctpYDjhDa8gB/xzXp+m3I7ia2mwYo8cCiXjeN9WwhGR
# WZV/mFcNApmLJQgP53xDG63KxyS7Q+nTZa6L+wd/ISAsgNrJQbi0+/Dpjw89GbkV
# pYzcaM94MauuIjikyDYjgT8wSLu+GuVN9CaEnGXmAPOsEt5agxmcTgadttftvVKh
# ZuqsV6kTGei6ZwN5UAbK9Y+sXpBVq5DGGCpKukh1654Uu0x3vIPJOi5ru848khM9
# l1ZfxFSu614=
# =wym5
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 19 Jan 2024 18:12:16 GMT
# gpg: using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg: issuer "kwolf@redhat.com"
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6
* tag 'for-upstream' of https://repo.or.cz/qemu/kevin:
block/blklogwrites: Protect mutable driver state with a mutex.
virtio-blk: always set ioeventfd during startup
virtio-blk: tolerate failure to set BlockBackend AioContext
virtio-blk: restart s->rq reqs in vq AioContexts
virtio-blk: rename dataplane to ioeventfd
virtio-blk: rename dataplane create/destroy functions
virtio-blk: move dataplane code into virtio-blk.c
monitor: only run coroutine commands in qemu_aio_context
iotests: port 141 to Python for reliable QMP testing
iotests: add filter_qmp_generated_node_ids()
stream: Allow users to request only format driver names in backing file format
commit: Allow users to request only format driver names in backing file format
string-output-visitor: Fix (pseudo) struct handling
block/blklogwrites: Fix a bug when logging "write zeroes" operations.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Compare: https://github.com/qemu/qemu/compare/3f2a357b9584...84b1da2ee3c3
- [Qemu-commits] [qemu/qemu] 07b2c8: s390x/pci: avoid double enable/disable of aif,
Peter Maydell <=