[PATCH v3 4/7] hw/isa/isa-bus: Remove isabus_dev_print()

2022-03-01 Thread Bernhard Beschow
All isabus_dev_print() did was to print up to two IRQ numbers per device. This is redundant if the IRQ numbers are present as QOM properties (see e.g. the modified tests/qemu-iotests/172.out). Now that the last devices relying on isabus_dev_print() had their IRQ numbers QOM'ified, the contribution

[PATCH v3 7/7] isa: Inline and remove one-line isa_init_irq()

2022-03-01 Thread Bernhard Beschow
isa_init_irq() has become a trivial one-line wrapper for isa_get_irq(). It can therefore be removed. Signed-off-by: Bernhard Beschow Reviewed-by: Stefan Berger (tpm_tis_isa) Acked-by: Corey Minyard (isa_ipmi_bt, isa_ipmi_kcs) Reviewed-by: Philippe Mathieu-Daudé --- hw/audio/cs4231a.c | 2

[PATCH 2/3] block/copy-before-write: add on-cbw-error open parameter

2022-03-01 Thread Vladimir Sementsov-Ogievskiy
Currently, behavior on copy-before-write operation failure is simple: report error to the guest. Let's implement alternative behavior: break the whole copy-before-write process (and corresponding backup job or NBD client) but keep guest working. It's needed if we consider guest stability as more i

[PATCH 1/3] block/copy-before-write: refactor option parsing

2022-03-01 Thread Vladimir Sementsov-Ogievskiy
We are going to add one more option of enum type. Let's refactor option parsing so that we can simply work with BlockdevOptionsCbw object. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/copy-before-write.c | 66 --- 1 file changed, 40 insertions(+), 26

[PATCH 3/3] iotests: add copy-before-write: on-cbw-error tests

2022-03-01 Thread Vladimir Sementsov-Ogievskiy
Add tests for new option of copy-before-write filter: on-cbw-error. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/tests/copy-before-write| 128 ++ .../qemu-iotests/tests/copy-before-write.out | 5 + 2 files changed, 133 insertions(+) create mode 10075

[PATCH 0/3] block: copy-before-write: on-cbw-error behavior

2022-03-01 Thread Vladimir Sementsov-Ogievskiy
Hi all! Here is a new option for copy-before-write filter, to alter its behavior on copy-before-write operation failure. Based-on: <20220228113927.1852146-1-vsement...@virtuozzo.com> ([PATCH v5 00/16] Make image fleecing more usable) Vladimir Sementsov-Ogievskiy (3): block/copy-before-write

[PATCH] block: Fix BB.root changing across bdrv_next()

2022-03-01 Thread Hanna Reitz
bdrv_next() has no guarantee that its caller has stopped all block graph operations; for example, bdrv_flush_all() does not. The latter can actually provoke such operations, because its bdrv_flush() call, which runs a coroutine (bdrv_co_flush()), may run this coroutine in a different AioContext th

Re: [PATCH v7 00/31] block layer: split block APIs in global state and I/O

2022-03-01 Thread Kevin Wolf
Am 11.02.2022 um 15:51 hat Emanuele Giuseppe Esposito geschrieben: > Currently, block layer APIs like block.h contain a mix of > functions that are either running in the main loop and under the > BQL, or are thread-safe functions and run in iothreads performing I/O. > The functions running under BQ

Re: [PATCH v2 0/6] hw/nvme: enhanced protection information (64-bit guard)

2022-03-01 Thread Keith Busch
On Tue, Mar 01, 2022 at 11:44:22AM +0100, Klaus Jensen wrote: > From: Klaus Jensen > > This adds support for one possible new protection information format > introduced in TP4068 (and integrated in NVMe 2.0): the 64-bit CRC guard > and 48-bit reference tag. This version does not support storage t

Re: [RFC PATCH 0/5] Removal of AioContext lock, bs->parents and ->children: proof of concept

