Re: [PULL 0/9] scripts/simplebench patches

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
Hi! Kindly ping, or what's wrong with it? 04.05.2021 12:01, Vladimir Sementsov-Ogievskiy wrote: The following changes since commit 53c5433e84e8935abed8e91d4a2eb813168a0ecf: Merge remote-tracking branch 'remotes/rth-gitlab/tags/pull-tcg-20210501' into staging (2021-05-02 12:02:46 +0100)

[PATCH v2 6/6] hw/southbridge/vt82c686: Introduce VT82C686B_SOUTHBRIDGE

2021-05-10 Thread Philippe Mathieu-Daudé
The VT82C686B south bridge is a single chipset. Model it as a single sysbus device. Move the vt82c686b_southbridge_init as via_southbridge_realize, add the QOM state: ViaSouthBridgeState. This device needs 2 properties to be realized: the PCI bus and its slot number. 2 aliases are exposed: the ISA

[PATCH v2 5/6] hw/ide/via: Connect IDE function output IRQs to the ISA function input

2021-05-10 Thread Philippe Mathieu-Daudé
To avoid abusing isa_get_irq(NULL) using a hidden ISA bridge under the hood, let the IDE function expose 2 output IRQs, and connect them to the ISA function inputs when creating the south bridge chipset model in vt82c686b_southbridge_init. Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/via.c

[PATCH v2 3/6] hw/isa/vt82c686: Let ISA function expose ISA IRQs

2021-05-10 Thread Philippe Mathieu-Daudé
The 2 cascaded 8259 PIC are managed by the PCI function #0 (ISA bridge). Expose the 16 IRQs on this function, so other functions from the same chipset can access them. Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/vt82c686.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-)

[PATCH v2 1/6] hw/isa/vt82c686: Name output IRQ as 'intr'

2021-05-10 Thread Philippe Mathieu-Daudé
Named IRQs are easier to understand in the monitor. Name the single output interrupt as 'intr'. Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/vt82c686.c | 2 +- hw/mips/fuloong2e.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c

[PATCH v2 2/6] hw/isa/vt82c686: Simplify removing unuseful qemu_allocate_irqs() call

