Re: [PATCH v2 07/12] acpi: move aml builder code for rtc device

2020-04-08 Thread Cameron Esfahani via
I'm curious why there's two ranges as well. In our branch of QEMU, I've had to modify this RTC creation code to have only one range instead of two ranges. Traditionally Macs have had one range for RTC and we have incompatibility with a two ranges. If you could change it to one range without

Re: [PATCH v4 13/30] qcow2: Add QCow2SubclusterType and qcow2_get_subcluster_type()

2020-04-08 Thread Alberto Garcia
On Wed 08 Apr 2020 01:23:42 PM CEST, Max Reitz wrote: >> +switch (type) { >> +case QCOW2_CLUSTER_COMPRESSED: >> +return QCOW2_SUBCLUSTER_COMPRESSED; > > Why did you drop the check that l2_bitmap == 0 here? We don't generally check that reserved bits are 0. It would for

Re: [PATCH v4 18/30] qcow2: Add subcluster support to qcow2_get_host_offset()

2020-04-08 Thread Alberto Garcia
On Wed 08 Apr 2020 02:49:14 PM CEST, Max Reitz wrote: > (Oops, totally missed the L1 entry out of bounds / L1 entry empty part > in v3.) Yeah, and you can mix values between different enum types in C quite easily without the compiler producing a warning. Berto

Re: [PATCH v4 02/30] qcow2: Convert qcow2_get_cluster_offset() into qcow2_get_host_offset()

2020-04-08 Thread Alberto Garcia
On Wed 08 Apr 2020 12:51:24 PM CEST, Max Reitz wrote: >> -if (has_data_file(bs) && *cluster_offset != offset - >> offset_in_cluster) >> +if (has_data_file(bs) && *host_offset != offset - offset_in_cluster) >> { > > (1) The { should be moved to the preceding line; > > (2)

Re: [PATCH v6 32/42] nvme: allow multiple aios per command

2020-04-08 Thread Klaus Birkelund Jensen
On Mar 31 12:10, Maxim Levitsky wrote: > On Tue, 2020-03-31 at 07:47 +0200, Klaus Birkelund Jensen wrote: > > On Mar 25 12:57, Maxim Levitsky wrote: > > > On Mon, 2020-03-16 at 07:29 -0700, Klaus Jensen wrote: > > > > @@ -516,10 +613,10 @@ static inline uint16_t nvme_check_prinfo(NvmeCtrl > > > >

Re: [PATCH v2 07/12] acpi: move aml builder code for rtc device

2020-04-08 Thread Gerd Hoffmann
Hi, > > > > > > +crs = aml_resource_template(); > > > > > > +aml_append(crs, aml_io(AML_DECODE16, 0x0070, 0x0070, 0x10, > > > > > > 0x02)); > maybe replace magic 0x0070 with macro > RTC_BASE_ADDR Yes, that sounds better. > > > > > > +aml_append(crs, aml_irq_no_flags(8)); > > >

Re: [PATCH v4 18/30] qcow2: Add subcluster support to qcow2_get_host_offset()

2020-04-08 Thread Max Reitz
On 17.03.20 19:16, Alberto Garcia wrote: > The logic of this function remains pretty much the same, except that > it uses count_contiguous_subclusters(), which combines the logic of > count_contiguous_clusters() / count_contiguous_clusters_unallocated() > and checks individual subclusters. > >

Re: [PATCH v4 15/30] qcow2: Replace QCOW2_CLUSTER_* with QCOW2_SUBCLUSTER_*

2020-04-08 Thread Max Reitz
On 17.03.20 19:16, Alberto Garcia wrote: > In order to support extended L2 entries some functions of the qcow2 > driver need to start dealing with subclusters instead of clusters. > > qcow2_get_host_offset() is modified to return the subcluster type > instead of the cluster type, and all callers

Re: [PATCH v4 14/30] qcow2: Add cluster type parameter to qcow2_get_host_offset()

2020-04-08 Thread Max Reitz
On 17.03.20 19:16, Alberto Garcia wrote: > This function returns an integer that can be either an error code or a > cluster type (a value from the QCow2ClusterType enum). > > We are going to start using subcluster types instead of cluster types > in some functions so it's better to use the exact

Re: [PATCH for-5.0] aio-posix: signal-proof fdmon-io_uring

2020-04-08 Thread Philippe Mathieu-Daudé
On 4/8/20 11:11 AM, Stefan Hajnoczi wrote: The io_uring_enter(2) syscall returns with errno=EINTR when interrupted by a signal. Retry the syscall in this case. It's essential to do this in the io_uring_submit_and_wait() case. My interpretation of the Linux v5.5 io_uring_enter(2) code is that

Re: [PATCH v6 14/42] nvme: add missing mandatory features

2020-04-08 Thread Klaus Birkelund Jensen
On Mar 31 12:39, Maxim Levitsky wrote: > On Tue, 2020-03-31 at 07:41 +0200, Klaus Birkelund Jensen wrote: > > On Mar 25 12:41, Maxim Levitsky wrote: > > > BTW the user of the device doesn't have to have 1:1 mapping between qid > > > and msi interrupt index, > > > in fact when MSI is not used, all

Re: [PATCH v2 07/12] acpi: move aml builder code for rtc device

2020-04-08 Thread Igor Mammedov
On Tue, 7 Apr 2020 12:26:58 +0200 Gerd Hoffmann wrote: > On Mon, Apr 06, 2020 at 02:17:05PM +0200, Igor Mammedov wrote: > > On Mon, 6 Apr 2020 10:25:17 +0200 > > Gerd Hoffmann wrote: > > > > > On Fri, Apr 03, 2020 at 12:09:21PM +0200, Igor Mammedov wrote: > > > > On Fri, 3 Apr 2020

Re: [PATCH v4 13/30] qcow2: Add QCow2SubclusterType and qcow2_get_subcluster_type()

2020-04-08 Thread Max Reitz
On 17.03.20 19:16, Alberto Garcia wrote: > This patch adds QCow2SubclusterType, which is the subcluster-level > version of QCow2ClusterType. All QCOW2_SUBCLUSTER_* values have the > the same meaning as their QCOW2_CLUSTER_* equivalents (when they > exist). See below for details and caveats. > >

Re: [PATCH v4 09/30] qcow2: Add subcluster-related fields to BDRVQcow2State

2020-04-08 Thread Max Reitz
On 17.03.20 19:16, Alberto Garcia wrote: > This patch adds the following new fields to BDRVQcow2State: > > - subclusters_per_cluster: Number of subclusters in a cluster > - subcluster_size: The size of each subcluster, in bytes > - subcluster_bits: No. of bits so 1 << subcluster_bits =

Re: [PATCH v4 07/30] qcow2: Document the Extended L2 Entries feature

2020-04-08 Thread Max Reitz
On 17.03.20 19:16, Alberto Garcia wrote: > Subcluster allocation in qcow2 is implemented by extending the > existing L2 table entries and adding additional information to > indicate the allocation status of each subcluster. > > This patch documents the changes to the qcow2 format and how they >

Re: [PATCH v4 02/30] qcow2: Convert qcow2_get_cluster_offset() into qcow2_get_host_offset()

2020-04-08 Thread Max Reitz
On 17.03.20 19:15, Alberto Garcia wrote: > qcow2_get_cluster_offset() takes an (unaligned) guest offset and > returns the (aligned) offset of the corresponding cluster in the qcow2 > image. > > In practice none of the callers need to know where the cluster starts > so this patch makes the

Re: hotplug issue of vhost-user-blk

2020-04-08 Thread Igor Mammedov
On Wed, 8 Apr 2020 10:25:42 +0800 Li Feng wrote: > Hi all, > > Hotplug of vhost-user-blk doesn't not work in qemu master branch and > all previous version. > > The action I insert a vhost-user-blk disk is: > (qemu) chardev-add socket,id=spdk_vhost_blk2,path=/vhost-blk.0,reconnect=1 > (qemu)

Re: [PATCH for-5.0? 0/9] block/io: safer inc/dec in_flight sections

2020-04-08 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200408093051.9893-1-vsement...@virtuozzo.com/ Hi, This series failed the docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT

Re: [PATCH v4 01/30] qcow2: Make Qcow2AioTask store the full host offset

2020-04-08 Thread Max Reitz
On 17.03.20 19:15, Alberto Garcia wrote: > The file_cluster_offset field of Qcow2AioTask stores a cluster-aligned > host offset. In practice this is not very useful because all users(*) > of this structure need the final host offset into the cluster, which > they calculate using > >

Re: [PATCH for-5.0? 0/9] block/io: safer inc/dec in_flight sections

2020-04-08 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200408093051.9893-1-vsement...@virtuozzo.com/ Hi, This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT

Re: [PATCH for-5.0? 0/9] block/io: safer inc/dec in_flight sections

2020-04-08 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200408093051.9893-1-vsement...@virtuozzo.com/ Hi, This series failed the asan build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN ===

Re: [PATCH for-5.0] aio-posix: signal-proof fdmon-io_uring

2020-04-08 Thread Stefano Garzarella
On Wed, Apr 08, 2020 at 10:11:39AM +0100, Stefan Hajnoczi wrote: > The io_uring_enter(2) syscall returns with errno=EINTR when interrupted > by a signal. Retry the syscall in this case. > > It's essential to do this in the io_uring_submit_and_wait() case. My > interpretation of the Linux v5.5

[PATCH 5/9] block/io: expand in_flight inc/dec section: simple cases

2020-04-08 Thread Vladimir Sementsov-Ogievskiy
It's safer to expand in_flight request to start before enter to coroutine in synchronous wrappers and end after BDRV_POLL_WHILE loop. Note that qemu_coroutine_enter may only schedule the coroutine in some circumstances. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 155

[PATCH 8/9] block/io: move bdrv_make_zero under block-status

2020-04-08 Thread Vladimir Sementsov-Ogievskiy
We are going to use bdrv_co_block_status in bdrv_make_zero, so move it now down. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 82 +++--- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/block/io.c b/block/io.c index

[PATCH 1/9] block/io: refactor bdrv_is_allocated_above to run only one coroutine

2020-04-08 Thread Vladimir Sementsov-Ogievskiy
bdrv_is_allocated_above creates new coroutine on each iteration if called from non-coroutine context. To simplify expansion of in_flight inc/dec sections in further patch let's refactor it. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 77

[PATCH 2/9] block/io: refactor bdrv_co_ioctl: move aio stuff to corresponding block

2020-04-08 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/block/io.c b/block/io.c index a9f1a3e93e..29e53271b6 100644 --- a/block/io.c +++ b/block/io.c @@ -3126,31 +3126,38 @@ int

[PATCH 7/9] block/io: add bdrv_do_pwrite_zeroes

2020-04-08 Thread Vladimir Sementsov-Ogievskiy
We'll need a bdrv_co_pwrite_zeroes version without inc/dec in_flight to be used in further implementation of bdrv_make_zero. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/block/io.c

[PATCH 9/9] block/io: expand in_flight inc/dec section: bdrv_make_zero

2020-04-08 Thread Vladimir Sementsov-Ogievskiy
It's safer to expand in_flight request to start before enter to coroutine in synchronous wrappers and end after BDRV_POLL_WHILE loop. Note that qemu_coroutine_enter may only schedule the coroutine in some circumstances. bdrv_make_zero update includes refactoring: move the whole loop into

[PATCH 3/9] block/io: move flush and pdiscard stuff down

2020-04-08 Thread Vladimir Sementsov-Ogievskiy
bdrv_co_flush and bdrv_co_pdiscard will become static in further patch, move their usage down. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 56 +++--- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/block/io.c

[PATCH 4/9] block/io: move bdrv_rw_co_entry and friends down

2020-04-08 Thread Vladimir Sementsov-Ogievskiy
We are going to use bdrv_co_pwritev_part and bdrv_co_preadv_part in bdrv_rw_co_entry, so move it down. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 361 +++-- 1 file changed, 181 insertions(+), 180 deletions(-) diff --git

[PATCH for-5.0? 0/9] block/io: safer inc/dec in_flight sections

2020-04-08 Thread Vladimir Sementsov-Ogievskiy
Hi all! This is inspired by Kevin's "block: Fix blk->in_flight during blk_wait_while_drained()" series. So, like it's now done for block-backends, let's expand in_flight-protected sections for bdrv_ interfaces, including coroutine_enter and BDRV_POLL_WHILE loop into these sections. Vladimir

[PATCH 6/9] block/io: expand in_flight inc/dec section: block-status

2020-04-08 Thread Vladimir Sementsov-Ogievskiy
It's safer to expand in_flight request to start before enter to coroutine in synchronous wrappers and end after BDRV_POLL_WHILE loop. Note that qemu_coroutine_enter may only schedule the coroutine in some circumstances. block-status requests are complex, they involve querying different block

[PATCH for-5.0] aio-posix: signal-proof fdmon-io_uring

2020-04-08 Thread Stefan Hajnoczi
The io_uring_enter(2) syscall returns with errno=EINTR when interrupted by a signal. Retry the syscall in this case. It's essential to do this in the io_uring_submit_and_wait() case. My interpretation of the Linux v5.5 io_uring_enter(2) code is that it shouldn't affect the io_uring_submit()

Re: [PATCH RESEND v4] nvme: introduce PMR support from NVMe 1.4 spec

2020-04-08 Thread Kevin Wolf
Am 30.03.2020 um 18:55 hat Keith Busch geschrieben: > On Mon, Mar 30, 2020 at 09:46:56AM -0700, Andrzej Jakowski wrote: > > This patch introduces support for PMR that has been defined as part of NVMe > > 1.4 > > spec. User can now specify a pmrdev option that should point to > >

Re: [PATCH] When updating the PFLASH file contents, we should check for a possible failure of blk_pwrite(). Similar to 3a68829 commit

2020-04-08 Thread Philippe Mathieu-Daudé
Hi Mansour, On 4/8/20 2:35 AM, Mansour Ahmadi wrote: Signed-off-by: Mansour Ahmadi --- hw/block/pflash_cfi01.c | 6 +- hw/block/pflash_cfi02.c | 6 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c index