2022-03-01 Thread Emanuele Giuseppe Esposito
I would really love to hear opinions on this, since we already had some discussions on other similar patches. Thank you, Emanuele On 01/03/2022 15:21, Emanuele Giuseppe Esposito wrote: > This serie tries to provide a proof of concept and a clear explanation > on why we need to use drains (and mor

[RFC PATCH 4/5] child_job_drained_poll: override polling condition only when in home thread

2022-03-01 Thread Emanuele Giuseppe Esposito
drv->drained_poll() is only implemented in mirror, and allows it to drain from the coroutine. The mirror implementation uses in_drain flag to recognize when it is draining from coroutine, and consequently avoid deadlocking (wait the poll condition in child_job_drained_poll to wait for itself). The

[RFC PATCH 1/5] aio-wait.h: introduce AIO_WAIT_WHILE_UNLOCKED

2022-03-01 Thread Emanuele Giuseppe Esposito
Same as AIO_WAIT_WHILE macro, but if we are in the Main loop do not release and then acquire ctx_ 's aiocontext. Once all Aiocontext locks go away, this macro will replace AIO_WAIT_WHILE. Signed-off-by: Emanuele Giuseppe Esposito --- include/block/aio-wait.h | 15 +++ 1 file changed

[RFC PATCH 5/5] test-bdrv-drain: ensure draining from main loop stops iothreads

2022-03-01 Thread Emanuele Giuseppe Esposito
Add 2 tests: test_main_and_then_iothread_drain ensures that if the main thread drains, the iothread cannot drain (and thus read the graph). test_main_and_iothread_drain instead lets main loop and iothread to drain together, and makes sure that no drain happens in parallel. Note that we are using b

[RFC PATCH 3/5] block/io.c: introduce bdrv_subtree_drained_{begin/end}_unlocked

2022-03-01 Thread Emanuele Giuseppe Esposito
Same as the locked version, but use BDRV_POLL_UNLOCKED. We are going to add drains to all graph modifications, and they are generally performed without the AioContext lock taken. Signed-off-by: Emanuele Giuseppe Esposito --- block/io.c| 48 ---

[RFC PATCH 0/5] Removal of AioContext lock, bs->parents and ->children: proof of concept

2022-03-01 Thread Emanuele Giuseppe Esposito
This serie tries to provide a proof of concept and a clear explanation on why we need to use drains (and more precisely subtree_drains) to replace the aiocontext lock, especially to protect BlockDriverState ->children and ->parent lists. Just a small recap on the key concepts: * We split block lay

[RFC PATCH 2/5] introduce BDRV_POLL_WHILE_UNLOCKED

2022-03-01 Thread Emanuele Giuseppe Esposito
Same as BDRV_POLL_WHILE, but uses AIO_WAIT_WHILE_UNLOCKED. See doc comment for more info. Signed-off-by: Emanuele Giuseppe Esposito --- include/block/block.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/block/block.h b/include/block/block.h index e1713ee306..5a7a850c16 100644

Re: [PATCH v5 13/15] hw/nvme: Add support for the Virtualization Management command

2022-03-01 Thread Klaus Jensen
On Feb 17 18:45, Lukasz Maniak wrote: > From: Łukasz Gieryk > > With the new command one can: > - assign flexible resources (queues, interrupts) to primary and >secondary controllers, > - toggle the online/offline state of given controller. > QEMU segfaults (or asserts depending on the wi

Re: [PATCH v5 14/15] docs: Add documentation for SR-IOV and Virtualization Enhancements

2022-03-01 Thread Klaus Jensen
On Feb 17 18:45, Lukasz Maniak wrote: > Signed-off-by: Lukasz Maniak Please add a short commit description as well. Otherwise, Reviewed-by: Klaus Jensen > --- > docs/system/devices/nvme.rst | 82 > 1 file changed, 82 insertions(+) > > diff --git a/docs/sy

Re: [PATCH v5 09/15] hw/nvme: Make max_ioqpairs and msix_qsize configurable in runtime

2022-03-01 Thread Klaus Jensen
On Feb 17 18:44, Lukasz Maniak wrote: > From: Łukasz Gieryk > > The NVMe device defines two properties: max_ioqpairs, msix_qsize. Having > them as constants is problematic for SR-IOV support. > > SR-IOV introduces virtual resources (queues, interrupts) that can be > assigned to PF and its depend

Re: [PATCH v7 02/31] main loop: macros to mark GS and I/O functions

2022-03-01 Thread Kevin Wolf
Am 11.02.2022 um 15:51 hat Emanuele Giuseppe Esposito geschrieben: > Righ now, IO_CODE and IO_OR_GS_CODE are nop, as there isn't > really a way to check that a function is only called in I/O. > On the other side, we can use qemu_in_main_thread to check if > we are in the main loop. > > Signed-off-

[PATCH v2 4/6] hw/nvme: add support for the lbafee hbs feature

2022-03-01 Thread Klaus Jensen
From: Naveen Nagar Add support for up to 64 LBA formats through the LBAFEE field of the Host Behavior Support feature. Reviewed-by: Keith Busch Signed-off-by: Naveen Nagar Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 34 +++--- hw/nvme/ns.c | 15

[PATCH v2 3/6] hw/nvme: move format parameter parsing

2022-03-01 Thread Klaus Jensen
From: Klaus Jensen There is no need to extract the format command parameters for each namespace. Move it to the entry point. Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-) diff --

[PATCH v2 2/6] hw/nvme: add host behavior support feature

2022-03-01 Thread Klaus Jensen
From: Naveen Nagar Add support for getting and setting the Host Behavior Support feature. Reviewed-by: Keith Busch Signed-off-by: Naveen Nagar Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 8 hw/nvme/nvme.h | 4 +++- include/block/nvme.h | 9 + 3 files changed

[PATCH v2 6/6] hw/nvme: 64-bit pi support

2022-03-01 Thread Klaus Jensen
From: Naveen Nagar This adds support for one possible new protection information format introduced in TP4068 (and integrated in NVMe 2.0): the 64-bit CRC guard and 48-bit reference tag. This version does not support storage tags. Like the CRC16 support already present, this uses a software imple

[PATCH v2 1/6] hw/nvme: move dif/pi prototypes into dif.h

2022-03-01 Thread Klaus Jensen
From: Klaus Jensen Move dif/pi data structures and inlines to dif.h. Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 1 + hw/nvme/dif.c | 1 + hw/nvme/dif.h | 53 ++ hw/nvme/nvme.h | 50 -

[PATCH v2 5/6] hw/nvme: add pi tuple size helper

2022-03-01 Thread Klaus Jensen
From: Klaus Jensen A subsequent patch will introduce a new tuple size; so add a helper and use that instead of sizeof() and magic numbers. Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 14 -- hw/nvme/dif.c | 16 hw/nvme/dif.h | 5 +++

[PATCH v2 0/6] hw/nvme: enhanced protection information (64-bit guard)

2022-03-01 Thread Klaus Jensen
From: Klaus Jensen This adds support for one possible new protection information format introduced in TP4068 (and integrated in NVMe 2.0): the 64-bit CRC guard and 48-bit reference tag. This version does not support storage tags. Like the CRC16 support already present, this uses a software imple

Re: [PATCH 0/5] block layer: permission API refactoring in preparation

2022-03-01 Thread Kevin Wolf
Am 09.02.2022 um 11:54 hat Emanuele Giuseppe Esposito geschrieben: > This serie aims to refactoring and fixing permission API related bugs that > came > up in the serie "block layer: split block APIs in global state and I/O". > In that serie, we are splitting all block layer headers in > Global St

Re: [PATCH 1/5] crypto: perform permission checks under BQL

2022-03-01 Thread Kevin Wolf
Am 09.02.2022 um 11:54 hat Emanuele Giuseppe Esposito geschrieben: > Move the permission API calls into driver-specific callbacks > that always run under BQL. In this case, bdrv_crypto_luks > needs to perform permission checks before and after > qcrypto_block_amend_options(). The problem is that th

Re: [PATCH] aio-posix: fix spurious ->poll_ready() callbacks in main loop

2022-03-01 Thread Stefan Hajnoczi
On Wed, Feb 23, 2022 at 03:57:03PM +, Stefan Hajnoczi wrote: > When ->poll() succeeds the AioHandler is placed on the ready list with > revents set to the magic value 0. This magic value causes > aio_dispatch_handler() to invoke ->poll_ready() instead of ->io_read() > for G_IO_IN or ->io_write(

Re: [PATCH 1/3] util & iothread: Introduce event-loop abstract class

2022-03-01 Thread Stefan Hajnoczi
On Mon, Feb 28, 2022 at 08:05:52PM +0100, Nicolas Saenz Julienne wrote: > On Thu, 2022-02-24 at 09:48 +, Stefan Hajnoczi wrote: > > On Mon, Feb 21, 2022 at 06:08:43PM +0100, Nicolas Saenz Julienne wrote: > > > diff --git a/qom/meson.build b/qom/meson.build > > > index 062a3789d8..c20e5dd1cb 100