Re: [PATCH] spec: Add NBD_OPT_EXTENDED_HEADERS

2021-12-06 Thread Vladimir Sementsov-Ogievskiy
04.12.2021 02:14, Eric Blake wrote: Add a new negotiation feature where the client and server agree to use larger packet headers on every packet sent during transmission phase. This has two purposes: first, it makes it possible to perform operations like trim, write zeroes, and block status on mo

Re: [PATCH 01/14] nbd/server: Minor cleanups

2021-12-06 Thread Vladimir Sementsov-Ogievskiy
04.12.2021 02:15, Eric Blake wrote: Spelling fixes, grammar improvements and consistent spacing, noticed while preparing other patches in this file. Signed-off-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- nbd/server.c | 13 ++--- 1 file changed, 6 insertions(+),

Re: [PATCH 02/14] qemu-io: Utilize 64-bit status during map

2021-12-06 Thread Vladimir Sementsov-Ogievskiy
04.12.2021 02:15, Eric Blake wrote: The block layer has supported 64-bit block status from drivers since commit 86a3d5c688 ("block: Add .bdrv_co_block_status() callback", v2.12) and friends, with individual driver callbacks responsible for capping things where necessary. Artificially capping thi

Re: [PATCH 03/14] qemu-io: Allow larger write zeroes under no fallback

2021-12-06 Thread Vladimir Sementsov-Ogievskiy
04.12.2021 02:15, Eric Blake wrote: When writing zeroes can fall back to a slow write, permitting an overly large request can become an amplification denial of service attack in triggering a large amount of work from a small request. But the whole point of the no fallback flag is to quickly dete

Re: [PATCH 04/14] nbd/client: Add safety check on chunk payload length

2021-12-06 Thread Vladimir Sementsov-Ogievskiy
04.12.2021 02:15, Eric Blake wrote: Our existing use of structured replies either reads into a qiov capped at 32M (NBD_CMD_READ) or caps allocation to 1000 bytes (see NBD_MAX_MALLOC_PAYLOAD in block/nbd.c). But the existing length checks are rather late; if we encounter a buggy (or malicious) se

Re: [PATCH v2 01/13] hw/sd/ssi-sd: Do not create SD card within controller's realize

2021-12-06 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Hi Markus, Peter, > > On 11/17/21 17:33, Markus Armbruster wrote: >> ssi_sd_realize() creates an "sd-card" device. This is inappropriate, >> and marked FIXME. >> >> Move it to the boards that create these devices. Prior art: commit >> eb4f566bbb for device "gen

[PATCH v10 0/8] hmp,qmp: Add commands to introspect virtio devices