2021-05-10 Thread Philippe Mathieu-Daudé
Instead of creating an input IRQ with qemu_allocate_irqs() to pass it as output IRQ of the PIC, with its handler simply dispatching into the "intr" output IRQ, simplify by directly connecting the PIC to the "intr" named output. Fixes: 3dc31cb8490 ("vt82c686: Move creation of ISA devices to the

[PATCH v2 0/6] hw/southbridge: QOM'ify vt82c686 as VT82C686B_SOUTHBRIDGE

2021-05-10 Thread Philippe Mathieu-Daudé
The motivation behind this series is to remove the isa_get_irq(NULL) call to simplify the ISA generic model. Since v1: - rebased on top of remotes/dg-gitlab/tags/ppc-for-6.1-20210504 Philippe Mathieu-Daudé (6): hw/isa/vt82c686: Name output IRQ as 'intr' hw/isa/vt82c686: Simplify removing

[PATCH v2 4/6] hw/ide/via: Replace magic 2 value by ARRAY_SIZE / MAX_IDE_DEVS

2021-05-10 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/via.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/ide/via.c b/hw/ide/via.c index be09912b334..6c667a92130 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -90,7 +90,7 @@ static void

Re: [PATCH v2 0/8] hw/block/fdc: Allow Kconfig-selecting ISA bus/SysBus floppy controllers

2021-05-10 Thread Philippe Mathieu-Daudé
Hi John, This series is fully reviewed; can it go via your block tree? On 4/28/21 2:50 PM, Philippe Mathieu-Daudé wrote: > Hi, > > The floppy disc controllers pulls in irrelevant devices (sysbus in > an ISA-only machine, ISA bus + isa devices on a sysbus-only machine). > > This series clean

[PATCH v3 2/2] virtio-blk: Convert QEMUBH callback to "bitops.h" API

2021-05-10 Thread Philippe Mathieu-Daudé
By directly using find_first_bit() and find_next_bit from the "bitops.h" API to iterate over the bitmap, we can remove the bitmap[] variable-length array copy on the stack and the complex manual bit testing/clearing logic. Suggested-by: Stefan Hajnoczi Suggested-by: Richard Henderson

[PATCH v3 0/2] virtio-blk: Convert QEMUBH callback to "bitops.h" API

2021-05-10 Thread Philippe Mathieu-Daudé
This series follow a suggestion from Stefan to use the bitops API in virtio-blk: https://www.mail-archive.com/qemu-devel@nongnu.org/msg805139.html Since v2: - clear bitmap to avoid spurious interrupts! (Stefan) - use 'further' in find_next docstring (Eric) - added Richard R-b tag Since v1: -

[PATCH v3 1/2] bitops.h: Improve find_xxx_bit() documentation

2021-05-10 Thread Philippe Mathieu-Daudé
Document the following functions return the bitmap size if no matching bit is found: - find_first_bit - find_next_bit - find_last_bit - find_first_zero_bit - find_next_zero_bit Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/bitops.h | 15 ---

[PATCH v2] qemu-iotests: fix pylint 2.8 consider-using-with error

2021-05-10 Thread Emanuele Giuseppe Esposito
pylint 2.8 introduces consider-using-with error, suggesting to use the 'with' block statement when possible. Modify all subprocess.Popen call to use the 'with' statement, except the one in __init__ of QemuIoInteractive class, since it is assigned to a class field and used in other methods.

Re: [PATCH 4/6] progressmeter: protect with a mutex

2021-05-10 Thread Emanuele Giuseppe Esposito
We don't have caller that pass only one pointer. So we can just do *current = pm->current; *total = pm->total; implicitly requiring both pointers to be non NULL. Is it so performance critical that we need to skip these safety checks? IMHO we can keep it as it is. Not performance. It's

Re: [PATCH 4/6] progressmeter: protect with a mutex

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
10.05.2021 19:52, Emanuele Giuseppe Esposito wrote: On 10/05/2021 13:28, Vladimir Sementsov-Ogievskiy wrote: 10.05.2021 11:59, Emanuele Giuseppe Esposito wrote: Progressmeter is protected by the AioContext mutex, which is taken by the block jobs and their caller (like blockdev). We would

Re: [PATCH 4/6] progressmeter: protect with a mutex

2021-05-10 Thread Emanuele Giuseppe Esposito
On 10/05/2021 13:28, Vladimir Sementsov-Ogievskiy wrote: 10.05.2021 11:59, Emanuele Giuseppe Esposito wrote: Progressmeter is protected by the AioContext mutex, which is taken by the block jobs and their caller (like blockdev). We would like to remove the dependency of block layer code on

Re: [PATCH v2 4/5] block: simplify bdrv_child_user_desc()

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
10.05.2021 18:33, Alberto Garcia wrote: On Tue 04 May 2021 11:45:09 AM CEST, Vladimir Sementsov-Ogievskiy wrote: All existing parent types (block nodes, block devices, jobs) has the realization. So, drop unreachable code. s/has/have/ , and I'm not sure what "have the realization" means

Re: [PATCH v2 02/10] qcow2: compressed read: simplify cluster descriptor passing

2021-05-10 Thread Alberto Garcia
On Wed 05 May 2021 08:59:47 AM CEST, Vladimir Sementsov-Ogievskiy wrote: > Let's pass the whole L2 entry and not bother with > L2E_COMPRESSED_OFFSET_SIZE_MASK. > > It also helps further refactoring that adds generic > qcow2_parse_compressed_l2_entry() helper. > > Signed-off-by: Vladimir

Re: [PATCH v2 4/5] block: simplify bdrv_child_user_desc()

2021-05-10 Thread Alberto Garcia
On Tue 04 May 2021 11:45:09 AM CEST, Vladimir Sementsov-Ogievskiy wrote: > All existing parent types (block nodes, block devices, jobs) has the > realization. So, drop unreachable code. s/has/have/ , and I'm not sure what "have the realization" means > static char

Re: [PATCH v2 3/5] block: improve bdrv_child_get_parent_desc()

2021-05-10 Thread Alberto Garcia
On Tue 04 May 2021 11:45:08 AM CEST, Vladimir Sementsov-Ogievskiy wrote: > We have different types of parents: block nodes, block backends and > jobs. So, it makes sense to specify type together with name. > > Next, this handler us used to compose an error message about permission > conflict.

Re: [PATCH v2 2/2] virtio-blk: Convert QEMUBH callback to "bitops.h" API

2021-05-10 Thread Philippe Mathieu-Daudé
On 5/10/21 3:25 PM, Stefan Hajnoczi wrote: > On Fri, May 07, 2021 at 07:06:34PM +0200, Philippe Mathieu-Daudé wrote: >> By directly using find_first_bit() and find_next_bit from the >> "bitops.h" API to iterate over the bitmap, we can remove the >> bitmap[] variable-length array copy on the stack

Re: [PATCH v2 2/2] virtio-blk: Convert QEMUBH callback to "bitops.h" API

2021-05-10 Thread Stefan Hajnoczi
On Fri, May 07, 2021 at 07:06:34PM +0200, Philippe Mathieu-Daudé wrote: > By directly using find_first_bit() and find_next_bit from the > "bitops.h" API to iterate over the bitmap, we can remove the > bitmap[] variable-length array copy on the stack and the complex > manual bit testing/clearing

Re: [PATCH v6 00/12] qcow2: fix parallel rewrite and discard (lockless)

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
Hi! Kevin, what do think on this now? Do you think "[PATCH v4 0/3] qcow2: fix parallel rewrite and discard (rw-lock)" still worth to update to cover reads and resend? (consider also my replies to "[PATCH v4 0/3] qcow2: fix parallel rewrite and discard (rw-lock)" branch) 22.04.2021 19:30,

Re: [PATCH 6/6] aiopool: protect with a mutex

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
10.05.2021 11:59, Emanuele Giuseppe Esposito wrote: Divide the fields in AioTaskPool in IN and Status, and introduce a CoQueue instead of .wait to take care of suspending and resuming the calling coroutine, and a lock to protect the busy_tasks counter accesses and the AioTask .ret field. "and"

Re: [PATCH 5/6] co-shared-resource: protect with a mutex

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
10.05.2021 11:59, Emanuele Giuseppe Esposito wrote: co-shared-resource is currently not thread-safe, as also reported in co-shared-resource.h. Add a QemuMutex because co_try_get_from_shres can also be invoked from non-coroutine context. But it doesn't. It's called only from

Re: [PATCH 4/6] progressmeter: protect with a mutex

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
10.05.2021 11:59, Emanuele Giuseppe Esposito wrote: Progressmeter is protected by the AioContext mutex, which is taken by the block jobs and their caller (like blockdev). We would like to remove the dependency of block layer code on the AioContext mutex, since most drivers and the core I/O code

Re: [PATCH 3/6] blockjob: let ratelimit handle a speed of 0

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
10.05.2021 11:59, Emanuele Giuseppe Esposito wrote: From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- blockjob.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/blockjob.c b/blockjob.c index

Re: [PATCH 2/6] block-copy: let ratelimit handle a speed of 0

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
10.05.2021 11:59, Emanuele Giuseppe Esposito wrote: From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- block/block-copy.c | 28 ++-- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/block/block-copy.c

Re: [PATCH 1/6] ratelimit: treat zero speed as unlimited

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
10.05.2021 11:59, Emanuele Giuseppe Esposito wrote: From: Paolo Bonzini Both users of RateLimit, block-copy.c and blockjob.c, treat a speed of zero as unlimited, while RateLimit treats it as "as slow as possible". The latter is nicer from the code point of view but pretty useless, so disable

Re: [PATCH 0/6] block-copy: make helper APIs thread safe

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
10.05.2021 11:59, Emanuele Giuseppe Esposito wrote: This serie of patches bring thread safety to the smaller APIs used by block-copy, namely ratelimit, progressmeter, co-shared-resource and aiotask. The end goal is to reduce the usage of the global AioContexlock in block-copy, by introducing

Re: [PATCH] ratelimit: protect with a mutex

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
13.04.2021 15:55, Paolo Bonzini wrote: Right now, rate limiting is protected by the AioContext mutex, which is taken for example both by the block jobs and by qmp_block_job_set_speed (via find_block_job). We would like to remove the dependency of block layer code on the AioContext mutex, since

Re: [PATCH v3 5/8] block/write-threshold: don't use aio context lock

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
07.05.2021 16:45, Paolo Bonzini wrote: On 06/05/21 11:06, Vladimir Sementsov-Ogievskiy wrote:   void bdrv_write_threshold_check_write(BlockDriverState *bs, int64_t offset,     int64_t bytes)   {   int64_t end = offset + bytes; -    uint64_t wtr =

Re: [PATCH v4 2/6] block: Allow changing bs->file on reopen

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
07.05.2021 17:09, Kevin Wolf wrote: Am 07.05.2021 um 09:11 hat Vladimir Sementsov-Ogievskiy geschrieben: 17.03.2021 20:15, Alberto Garcia wrote: When the x-blockdev-reopen was added it allowed reconfiguring the graph by replacing backing files, but changing the 'file' option was forbidden.

Re: [PATCH 06/23] hw/block/dataplane/virtio-blk: Avoid dynamic stack allocation

2021-05-10 Thread Stefan Hajnoczi
On Thu, May 06, 2021 at 05:19:31PM +0200, Philippe Mathieu-Daudé wrote: > > Can we eliminate bitmap[] entirely by using bitops.h APIs on > > s->batch_notify_vqs instead? > > You meant the bitmap.h API I assume, OK, better idea! I did mean include/qemu/bitops.h. Not sure I see a suitable bitmap.h

[PATCH 6/6] aiopool: protect with a mutex

2021-05-10 Thread Emanuele Giuseppe Esposito
Divide the fields in AioTaskPool in IN and Status, and introduce a CoQueue instead of .wait to take care of suspending and resuming the calling coroutine, and a lock to protect the busy_tasks counter accesses and the AioTask .ret field. Signed-off-by: Emanuele Giuseppe Esposito ---

[PATCH 2/6] block-copy: let ratelimit handle a speed of 0

2021-05-10 Thread Emanuele Giuseppe Esposito
From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- block/block-copy.c | 28 ++-- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/block/block-copy.c b/block/block-copy.c index c2e5090412..7e9467d48a 100644 ---

[PATCH 5/6] co-shared-resource: protect with a mutex

2021-05-10 Thread Emanuele Giuseppe Esposito
co-shared-resource is currently not thread-safe, as also reported in co-shared-resource.h. Add a QemuMutex because co_try_get_from_shres can also be invoked from non-coroutine context. Signed-off-by: Emanuele Giuseppe Esposito --- util/qemu-co-shared-resource.c | 26 ++

[PATCH 3/6] blockjob: let ratelimit handle a speed of 0

2021-05-10 Thread Emanuele Giuseppe Esposito
From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- blockjob.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/blockjob.c b/blockjob.c index dc1d9e0e46..046c1bcd66 100644 --- a/blockjob.c +++ b/blockjob.c @@ -300,10

[PATCH 4/6] progressmeter: protect with a mutex

2021-05-10 Thread Emanuele Giuseppe Esposito
Progressmeter is protected by the AioContext mutex, which is taken by the block jobs and their caller (like blockdev). We would like to remove the dependency of block layer code on the AioContext mutex, since most drivers and the core I/O code are already not relying on it. The simplest thing to

[PATCH 1/6] ratelimit: treat zero speed as unlimited

2021-05-10 Thread Emanuele Giuseppe Esposito
From: Paolo Bonzini Both users of RateLimit, block-copy.c and blockjob.c, treat a speed of zero as unlimited, while RateLimit treats it as "as slow as possible". The latter is nicer from the code point of view but pretty useless, so disable rate limiting if a speed of zero is provided.

[PATCH 0/6] block-copy: make helper APIs thread safe

2021-05-10 Thread Emanuele Giuseppe Esposito
This serie of patches bring thread safety to the smaller APIs used by block-copy, namely ratelimit, progressmeter, co-shared-resource and aiotask. The end goal is to reduce the usage of the global AioContexlock in block-copy, by introducing smaller granularity locks thus on making the block layer

Re: [PATCH] block: Improve backing file validation

2021-05-10 Thread Daniel P . Berrangé
On Mon, May 10, 2021 at 12:30:45PM +0800, Li Zhijian wrote: > Image below user cases: > case 1: > ``` > $ qemu-img create -f raw source.raw 1G > $ qemu-img create -f qcow2 -F raw -b source.raw ./source.raw > qemu-img info source.raw > image: source.raw > file format: qcow2 > virtual size: 193K

Re: [PATCH] qemu-iotests: fix pylint 2.8 consider-using-with error

2021-05-10 Thread Emanuele Giuseppe Esposito
On 07/05/2021 17:39, Max Reitz wrote: On 06.05.21 10:48, Emanuele Giuseppe Esposito wrote: pylint 2.8 introduces consider-using-with error, suggesting to use the 'with' block statement when possible. http://pylint.pycqa.org/en/latest/whatsnew/2.8.html Modify all subprocess.Popen calls to