Re: [PATCH v2 2/4] Avoid conflicting types for 'copy_file_range'

2024-01-22 Thread Sergey Bugaev
Hello, On Mon, Jan 22, 2024 at 8:05 PM Peter Maydell wrote: > > On Thu, 18 Jan 2024 at 16:03, Manolo de Medici > wrote: > > > > Compilation fails on systems where copy_file_range is already defined as a > > stub. > > What do you mean by "stub" here ? If the system headers define > a prototype

Re: [PATCH v2 2/4] Avoid conflicting types for 'copy_file_range'

2024-01-22 Thread Sergey Bugaev
On Mon, Jan 22, 2024 at 9:23 PM Sergey Bugaev wrote: > call such a function. For example on GNU/Linux, remove(2) is a stub, (That was supposed to say revoke(2), of course.)

[RFC v3 5/7] hw/nvme: make the metadata of ZNS emulation persistent

2024-01-22 Thread Sam Li
The NVMe ZNS devices follow NVMe ZNS spec but the state of namespace zones does not persist accross restarts of QEMU. This patch makes the metadata of ZNS emulation persistent by using new block layer APIs. The ZNS device calls zone report and zone mgmt APIs from the block layer which will handle

[RFC v3 3/7] hw/nvme: use blk_get_*() to access zone info in the block layer

2024-01-22 Thread Sam Li
The zone information is contained in the BlockLimits fileds. Add blk_get_*() functions to access the block layer and update zone info accessing in the NVMe device emulation. Signed-off-by: Sam Li --- block/block-backend.c | 72 +++ hw/nvme/ctrl.c

[RFC v3 2/7] qcow2: add zd_extension configurations to zoned metadata

2024-01-22 Thread Sam Li
Zone descriptor extension data is host definied data that is associated with each zone. Add zone descriptor extensions to zonedmeta struct. Signed-off-by: Sam Li --- block/qcow2.c| 70 +--- block/qcow2.h| 2 +

[RFC v3 7/7] hw/nvme: make ZDED persistent

2024-01-22 Thread Sam Li
Zone descriptor extension data (ZDED) is not persistent across QEMU restarts. The zone descriptor extension valid bit (ZDEV) is part of zone attributes, which sets to one when the ZDED is associated with the zone. With the qcow2 img as the backing file, the NVMe ZNS device stores the zone

[RFC v3 0/7] Add persistence to NVMe ZNS emulation

2024-01-22 Thread Sam Li
ZNS emulation follows NVMe ZNS spec but the state of namespace zones does not persist accross restarts of QEMU. This patch makes the metadata of ZNS emulation persistent by using new block layer APIs and the qcow2 img as backing file. It is the second part after the patches - adding full zoned

[RFC v3 6/7] hw/nvme: refactor zone append write using block layer APIs

2024-01-22 Thread Sam Li
Signed-off-by: Sam Li --- block/qcow2.c| 2 +- hw/nvme/ctrl.c | 190 --- include/sysemu/dma.h | 3 + system/dma-helpers.c | 17 4 files changed, 162 insertions(+), 50 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index

[RFC v3 1/7] docs/qcow2: add zd_extension_size option to the zoned format feature

2024-01-22 Thread Sam Li
The NVMe ZNS command set has the zone descriptor extension feature for associating the data to a zone. Devices that supports ZAC/ZBC have zero zone descriptor extension size. Signed-off-by: Sam Li --- docs/interop/qcow2.txt | 9 + 1 file changed, 9 insertions(+) diff --git

[RFC v3 4/7] hw/nvme: add blk_get_zone_extension to access zd_extensions

2024-01-22 Thread Sam Li
Signed-off-by: Sam Li --- block/block-backend.c | 16 hw/nvme/ctrl.c| 20 ++-- hw/nvme/ns.c | 24 hw/nvme/nvme.h| 7 --- include/sysemu/block-backend-io.h | 2

[PATCH v7 2/4] qcow2: add configurations for zoned format extension

2024-01-22 Thread Sam Li
To configure the zoned format feature on the qcow2 driver, it requires settings as: the device size, zone model, zone size, zone capacity, number of conventional zones, limits on zone resources (max append bytes, max open zones, and max_active_zones). To create a qcow2 image with zoned format

[PATCH v7 4/4] iotests: test the zoned format feature for qcow2 file

2024-01-22 Thread Sam Li
The zoned format feature can be tested by: $ tests/qemu-iotests/check -qcow2 zoned-qcow2 Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- tests/qemu-iotests/tests/zoned-qcow2 | 147 +++ tests/qemu-iotests/tests/zoned-qcow2.out | 172 +++ 2 files

[PATCH v7 3/4] qcow2: add zoned emulation capability

2024-01-22 Thread Sam Li
By adding zone operations and zoned metadata, the zoned emulation capability enables full emulation support of zoned device using a qcow2 file. The zoned device metadata includes zone type, zoned device state and write pointer of each zone, which is stored to an array of unsigned integers. Each

[PATCH v7 1/4] docs/qcow2: add the zoned format feature

2024-01-22 Thread Sam Li
Add the specs for the zoned format feature of the qcow2 driver. The qcow2 file then can emulate real zoned devices, either passed through by virtio-blk device or NVMe ZNS drive to the guest given zoned information. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi ---

