[PATCH 1/6] virtio-blk: move dataplane code into virtio-blk.c

2024-01-19 Thread Stefan Hajnoczi
ful. 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 --- meson.build | 1 - hw/block/dataplane/trace.h | 1 - hw/blo

Re: [PATCH v4 4/4] virtio-blk: add iothread-vq-mapping parameter

2024-01-19 Thread Stefan Hajnoczi
On Thu, Dec 21, 2023 at 02:40:19PM +0100, Kevin Wolf wrote: > Am 20.12.2023 um 14:47 hat Stefan Hajnoczi geschrieben: > > Add the iothread-vq-mapping parameter to assign virtqueues to IOThreads. > > Store the vq:AioContext mapping in the new struct > > VirtIOBlockDataPlane-&g

[PATCH 3/6] virtio-blk: rename dataplane to ioeventfd

2024-01-19 Thread Stefan Hajnoczi
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

[PATCH 2/6] virtio-blk: rename dataplane create/destroy functions

2024-01-19 Thread Stefan Hajnoczi
. 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 --- hw/block/virtio-blk.c | 23 --- 1 file changed, 12 insertions(+), 11 deleti

[PATCH 4/6] virtio-blk: restart s->rq reqs in vq AioContexts

2024-01-19 Thread Stefan Hajnoczi
uld 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 --- hw/block/virtio-blk.

[PATCH 0/6] virtio-blk: iothread-vq-mapping cleanups

2024-01-19 Thread Stefan Hajnoczi
rge the hw/block/dataplane/virtio-blk.c code into hw/block/virtio-blk.c so that s->rq can easily be restarted in the correct AioContexts. Stefan Hajnoczi (6): virtio-blk: move dataplane code into virtio-blk.c virtio-blk: rename dataplane create/destroy functions virtio-blk: rename dat

Re: [PATCH v4 4/4] virtio-blk: add iothread-vq-mapping parameter

2024-01-18 Thread Stefan Hajnoczi
On Thu, Dec 21, 2023 at 02:10:20PM +0100, Kevin Wolf wrote: > Am 20.12.2023 um 14:47 hat Stefan Hajnoczi geschrieben: > > Add the iothread-vq-mapping parameter to assign virtqueues to IOThreads. > > Store the vq:AioContext mapping in the new struct > > VirtIOBlockDataPlane-&g

Re: [PATCH 2/3] iotests: port 141 to Python for reliable QMP testing

2024-01-18 Thread Stefan Hajnoczi
On Wed, Jan 17, 2024 at 07:04:06PM +0100, Kevin Wolf wrote: > Am 16.01.2024 um 20:00 hat Stefan Hajnoczi geschrieben: > > 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 ord

[PATCH v2 3/3] monitor: only run coroutine commands in qemu_aio_context

2024-01-18 Thread Stefan Hajnoczi
: 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 --

[PATCH v2 0/3] monitor: only run coroutine commands in qemu_aio_context

2024-01-18 Thread Stefan Hajnoczi
necessary to adjust the reference output in many test cases. The actual QMP code change is small and everything else is just to make qemu-iotests happy. If you have bugs related to the same issue, please retest them with these patches. Thanks! Stefan Hajnoczi (3): iotests: add

[PATCH v2 1/3] iotests: add filter_qmp_generated_node_ids()

2024-01-18 Thread Stefan Hajnoczi
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 --- tests/qemu-iotests/iotests.py | 7 +++ 1 file

[PATCH v2 2/3] iotests: port 141 to Python for reliable QMP testing

2024-01-18 Thread Stefan Hajnoczi
Czenczek Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/141 | 307 - tests/qemu-iotests/141.out | 190 +-- 2 files changed, 171 insertions(+), 326 deletions(-) diff --git a/tests/qemu-iotests/141 b/tests/qemu-iotests/141 index

Re: [PATCH v2] coroutine-ucontext: Save fake stack for pooled coroutine

2024-01-17 Thread Stefan Hajnoczi
On Wed, Jan 17, 2024 at 04:06:02PM +0900, Akihiko Odaki wrote: > Coroutine may be pooled even after COROUTINE_TERMINATE if > CONFIG_COROUTINE_POOL is enabled and fake stack should be saved in > such a case to keep AddressSanitizerUseAfterReturn working. Even worse, > I'm seeing stack corruption

Re: [PATCH] block/io: clear BDRV_BLOCK_RECURSE flag after recursing in bdrv_co_block_status