2021-12-06 Thread Jonah Palmer
This series introduces new QMP/HMP commands to dump the status of a virtio device at different levels. [Jonah: Rebasing previous patchset from Nov. 10 (v9). Original patches are by Laurent Vivier from May 2020. Rebase from v9 to v10 includes reformatting virtio.json examples and command struct

[PATCH v10 3/8] qmp: add QMP command x-query-virtio

2021-12-06 Thread Jonah Palmer
From: Laurent Vivier This new command lists all the instances of VirtIODevices with their canonical QOM path and name. Signed-off-by: Jonah Palmer --- hw/virtio/meson.build | 2 ++ hw/virtio/virtio-stub.c| 14 ++ hw/virtio/virtio.c | 27 ++ include/hw/

[PATCH v10 6/8] qmp: add QMP commands for virtio/vhost queue-status

2021-12-06 Thread Jonah Palmer
From: Laurent Vivier These new commands show the internal status of a VirtIODevice's VirtQueue and a vhost device's vhost_virtqueue (if active). Signed-off-by: Jonah Palmer --- hw/virtio/virtio-stub.c | 14 +++ hw/virtio/virtio.c | 103 qapi/virtio.json| 252

[PATCH v10 2/8] virtio: add vhost support for virtio devices

2021-12-06 Thread Jonah Palmer
This patch adds a get_vhost() callback function for VirtIODevices that returns the device's corresponding vhost_dev structure, if the vhost device is running. This patch also adds a vhost_started flag for VirtIODevices. Previously, a VirtIODevice wouldn't be able to tell if its corresponding vhost

[PATCH v10 7/8] qmp: add QMP command x-query-virtio-queue-element

2021-12-06 Thread Jonah Palmer
From: Laurent Vivier This new command shows the information of a VirtQueue element. Signed-off-by: Jonah Palmer --- hw/virtio/virtio-stub.c | 9 +++ hw/virtio/virtio.c | 154 qapi/virtio.json| 183 +

[PATCH v10 8/8] hmp: add virtio commands

2021-12-06 Thread Jonah Palmer
From: Laurent Vivier This patch implements the HMP versions of the virtio QMP commands. Signed-off-by: Jonah Palmer --- hmp-commands-info.hx | 70 include/monitor/hmp.h | 5 + monitor/hmp-cmds.c| 311 ++ 3 files changed, 386

[PATCH v10 1/8] virtio: drop name parameter for virtio_init()

2021-12-06 Thread Jonah Palmer
This patch drops the name parameter for the virtio_init function. The pair between the numeric device ID and the string device ID (name) of a virtio device already exists, but not in a way that lets us map between them. This patch lets us do this and removes the need for the name parameter in the

[PATCH v10 4/8] qmp: add QMP command x-query-virtio-status

2021-12-06 Thread Jonah Palmer
From: Laurent Vivier This new command shows the status of a VirtIODevice, including its corresponding vhost device's status (if active). Next patch will improve output by decoding feature bits, including vhost device's feature bits (backend, protocol, acked, and features). Also will decode statu

[PATCH v10 5/8] qmp: decode feature & status bits in virtio-status

2021-12-06 Thread Jonah Palmer
From: Laurent Vivier Display feature names instead of bitmaps for host, guest, and backend for VirtIODevices. Display status names instead of bitmaps for VirtIODevices. Display feature names instead of bitmaps for backend, protocol, acked, and features (hdev->features) for vhost devices. Decod

Re: [PATCH v2 01/13] hw/sd/ssi-sd: Do not create SD card within controller's realize

2021-12-06 Thread Peter Maydell
On Mon, 6 Dec 2021 at 12:35, Markus Armbruster wrote: > Philippe Mathieu-Daudé writes: > > I guess a already asked this once but don't remember now... What is the > > point of creating a SD card without drive? Is this due to the old design > > issue we hotplug the drive to the SD card and not the

Re: [PATCH v10 0/8] hmp, qmp: Add commands to introspect virtio devices

2021-12-06 Thread Christian Schoenebeck via
On Montag, 6. Dezember 2021 13:43:18 CET Jonah Palmer wrote: > This series introduces new QMP/HMP commands to dump the status of a > virtio device at different levels. > > [Jonah: Rebasing previous patchset from Nov. 10 (v9). Original patches > are by Laurent Vivier from May 2020. > > Rebase fr

Re: [PATCH v10 1/8] virtio: drop name parameter for virtio_init()

2021-12-06 Thread Christian Schoenebeck
On Montag, 6. Dezember 2021 13:43:19 CET Jonah Palmer wrote: > This patch drops the name parameter for the virtio_init function. > > The pair between the numeric device ID and the string device ID > (name) of a virtio device already exists, but not in a way that > lets us map between them. > > Th

[RFC v3 3/4] rcu: use coroutine TLS macros

2021-12-06 Thread Stefan Hajnoczi
RCU may be used from coroutines. Standard __thread variables cannot be used by coroutines. Use the coroutine TLS macros instead. Signed-off-by: Stefan Hajnoczi --- include/qemu/rcu.h | 7 --- tests/unit/rcutorture.c| 10 +- tests/unit/test-rcu-list.c | 4 ++-- util/rcu.

[RFC v3 2/4] util/async: replace __thread with QEMU TLS macros

2021-12-06 Thread Stefan Hajnoczi
QEMU TLS macros must be used to make TLS variables safe with coroutines. Signed-off-by: Stefan Hajnoczi --- util/async.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/util/async.c b/util/async.c index 6f6717a34b..ddd9f24419 100644 --- a/util/async.c +++ b/util/

[RFC v3 0/4] tls: add macros for coroutine-safe TLS variables

2021-12-06 Thread Stefan Hajnoczi
v3: - Added __attribute__((weak)) to get_ptr_*() [Florian] - Replace rdfsbase with mov %%fs:0,%0 [Florian] This patch series solves the coroutines TLS problem. Coroutines re-entered from another thread sometimes see stale TLS values. This happens because compilers may cache values across yield poi

[RFC v3 1/4] tls: add macros for coroutine-safe TLS variables

2021-12-06 Thread Stefan Hajnoczi
Compiler optimizations can cache TLS values across coroutine yield points, resulting in stale values from the previous thread when a coroutine is re-entered by a new thread. Serge Guelton developed an __attribute__((noinline)) wrapper and tested it with clang and gcc. I formatted his idea accordin

[RFC v3 4/4] cpus: use coroutine TLS macros for iothread_locked

2021-12-06 Thread Stefan Hajnoczi
qemu_mutex_iothread_locked() may be used from coroutines. Standard __thread variables cannot be used by coroutines. Use the coroutine TLS macros instead. Signed-off-by: Stefan Hajnoczi --- softmmu/cpus.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/softmmu/cpus.c b

Re: [RFC v3 0/4] tls: add macros for coroutine-safe TLS variables

2021-12-06 Thread Peter Maydell
On Mon, 6 Dec 2021 at 14:33, Stefan Hajnoczi wrote: > > v3: > - Added __attribute__((weak)) to get_ptr_*() [Florian] Do we really need it *only* on get_ptr_*() ? If we need to noinline the other two we probably also should use the same attribute weak to force no optimizations at all. -- PMM

[PATCH for-7.0] tests/qemu-iotests: Fix 051 for binaries without 'lsi53c895a'

2021-12-06 Thread Thomas Huth
The lsi53c895a SCSI adaptor might not be enabled in each and every x86 QEMU binary, e.g. it's disabled in the RHEL/CentOS build. Thus let's add a check to the 051 test so that it does not fail if this device is not available. Signed-off-by: Thomas Huth --- tests/qemu-iotests/051 | 4 1 file

[PULL 0/1] Block patches

2021-12-06 Thread Stefan Hajnoczi
The following changes since commit 99fc08366b06282614daeda989d2fde6ab8a707f: Merge tag 'seabios-20211203-pull-request' of git://git.kraxel.org/qemu into staging (2021-12-03 05:26:40 -0800) are available in the Git repository at: https://gitlab.com/stefanha/qemu.git tags/block-pull-request

[PULL 1/1] virtio-blk: Fix clean up of host notifiers for single MR transaction.

2021-12-06 Thread Stefan Hajnoczi
From: Mark Mielke The code that introduced "virtio-blk: Configure all host notifiers in a single MR transaction" introduced a second loop variable to perform cleanup in second loop, but mistakenly still refers to the first loop variable within the second loop body. Fixes: d0267da61489 ("virtio-b

Re: [PATCH v2 00/13] Eliminate drive_get_next()

2021-12-06 Thread Markus Armbruster
Markus Armbruster writes: > drive_get_next() is basically a bad idea. It returns the "next" block > backend of a certain interface type. "Next" means bus=0,unit=N, where > subsequent calls count N up from zero, per interface type. > > This lets you define unit numbers implicitly by execution or

Re: [PATCH v10 0/8] hmp,qmp: Add commands to introspect virtio devices

2021-12-06 Thread Jonah Palmer
On 12/6/21 08:50, Christian Schoenebeck wrote: On Montag, 6. Dezember 2021 13:43:18 CET Jonah Palmer wrote: This series introduces new QMP/HMP commands to dump the status of a virtio device at different levels. [Jonah: Rebasing previous patchset from Nov. 10 (v9). Original patches are by Lau

Re: [PATCH 1/3] iotests/testrunner.py: add doc string for run_test()

2021-12-06 Thread John Snow
On Fri, Dec 3, 2021 at 7:22 AM Vladimir Sementsov-Ogievskiy < vsement...@virtuozzo.com> wrote: > We are going to modify these methods and will add more documentation in > further commit. As a preparation add basic documentation. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > tests/qemu-

Re: [PATCH 2/3] iotests/testrunner.py: move updating last_elapsed to run_tests

2021-12-06 Thread John Snow
On Fri, Dec 3, 2021 at 7:22 AM Vladimir Sementsov-Ogievskiy < vsement...@virtuozzo.com> wrote: > We are going to use do_run_test() in multiprocessing environment, where > we'll not be able to change original runner object. > > Happily, the only thing we change is that last_elapsed and it's simple

Re: [PATCH v10 0/8] hmp, qmp: Add commands to introspect virtio devices

2021-12-06 Thread Christian Schoenebeck via
On Montag, 6. Dezember 2021 17:09:45 CET Jonah Palmer wrote: > On 12/6/21 08:50, Christian Schoenebeck wrote: > > On Montag, 6. Dezember 2021 13:43:18 CET Jonah Palmer wrote: > >> This series introduces new QMP/HMP commands to dump the status of a > >> virtio device at different levels. > >> > >>

Re: [PATCH 3/3] iotests: check: multiprocessing support

2021-12-06 Thread John Snow
On Fri, Dec 3, 2021 at 7:22 AM Vladimir Sementsov-Ogievskiy < vsement...@virtuozzo.com> wrote: > Add -j parameter, to run tests in several jobs simultaneously. > For realization - simply utilize multiprocessing.Pool class. > > Notes: > > 1. Of course, tests can't run simultaneously in same TEST_D

Re: [PATCH 0/3] iotests: multiprocessing!!

2021-12-06 Thread John Snow
On Fri, Dec 3, 2021 at 7:22 AM Vladimir Sementsov-Ogievskiy < vsement...@virtuozzo.com> wrote: > Hi all! > > Finally, I can not stand it any longer. So, I'm happy to present > multiprocessing support for iotests test runner. > > testing on tmpfs: > > Before: > > time check -qcow2 > ... > real1

Re: [PATCH 3/3] iotests: check: multiprocessing support

2021-12-06 Thread Vladimir Sementsov-Ogievskiy
06.12.2021 21:35, John Snow wrote: On Fri, Dec 3, 2021 at 7:22 AM Vladimir Sementsov-Ogievskiy mailto:vsement...@virtuozzo.com>> wrote: Add -j parameter, to run tests in several jobs simultaneously. For realization - simply utilize multiprocessing.Pool class. Notes: 1. Of co

Re: [PATCH 0/3] iotests: multiprocessing!!

2021-12-06 Thread Vladimir Sementsov-Ogievskiy
06.12.2021 21:37, John Snow wrote: On Fri, Dec 3, 2021 at 7:22 AM Vladimir Sementsov-Ogievskiy mailto:vsement...@virtuozzo.com>> wrote: Hi all! Finally, I can not stand it any longer. So, I'm happy to present multiprocessing support for iotests test runner. testing on tmpfs:

Re: [PATCH 3/3] iotests: check: multiprocessing support

2021-12-06 Thread John Snow
On Mon, Dec 6, 2021 at 3:20 PM Vladimir Sementsov-Ogievskiy < vsement...@virtuozzo.com> wrote: > 06.12.2021 21:35, John Snow wrote: > > > > > > On Fri, Dec 3, 2021 at 7:22 AM Vladimir Sementsov-Ogievskiy < > vsement...@virtuozzo.com > wrote: > > > > Add -j par

Re: [PULL 0/1] Block patches

2021-12-06 Thread Richard Henderson
On 12/6/21 7:27 AM, Stefan Hajnoczi wrote: The following changes since commit 99fc08366b06282614daeda989d2fde6ab8a707f: Merge tag 'seabios-20211203-pull-request' of git://git.kraxel.org/qemu into staging (2021-12-03 05:26:40 -0800) are available in the Git repository at: https://gitlab.

Re: [PATCH v10 0/8] hmp,qmp: Add commands to introspect virtio devices

2021-12-06 Thread Michael S. Tsirkin
On Mon, Dec 06, 2021 at 07:13:49PM +0100, Christian Schoenebeck wrote: > On Montag, 6. Dezember 2021 17:09:45 CET Jonah Palmer wrote: > > On 12/6/21 08:50, Christian Schoenebeck wrote: > > > On Montag, 6. Dezember 2021 13:43:18 CET Jonah Palmer wrote: > > >> This series introduces new QMP/HMP comma

Re: [PATCH] spec: Add NBD_OPT_EXTENDED_HEADERS

2021-12-06 Thread Eric Blake
On Mon, Dec 06, 2021 at 02:40:45PM +0300, Vladimir Sementsov-Ogievskiy wrote: > > Simple reply message > > > > The simple reply message MUST be sent by the server in response to all > > requests if structured replies have not been negotiated using > > -`NBD_OPT_STRUCTURED_REPLY`. If str

Re: [PATCH v10 3/8] qmp: add QMP command x-query-virtio

2021-12-06 Thread Markus Armbruster
Jonah Palmer writes: > From: Laurent Vivier > > This new command lists all the instances of VirtIODevices with > their canonical QOM path and name. > > Signed-off-by: Jonah Palmer > --- > hw/virtio/meson.build | 2 ++ > hw/virtio/virtio-stub.c| 14 ++ > hw/virtio/virtio.c

Re: [PATCH v10 4/8] qmp: add QMP command x-query-virtio-status

2021-12-06 Thread Markus Armbruster
Jonah Palmer writes: > From: Laurent Vivier > > This new command shows the status of a VirtIODevice, including > its corresponding vhost device's status (if active). > > Next patch will improve output by decoding feature bits, including > vhost device's feature bits (backend, protocol, acked, an