[PATCH v7 0/4] Add full zoned storage emulation to qcow2 driver

2024-01-22 Thread Sam Li
This patch series add a new extension - zoned format - to the qcow2 driver thereby allowing full zoned storage emulation on the qcow2 img file. Users can attach such a qcow2 file to the guest as a zoned device. Write pointer are preserved in the zoned metadata. It will be recovered after power

Re: [RFC v2 0/7] Add persistence to NVMe ZNS emulation

2024-01-22 Thread Sam Li
Klaus Jensen 于2024年1月10日周三 07:52写道: > > Hi Sam, > > This is awesome. For the hw/nvme parts, > > Acked-by: Klaus Jensen > > I'll give it a proper R-b when you drop the RFC status. Hi Klaus, Sorry for the late response. I will submit a new RFC patch series very soon. Now the zone states should

Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler

2024-01-22 Thread Hanna Czenczek
On 22.01.24 18:41, Hanna Czenczek wrote: On 05.01.24 15:30, Fiona Ebner wrote: Am 05.01.24 um 14:43 schrieb Fiona Ebner: Am 03.01.24 um 14:35 schrieb Paolo Bonzini: On 1/3/24 12:40, Fiona Ebner wrote: I'm happy to report that I cannot reproduce the CPU-usage-spike issue with the patch, but I

Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler

2024-01-22 Thread Hanna Czenczek
On 05.01.24 15:30, Fiona Ebner wrote: Am 05.01.24 um 14:43 schrieb Fiona Ebner: Am 03.01.24 um 14:35 schrieb Paolo Bonzini: On 1/3/24 12:40, Fiona Ebner wrote: I'm happy to report that I cannot reproduce the CPU-usage-spike issue with the patch, but I did run into an assertion failure when

[PATCH] virtio-blk: avoid using ioeventfd state in irqfd conditional

2024-01-22 Thread Stefan Hajnoczi
Requests that complete in an IOThread use irqfd to notify the guest while requests that complete in the main loop thread use the traditional qdev irq code path. The reason for this conditional is that the irq code path requires the BQL: if (s->ioeventfd_started && !s->ioeventfd_disabled) {

Re: [PATCH v2 2/4] Avoid conflicting types for 'copy_file_range'

2024-01-22 Thread Peter Maydell
(Cc'ing the block folks) On Thu, 18 Jan 2024 at 16:03, Manolo de Medici wrote: > > Compilation fails on systems where copy_file_range is already defined as a > stub. What do you mean by "stub" here ? If the system headers define a prototype for the function, I would have expected the meson

[PULL 2/2] block/io: clear BDRV_BLOCK_RECURSE flag after recursing in bdrv_co_block_status

2024-01-22 Thread Stefan Hajnoczi
From: Fiona Ebner 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 happens because the BDRV_BLOCK_RECURSE flag will be

[PULL 1/2] coroutine-ucontext: Save fake stack for pooled coroutine

2024-01-22 Thread Stefan Hajnoczi
From: Akihiko Odaki 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 without fake stack being saved. Signed-off-by:

[PULL 0/2] Block patches

2024-01-22 Thread Stefan Hajnoczi
The following changes since commit 09be34717190c1620f0c6e5c8765b8da354aeb4b: Merge tag 'pull-request-2024-01-19' of https://gitlab.com/thuth/qemu into staging (2024-01-20 17:22:16 +) are available in the Git repository at: https://gitlab.com/stefanha/qemu.git tags/block-pull-request

Re: [PULL 00/14] Block layer patches

2024-01-22 Thread Peter Maydell
On Mon, 22 Jan 2024 at 11:15, Kevin Wolf wrote: > > Am 20.01.2024 um 18:21 hat Peter Maydell geschrieben: > > Got some compile failures on this one; looks like the compiler > > on our s390 box didn't like this: > > > > https://gitlab.com/qemu-project/qemu/-/jobs/5973441293 > >

[PULL v2 00/14] Block layer patches

2024-01-22 Thread Kevin Wolf
The following changes since commit 3f2a357b95845ea0bf7463eff6661e43b97d1afc: Merge tag 'hw-cpus-20240119' of https://github.com/philmd/qemu into staging (2024-01-19 11:39:38 +) are available in the Git repository at: https://repo.or.cz/qemu/kevin.git tags/for-upstream for you to fetch

Re: [PULL 00/14] Block layer patches

2024-01-22 Thread Kevin Wolf
Am 20.01.2024 um 18:21 hat Peter Maydell geschrieben: > On Fri, 19 Jan 2024 at 18:15, Kevin Wolf wrote: > > > > The following changes since commit 3f2a357b95845ea0bf7463eff6661e43b97d1afc: > > > > Merge tag 'hw-cpus-20240119' of https://github.com/philmd/qemu into > > staging (2024-01-19

Re: Re: [PATCH v2 0/3] hw/pflash: implement update buffer for block writes

2024-01-22 Thread Gerd Hoffmann
On Sat, Jan 20, 2024 at 01:18:14PM +0300, Michael Tokarev wrote: > 08.01.2024 19:08, Gerd Hoffmann: > > When running qemu with edk2 efi firmware on aarch64 the efi > > variable store in pflash can get corrupted. qemu not doing > > proper block writes -- flush all or nothing to storage -- is > > a