2024-01-17 Thread Stefan Hajnoczi
On Tue, Jan 16, 2024 at 04:48:39PM +0100, Fiona Ebner wrote: > Using fleecing backup like in [0] on a qcow2 image (with metadata > preallocation) can lead to the following assertion failure: > > > bdrv_co_do_block_status: Assertion `!(ret & BDRV_BLOCK_ZERO)' failed. > > In the reproducer [0], it

Re: [PATCH] block/io: clear BDRV_BLOCK_RECURSE flag after recursing in bdrv_co_block_status

2024-01-16 Thread Stefan Hajnoczi
On Tue, Jan 16, 2024 at 04:48:39PM +0100, Fiona Ebner wrote: > Using fleecing backup like in [0] on a qcow2 image (with metadata > preallocation) can lead to the following assertion failure: > > > bdrv_co_do_block_status: Assertion `!(ret & BDRV_BLOCK_ZERO)' failed. > > In the reproducer [0], it

[PATCH 0/3] monitor: only run coroutine commands in qemu_aio_context

2024-01-16 Thread Stefan Hajnoczi
and everything else is just to make qemu-iotests happy. If you have bugs related to the same issue, please retest them with these patches. Thanks! Stefan Hajnoczi (3): iotests: add filter_qmp_generated_node_ids() iotests: port 141 to Python for reliable QMP testing monitor: only run coroutine

[PATCH 2/3] iotests: port 141 to Python for reliable QMP testing

2024-01-16 Thread Stefan Hajnoczi
Czenczek Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/141 | 297 +++-- tests/qemu-iotests/141.out | 190 +--- 2 files changed, 161 insertions(+), 326 deletions(-) diff --git a/tests/qemu-iotests/141 b/tests/qemu-iotests/141 index

[PATCH 3/3] monitor: only run coroutine commands in qemu_aio_context

2024-01-16 Thread Stefan Hajnoczi
: 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 --

[PATCH 1/3] iotests: add filter_qmp_generated_node_ids()

2024-01-16 Thread Stefan Hajnoczi
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 --- tests/qemu-iotests/iotests.py | 7 +++ 1 file

Re: [PATCH] string-output-visitor: Fix (pseudo) struct handling

2024-01-16 Thread Stefan Hajnoczi
gt; Reported-by: Aihua Liang > Signed-off-by: Kevin Wolf > --- > qapi/string-output-visitor.c | 46 > 1 file changed, 46 insertions(+) Thanks for getting to this before I could: Reviewed-by: Stefan Hajnoczi > diff --git a/qapi/stri

Re: [PATCH] coroutine-ucontext: Save fake stack for pooled coroutine

2024-01-15 Thread Stefan Hajnoczi
On Fri, Jan 12, 2024 at 07:36:19PM +0900, Akihiko Odaki wrote: > Coroutine may be pooled even after COROUTINE_TERMINATE if > CONFIG_COROUTINE_POOL is enabled and fake stack should be saved in > such a case to keep AddressSanitizerUseAfterReturn working. Even worse, > I'm seeing stack corruption

Call for GSoC/Outreachy internship project ideas

2024-01-15 Thread Stefan Hajnoczi
Dear QEMU and KVM communities, QEMU will apply for the Google Summer of Code and Outreachy internship programs again this year. Regular contributors can submit project ideas that they'd like to mentor by replying to this email before January 30th. Internship programs ---

Static qemu-user-x86_64 "Unable to find a guest_base to satisfy all guest address mapping requirements"

2024-01-09 Thread Stefan Hajnoczi
Hi Richard, Christophe Fergeau found that Fedora's qemu-user-static-x86-8.1.3-1.fc39.aarch64 fails when running a statically linked hello world binary: qemu-x86_64-static: /root/podman_hello_world.alpine: Unable to find a guest_base to satisfy all guest address mapping requirements

[PULL 6/6] Rename "QEMU global mutex" to "BQL" in comments and docs

2024-01-08 Thread Stefan Hajnoczi
The term "QEMU global mutex" is identical to the more widely used Big QEMU Lock ("BQL"). Update the code comments and documentation to use "BQL" instead of "QEMU global mutex". Signed-off-by: Stefan Hajnoczi Acked-by: Markus Armbruster Reviewed-by: P

[PULL 1/6] iothread: Remove unused Error** argument in aio_context_set_aio_params

2024-01-08 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi Message-ID: <20231120171806.19361-1-phi...@linaro.org> --- include/block/aio.h | 3 +-- iothread.c | 3 +-- util/aio-posix.c| 3 +-- util/aio-win32.c| 3 +-- util/main-loop.c| 5 + 5 files changed, 5 insertions(+), 12 deletions(-) diff

[PULL 5/6] Replace "iothread lock" with "BQL" in comments

2024-01-08 Thread Stefan Hajnoczi
The term "iothread lock" is obsolete. The APIs use Big QEMU Lock (BQL) in their names. Update the code comments to use "BQL" instead of "iothread lock". Signed-off-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paul Durrant Reviewed-by: Akih

[PULL 2/6] system/cpus: rename qemu_mutex_lock_iothread() to bql_lock()

2024-01-08 Thread Stefan Hajnoczi
s and documentation that will be updated in later patches. Signed-off-by: Stefan Hajnoczi Reviewed-by: Paul Durrant Acked-by: Fabiano Rosas Acked-by: David Woodhouse Reviewed-by: Cédric Le Goater Acked-by: Peter Xu Acked-by: Eric Farman Reviewed-by: Harsh Prateek Bora Acked-by: Hyman Huang

[PULL 4/6] qemu/main-loop: rename qemu_cond_wait_iothread() to qemu_cond_wait_bql()

2024-01-08 Thread Stefan Hajnoczi
The name "iothread" is overloaded. Use the term Big QEMU Lock (BQL) instead, it is already widely used and unambiguous. Signed-off-by: Stefan Hajnoczi Reviewed-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paul Durrant Reviewed-by: Harsh Prateek Bora

[PULL 3/6] qemu/main-loop: rename QEMU_IOTHREAD_LOCK_GUARD to BQL_LOCK_GUARD

2024-01-08 Thread Stefan Hajnoczi
The name "iothread" is overloaded. Use the term Big QEMU Lock (BQL) instead, it is already widely used and unambiguous. Signed-off-by: Stefan Hajnoczi Reviewed-by: Paul Durrant Acked-by: David Woodhouse Reviewed-by: Cédric Le Goater Acked-by: Ilya Leoshkevich Reviewed-by: Harsh Pr

[PULL 0/6] Block patches

2024-01-08 Thread Stefan Hajnoczi
--- Pull request Philippe Mathieu-Daudé (1): iothread: Remove unused Error** argument in aio_context_set_aio_params Stefan Hajnoczi (5): system/cpus: rename qemu_mutex_lock_iothread() to bql_lock() qemu/main-loop: rename QEMU_IOTHREAD_LOCK_GUARD to BQL_LOCK_GUARD qe

Re: [PATCH v3 0/5] Make Big QEMU Lock naming consistent

2024-01-08 Thread Stefan Hajnoczi
On Tue, Jan 02, 2024 at 10:35:24AM -0500, Stefan Hajnoczi wrote: > v3: > - Rebase > - Define bql_lock() macro on a single line [Akihiko Odaki] > v2: > - Rename APIs bql_*() [PeterX] > - Spell out "Big QEMU Lock (BQL)" in doc comments [PeterX] > - Rename "i

Re: [PATCH v2 0/3] Virtio dmabuf improvements

2024-01-08 Thread Stefan Hajnoczi
On Mon, 8 Jan 2024 at 10:49, Albert Esteve wrote: > On Mon, Dec 11, 2023 at 10:48 PM Stefan Hajnoczi wrote: >> >> On Thu, 7 Dec 2023 at 09:55, Albert Esteve wrote: >> > >> > v1: https://www.mail-archive.com/qemu-devel@nongnu.org/msg1005257.html >> > v1

Re: [PULL 00/26] Migration 20240104 patches

2024-01-07 Thread Stefan Hajnoczi
On Sun, 7 Jan 2024 at 10:23, Peter Maydell wrote: > > On Sun, 7 Jan 2024 at 12:41, Stefan Hajnoczi wrote: > > > > On Sun, 7 Jan 2024 at 07:34, Peter Xu wrote: > > > > > > On Fri, Jan 05, 2024 at 04:08:40PM +, Peter Maydell wrote: > > > > I no

Re: [PULL 00/26] Migration 20240104 patches

2024-01-07 Thread Stefan Hajnoczi
[SC] Key fingerprint = B918 4DC2 0CC4 57DA CF7D D1A9 3B5F CCCD F3AB D706 uid [ full ] Peter Xu sig 30x3B5FCCCDF3ABD706 2023-10-03 [self-signature] sig 0x9CA4ABB381AB73C8 2023-10-10 Stefan Hajnoczi uid [ full ] Peter Xu sig 3

Re: [PATCH 0/6] net: fix non-deterministic failures of the 'netdev-socket' qtest

2024-01-04 Thread Stefan Hajnoczi
completion to report useful error message > qtest: ensure netdev-socket tests have non-overlapping names > > include/qemu/osdep.h| 10 - > meson.build | 1 - > net/stream.c| 18 +++- > tests/qtest/netdev-socket.c | 42 +++-- > 4 files changed, 21 insertions(+), 50 deletions(-) Reviewed-by: Stefan Hajnoczi

Re: QEMU developers call

2024-01-04 Thread Stefan Hajnoczi
On Tue, 2 Jan 2024 at 20:54, Peter Xu wrote: > If I'd make a list of good candidates, I'll probably be the last one out of > tens, especially considering my current timezone. :-D Does this mean you will handle the community call? Thanks, Stefan

Re: [PATCH] docs/devel: Document conventional file prefixes and suffixes

2024-01-02 Thread Stefan Hajnoczi
On Tue, Dec 26, 2023 at 04:04:41PM +0100, Philippe Mathieu-Daudé wrote: > Some header and source file names use common prefix / suffix > but we never really ruled a convention. Start doing so with > the current patterns from the tree. > > Suggested-by: Alex Bennée > Signed-off-by: Philippe

[PATCH v3 3/5] qemu/main-loop: rename qemu_cond_wait_iothread() to qemu_cond_wait_bql()

2024-01-02 Thread Stefan Hajnoczi
The name "iothread" is overloaded. Use the term Big QEMU Lock (BQL) instead, it is already widely used and unambiguous. Signed-off-by: Stefan Hajnoczi Reviewed-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé --- include/qemu/main-loop.h | 10 +- accel/tcg

[PATCH v3 4/5] Replace "iothread lock" with "BQL" in comments

2024-01-02 Thread Stefan Hajnoczi
The term "iothread lock" is obsolete. The APIs use Big QEMU Lock (BQL) in their names. Update the code comments to use "BQL" instead of "iothread lock". Signed-off-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé --- docs/devel/reset.rst

[PATCH v3 1/5] system/cpus: rename qemu_mutex_lock_iothread() to bql_lock()

2024-01-02 Thread Stefan Hajnoczi
s and documentation that will be updated in later patches. Signed-off-by: Stefan Hajnoczi Reviewed-by: Paul Durrant Acked-by: Fabiano Rosas Acked-by: David Woodhouse Reviewed-by: Cédric Le Goater Acked-by: Peter Xu Acked-by: Eric Farman Reviewed-by: Harsh Prateek Bora Acked-by: Hy

[PATCH v3 5/5] Rename "QEMU global mutex" to "BQL" in comments and docs

2024-01-02 Thread Stefan Hajnoczi
The term "QEMU global mutex" is identical to the more widely used Big QEMU Lock ("BQL"). Update the code comments and documentation to use "BQL" instead of "QEMU global mutex". Signed-off-by: Stefan Hajnoczi Acked-by: Markus Armbruster Reviewed-by: Phili

[PATCH v3 0/5] Make Big QEMU Lock naming consistent

2024-01-02 Thread Stefan Hajnoczi
" is easily confused with the unrelated --object iothread (iothread.c). This series updates the code and documentation to consistently use "BQL". This makes the code easier to understand. Stefan Hajnoczi (5): system/cpus: rename qemu_mutex_lock_iothread() to bql_lock()

[PATCH v3 2/5] qemu/main-loop: rename QEMU_IOTHREAD_LOCK_GUARD to BQL_LOCK_GUARD

2024-01-02 Thread Stefan Hajnoczi
The name "iothread" is overloaded. Use the term Big QEMU Lock (BQL) instead, it is already widely used and unambiguous. Signed-off-by: Stefan Hajnoczi Reviewed-by: Paul Durrant Acked-by: David Woodhouse Reviewed-by: Cédric Le Goater Acked-by: Ilya Leoshkevich --- include/qemu/m

Re: [PATCH v2 1/5] system/cpus: rename qemu_mutex_lock_iothread() to bql_lock()

2024-01-02 Thread Stefan Hajnoczi
On Wed, Dec 13, 2023 at 03:37:00PM +0900, Akihiko Odaki wrote: > On 2023/12/13 0:39, Stefan Hajnoczi wrote: > > @@ -312,58 +312,58 @@ bool qemu_in_main_thread(void); > > } while (0) > > /** > > - * qemu_mutex_lock_iothread: Lock the main loop mutex. > > + *

Re: [PATCH] mailmap: Fix Stefan Weil author email again

2024-01-02 Thread Stefan Hajnoczi
On Wed, Dec 27, 2023 at 10:21:26AM +0100, Philippe Mathieu-Daudé wrote: > On 27/12/23 10:12, Philippe Mathieu-Daudé wrote: > > On 27/12/23 10:09, Michael Tokarev wrote: > > > 27.12.2023 11:59, Philippe Mathieu-Daudé: > > > > Commit 5204b499a6 ("mailmap: Fix Stefan Weil author email") > > > >

Re: Qemu setting "-cpu host" seems broken with Windows vms

2023-12-29 Thread Stefan Hajnoczi
On Thu, 28 Dec 2023 at 17:21, wrote: CCing Paolo, the general x86 maintainer. Stefan > I noticed something weird when using "-cpu host" with Windows vms. > First, I always use it along with ",hv_passthrough" as well. > > First, performance: since some years ago, since prior to qemu 6.2 until >

Re: [PULL 1/1] tracing: install trace events file only if necessary

2023-12-27 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/9.0 for any user-visible changes. signature.asc Description: PGP signature

[PULL 1/1] tracing: install trace events file only if necessary

2023-12-27 Thread Stefan Hajnoczi
From: Carlos Santos It is not useful when configuring with --enable-trace-backends=nop. Signed-off-by: Carlos Santos Signed-off-by: Stefan Hajnoczi Message-ID: <20230408010410.281263-1-casan...@redhat.com> --- trace/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PULL 0/1] Tracing patches

2023-12-27 Thread Stefan Hajnoczi
The following changes since commit 455f4440687fcee03e62d9b17b28162b638458af: Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into staging (2023-12-26 06:07:16 -0500) are available in the Git repository at: https://gitlab.com/stefanha/qemu.git

Re: [PULL 0/1] Dirty page rate and dirty page limit 20231225 patch

2023-12-26 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/9.0 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL 0/7] Trivial patches for 2023-12-25

2023-12-26 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/9.0 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL 00/11] m68k next-cube patches

2023-12-26 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/9.0 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL 00/21] virtio,pc,pci: features, cleanups, fixes

2023-12-26 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/9.0 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL v2 00/33] Block layer patches

2023-12-22 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/9.0 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL 0/2] loongarch-to-apply queue

2023-12-22 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/9.0 for any user-visible changes. signature.asc Description: PGP signature

[PATCH v3 1/6] fixup block-coroutine-wrapper: use qemu_get_current_aio_context()

2023-12-21 Thread Stefan Hajnoczi
qemu-iotests 051 fails on my machine so the change to 051.pc.out made by the above commit appears to be incorrect, at least against the current QEMU source tree. Revert it so that 051 passes again. Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/051.pc.out | 4 ++-- 1 file changed, 2

[PATCH v3 4/6] nbd/server: avoid per-NBDRequest nbd_client_get/put()

2023-12-21 Thread Stefan Hajnoczi
thread-safety easier in the commits that follow. Signed-off-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini --- nbd/server.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index 895cf0a752..0b09ccc8dc 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -1557,7

[PATCH v3 6/6] nbd/server: introduce NBDClient->lock to protect fields

2023-12-21 Thread Stefan Hajnoczi
ere possible and otherwise add doc comments stating assumptions about which thread and lock holding. Note this patch moves the client->recv_coroutine assertion from nbd_co_receive_request() to nbd_trip() where client->lock is held. Signed-off-by: Stefan Hajnoczi --- nbd/serve

[PATCH v3 2/6] fixup block: remove AioContext locking

2023-12-21 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi --- migration/block.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/migration/block.c b/migration/block.c index 2bcfcbfdf6..6ec6a1d6e6 100644 --- a/migration/block.c +++ b/migration/block.c @@ -311,10 +311,17 @@ static int mig_save_device_bulk(QEMUFile

[PATCH v3 3/6] fixup scsi: only access SCSIDevice->requests from one thread

2023-12-21 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini --- hw/scsi/scsi-bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index df68a44b6a..5b08cbf60a 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -127,7 +127,8

[PATCH v3 5/6] nbd/server: only traverse NBDExport->clients from main loop thread

2023-12-21 Thread Stefan Hajnoczi
so add nbd_client_put_nonzero() to optimize the common case where more references to NBDClient remain. Note that nbd_client_get() can still be called from either thread, so make NBDClient->refcount atomic. Signed-off-by: Stefan Hajnoczi --- nbd/serv

[PATCH v3 0/6] qemu-iotests fixes for Kevin's block tree

2023-12-21 Thread Stefan Hajnoczi
nto the original patches. Stefan Hajnoczi (6): fixup block-coroutine-wrapper: use qemu_get_current_aio_context() fixup block: remove AioContext locking fixup scsi: only access SCSIDevice->requests from one thread nbd/server: avoid per-NBDRequest nbd_client_get/put() nbd/server: only

Re: [PATCH v2 6/6] nbd/server: introduce NBDClient->lock to protect fields

2023-12-21 Thread Stefan Hajnoczi
On Thu, Dec 21, 2023 at 06:38:16PM +0100, Kevin Wolf wrote: > Am 21.12.2023 um 16:35 hat Stefan Hajnoczi geschrieben: > > NBDClient has a number of fields that are accessed by both the export > > AioContext and the main loop thread. When the AioContext lock is removed > > t

Re: [PATCH v4 1/4] qdev-properties: alias all object class properties

2023-12-21 Thread Stefan Hajnoczi
On Thu, Dec 21, 2023 at 01:39:48PM +0100, Kevin Wolf wrote: > Am 20.12.2023 um 14:47 hat Stefan Hajnoczi geschrieben: > > qdev_alias_all_properties() aliases a DeviceState's qdev properties onto > > an Object. This is used for VirtioPCIProxy types so that --device > > virtio-b

[PATCH v2 5/6] nbd/server: only traverse NBDExport->clients from main loop thread

2023-12-21 Thread Stefan Hajnoczi
so add nbd_client_put_nonzero() to optimize the common case where more references to NBDClient remain. Note that nbd_client_get() can still be called from either thread, so make NBDClient->refcount atomic. Signed-off-by: Stefan Hajnoczi --- nbd/serv

[PATCH v2 3/6] fixup scsi: only access SCSIDevice->requests from one thread

2023-12-21 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini --- hw/scsi/scsi-bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index df68a44b6a..5b08cbf60a 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -127,7 +127,8

[PATCH v2 6/6] nbd/server: introduce NBDClient->lock to protect fields

2023-12-21 Thread Stefan Hajnoczi
ere possible and otherwise add doc comments stating assumptions about which thread and lock holding. Note this patch moves the client->recv_coroutine assertion from nbd_co_receive_request() to nbd_trip() where client->lock is held. Signed-off-by: Stefan Hajnoczi --- nbd/serve

[PATCH v2 4/6] nbd/server: avoid per-NBDRequest nbd_client_get/put()

2023-12-21 Thread Stefan Hajnoczi
thread-safety easier in the commits that follow. Signed-off-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini --- nbd/server.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index 895cf0a752..0b09ccc8dc 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -1557,7

[PATCH v2 1/6] fixup block-coroutine-wrapper: use qemu_get_current_aio_context()

2023-12-21 Thread Stefan Hajnoczi
qemu-iotests 051 fails on my machine so the change to 051.pc.out made by the above commit appears to be incorrect, at least against the current QEMU source tree. Revert it so that 051 passes again. Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/051.pc.out | 4 ++-- 1 file changed, 2

[PATCH v2 0/6] qemu-iotests fixes for Kevin's block tree

2023-12-21 Thread Stefan Hajnoczi
fixes. The NBD server patches can be inserted before "aio: make aio_context_acquire()/aio_context_release() a no-op" to preserve bisectability. The other patches are fixups that can be squashed into the original patches. Stefan Hajnoczi (6): fixup block-coroutine-wrapper: use qemu_get_cur

[PATCH v2 2/6] fixup block: remove AioContext locking

2023-12-21 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi --- migration/block.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/migration/block.c b/migration/block.c index 2bcfcbfdf6..6ec6a1d6e6 100644 --- a/migration/block.c +++ b/migration/block.c @@ -311,10 +311,17 @@ static int mig_save_device_bulk(QEMUFile

Re: [PATCH 5/6] nbd/server: only traverse NBDExport->clients from main loop thread

2023-12-21 Thread Stefan Hajnoczi
On Thu, Dec 21, 2023 at 08:23:15AM +0100, Paolo Bonzini wrote: > On 12/21/23 02:49, Stefan Hajnoczi wrote: > > The NBD clients list is currently accessed from both the export > > AioContext and the main loop thread. When the AioContext lock is removed > > there will

Re: [PATCH 6/6] nbd/server: introduce NBDClient->lock to protect fields

2023-12-21 Thread Stefan Hajnoczi
On Thu, Dec 21, 2023 at 11:45:36AM +0100, Kevin Wolf wrote: > Am 21.12.2023 um 02:49 hat Stefan Hajnoczi geschrieben: > > NBDClient has a number of fields that are accessed by both the export > > AioContext and the main loop thread. When the AioContext lock is removed > > t

Re: [PATCH 6/6] nbd/server: introduce NBDClient->lock to protect fields

2023-12-21 Thread Stefan Hajnoczi
On Thu, Dec 21, 2023 at 08:26:58AM +0100, Paolo Bonzini wrote: > On 12/21/23 02:49, Stefan Hajnoczi wrote: > > nbd_client_receive_next_request(client); > > + > > +qemu_mutex_unlock(>lock); > > + > > if (ret == -EIO) { > > g

[PATCH 5/6] nbd/server: only traverse NBDExport->clients from main loop thread

2023-12-20 Thread Stefan Hajnoczi
equest but is needed for thread-safety when the AioContext lock is removed. Note that nbd_client_get() can still be called from either thread, so make NBDClient->refcount atomic. Signed-off-by: Stefan Hajnoczi --- nbd/server.c | 23 --- 1 file changed, 20 insertions(+), 3

[PATCH 2/6] fixup block: remove AioContext locking

2023-12-20 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi --- migration/block.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/migration/block.c b/migration/block.c index 2bcfcbfdf6..6ec6a1d6e6 100644 --- a/migration/block.c +++ b/migration/block.c @@ -311,10 +311,17 @@ static int mig_save_device_bulk(QEMUFile

[PATCH 1/6] fixup block-coroutine-wrapper: use qemu_get_current_aio_context()

2023-12-20 Thread Stefan Hajnoczi
qemu-iotests 051 fails on my machine so the change to 051.pc.out made by the above commit appears to be incorrect, at least against the current QEMU source tree. Revert it so that 051 passes again. Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/051.pc.out | 4 ++-- 1 file changed, 2

[PATCH 4/6] nbd/server: avoid per-NBDRequest nbd_client_get/put()

2023-12-20 Thread Stefan Hajnoczi
thread-safety easier in the commits that follow. Signed-off-by: Stefan Hajnoczi --- nbd/server.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index 895cf0a752..0b09ccc8dc 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -1557,7 +1557,6 @@ static NBDRequestData

[PATCH 0/6] qemu-iotests fixes for Kevin's block tree

2023-12-20 Thread Stefan Hajnoczi
be inserted before "aio: make aio_context_acquire()/aio_context_release() a no-op" to preserve bisectability. The other patches are fixups that can be squashed into the original patches. Stefan Hajnoczi (6): fixup block-coroutine-wrapper: use qemu_get_current_aio_context() fixup blo

[PATCH 6/6] nbd/server: introduce NBDClient->lock to protect fields

2023-12-20 Thread Stefan Hajnoczi
ere possible and otherwise add doc comments stating assumptions about which thread and lock holding. Note this patch moves the client->recv_coroutine assertion from nbd_co_receive_request() to nbd_trip() where client->lock is held. Signed-off-by: Stefan Hajnoczi --- nbd/serve

[PATCH 3/6] fixup scsi: only access SCSIDevice->requests from one thread

2023-12-20 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi --- hw/scsi/scsi-bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index df68a44b6a..5b08cbf60a 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -127,7 +127,8 @@ static void

Re: [PATCH v2 04/14] aio: make aio_context_acquire()/aio_context_release() a no-op

2023-12-20 Thread Stefan Hajnoczi
On Tue, 19 Dec 2023 at 13:20, Kevin Wolf wrote: > > Am 19.12.2023 um 16:28 hat Kevin Wolf geschrieben: > > Am 05.12.2023 um 19:20 hat Stefan Hajnoczi geschrieben: > > > aio_context_acquire()/aio_context_release() has been replaced by > > > fine-grained locking to pr

Re: [PULL 00/19] First batch of misc patches for QEMU 9.0

2023-12-20 Thread Stefan Hajnoczi
On Wed, 20 Dec 2023 at 18:12, Alex Bennée wrote: > > Stefan Hajnoczi writes: > > > Applied, thanks. > > > > Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for > > any user-visible changes. > > might need to change the template for that ;-) Done, thanks! Stefan

Re: [PULL 00/43] target-arm queue

2023-12-20 Thread Stefan Hajnoczi
On Wed, 20 Dec 2023 at 12:24, Peter Maydell wrote: > > On Wed, 20 Dec 2023 at 16:03, Stefan Hajnoczi wrote: > > > > Applied, thanks. > > > > Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any > > user-visible changes. > > Sho

Re: [qemu-web PATCH] Add QEMU 8.2.0 release announcement

2023-12-20 Thread Stefan Hajnoczi
On Wed, 20 Dec 2023 at 11:18, Michael Roth wrote: > > Quoting Stefan Hajnoczi (2023-12-20 10:02:37) > > Cc: Michael Roth > > Signed-off-by: Stefan Hajnoczi > > --- > > _posts/2023-12-20-qemu-8-2-0.md | 29 + > > 1 file change

Re: [PULL 00/43] target-arm queue

2023-12-20 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL 00/19] First batch of misc patches for QEMU 9.0

2023-12-20 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL 00/47] vfio queue

2023-12-20 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes. signature.asc Description: PGP signature

[qemu-web PATCH] Add QEMU 8.2.0 release announcement

2023-12-20 Thread Stefan Hajnoczi
Cc: Michael Roth Signed-off-by: Stefan Hajnoczi --- _posts/2023-12-20-qemu-8-2-0.md | 29 + 1 file changed, 29 insertions(+) create mode 100644 _posts/2023-12-20-qemu-8-2-0.md diff --git a/_posts/2023-12-20-qemu-8-2-0.md b/_posts/2023-12-20-qemu-8-2-0.md new file

[PATCH v4 2/4] string-output-visitor: show structs as ""

2023-12-20 Thread Stefan Hajnoczi
fix to solve the crash, but the long-term solution is replacing StringOutputVisitor with something that can handle the full gamut of values in QEMU. Reviewed-by: Markus Armbruster Signed-off-by: Stefan Hajnoczi --- include/qapi/string-output-visitor.h | 6 +++--- qapi/string-output-visitor.c

[PATCH v4 4/4] virtio-blk: add iothread-vq-mapping parameter

2023-12-20 Thread Stefan Hajnoczi
blk-pci,iothread= and non-IOThread mode by assigning all virtqueues to the IOThread and main loop's AioContext in vq_aio_context[], respectively. The comment in struct VirtIOBlockDataPlane about EventNotifiers is stale. Remove it. Signed-off-by: Stefan Hajnoczi --- hw/block/dataplane/virtio-bl

[PATCH v4 1/4] qdev-properties: alias all object class properties

2023-12-20 Thread Stefan Hajnoczi
if they are QOM object class properties. Signed-off-by: Stefan Hajnoczi --- hw/core/qdev-properties.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 840006e953..7d6fa726fd 100644 --- a/hw/core/qdev

[PATCH v4 0/4] virtio-blk: add iothread-vq-mapping parameter

2023-12-20 Thread Stefan Hajnoczi
eassign virtqueues at runtime and I expect that to be a very rare requirement. Note that JSON --device syntax is required for the iothread-vq-mapping parameter because it's non-scalar. Based-on: 81e69329d6a4018f4b37d15b6fc845fbe585a93b (https://repo.or.cz/qemu/kevin.git block) Stefan Hajnoczi (4): qd

[PATCH v4 3/4] qdev: add IOThreadVirtQueueMappingList property type

2023-12-20 Thread Stefan Hajnoczi
vailable: --device '{"driver":"foo","iothread-vq-mapping":[{"iothread":"iothread0"},{"iothread":"iothread1"},...]}' Signed-off-by: Stefan Hajnoczi --- qapi/virtio.json| 29 ++ include/

Re: [PATCH v2 04/14] aio: make aio_context_acquire()/aio_context_release() a no-op

2023-12-20 Thread Stefan Hajnoczi
On Wed, 20 Dec 2023 at 04:32, Kevin Wolf wrote: > > Am 19.12.2023 um 22:23 hat Stefan Hajnoczi geschrieben: > > The following hack makes the test pass but there are larger safety > > issues that I'll need to look at on Wednesday: > > I see, you're taking the same appro

Re: [PATCH v2 04/14] aio: make aio_context_acquire()/aio_context_release() a no-op

2023-12-19 Thread Stefan Hajnoczi
The following hack makes the test pass but there are larger safety issues that I'll need to look at on Wednesday: diff --git a/nbd/server.c b/nbd/server.c index 895cf0a752..cf4b7d5c6d 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -1617,7 +1617,7 @@ static void nbd_drained_begin(void *opaque)

Re: [PATCH v2 06/14] block: remove AioContext locking

2023-12-19 Thread Stefan Hajnoczi
On Tue, 19 Dec 2023 at 10:59, Kevin Wolf wrote: > > Am 05.12.2023 um 19:20 hat Stefan Hajnoczi geschrieben: > > This is the big patch that removes > > aio_context_acquire()/aio_context_release() from the block layer and > > affected block layer users. > > > &

Re: [PATCH v2 1/4] scsi: only access SCSIDevice->requests from one thread

2023-12-19 Thread Stefan Hajnoczi
On Tue, 19 Dec 2023 at 10:12, Kevin Wolf wrote: > > Am 04.12.2023 um 17:42 hat Stefan Hajnoczi geschrieben: > > Stop depending on the AioContext lock and instead access > > SCSIDevice->requests from only one thread at a time: > > - When the VM is running only the Bl

[PATCH v3 4/4] virtio-blk: add iothread-vq-mapping parameter

2023-12-19 Thread Stefan Hajnoczi
blk-pci,iothread= and non-IOThread mode by assigning all virtqueues to the IOThread and main loop's AioContext in vq_aio_context[], respectively. The comment in struct VirtIOBlockDataPlane about EventNotifiers is stale. Remove it. Signed-off-by: Stefan Hajnoczi --- hw/block/dataplane/virtio-bl

[PATCH v3 3/4] qdev: add IOThreadVirtQueueMappingList property type

2023-12-19 Thread Stefan Hajnoczi
vailable: --device '{"driver":"foo","iothread-vq-mapping":[{"iothread":"iothread0"},{"iothread":"iothread1"},...]}' Signed-off-by: Stefan Hajnoczi --- qapi/virtio.json| 30 +++ include/

<    1   2   3   4   5   6   7   8   9   10   >