Re: [PATCH] pflash: fix sectors vs bytes confusion in blk_pread_nonzeroes()

2024-02-08 Thread Michael Tokarev
09.02.2024 00:21, Stefan Hajnoczi wrote: On Thu, 1 Feb 2024 at 06:37, Michael Tokarev wrote: for (;;) { -bytes = MIN(size - offset, BDRV_REQUEST_MAX_SECTORS); +bytes = MIN(size - offset, BDRV_REQUEST_MAX_BYTES); Hmm. This smells like a -stable material, but you know

Re: [PATCH v3 06/11] hw/misc/macio: Realize IDE controller before accessing it

2024-02-08 Thread Philippe Mathieu-Daudé
On 8/2/24 19:33, BALATON Zoltan wrote: On Thu, 8 Feb 2024, Philippe Mathieu-Daudé wrote: We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/macio/macio.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git

Re: [PATCH] pflash: fix sectors vs bytes confusion in blk_pread_nonzeroes()

2024-02-08 Thread Stefan Hajnoczi
On Thu, 1 Feb 2024 at 06:37, Michael Tokarev wrote: > > 30.01.2024 03:27, Stefan Hajnoczi wrote: > > The following expression is incorrect because blk_pread_nonzeroes() > > deals in units of bytes, not sectors: > > > >bytes = MIN(size - offset, BDRV_REQUEST_MAX_SECTORS) > >

Re: [PATCH 0/2] block: Allow concurrent BB context changes

2024-02-08 Thread Stefan Hajnoczi
On Wed, 7 Feb 2024 at 04:36, Hanna Czenczek wrote: > > On 06.02.24 17:53, Stefan Hajnoczi wrote: > > On Fri, Feb 02, 2024 at 03:47:53PM +0100, Hanna Czenczek wrote: > > Hi, > > Without the AioContext lock, a BB's context may kind of change at any > time (unless it has a root node, and I/O

Re: [PATCH] block: allocate aligned write buffer for 'truncate -m full'

2024-02-08 Thread Andrey Drobyshev
On 1/25/24 18:46, Vladimir Sementsov-Ogievskiy wrote: > On 11.12.23 13:55, Andrey Drobyshev wrote: >> In case we're truncating an image opened with O_DIRECT, we might get >> -EINVAL on write with unaligned buffer.  In particular, when running >> iotests/298 with '-nocache' we get: >> >> qemu-io:

Re: [PATCH v3 06/11] hw/misc/macio: Realize IDE controller before accessing it

2024-02-08 Thread BALATON Zoltan
On Thu, 8 Feb 2024, Philippe Mathieu-Daudé wrote: We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/macio/macio.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index

Re: [PATCH v3 04/11] hw/i386/pc_q35: Realize LPC PCI function before accessing it

2024-02-08 Thread BALATON Zoltan
On Thu, 8 Feb 2024, Philippe Mathieu-Daudé wrote: We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc_q35.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 7ca3f465e0..f67e5a55df 100644

[PATCH v3 08/11] hw/sparc/sun4m: Realize DMA controller before accessing it

2024-02-08 Thread Philippe Mathieu-Daudé
We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc/sun4m.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index e782c8ec7a..d52e6a7213 100644 --- a/hw/sparc/sun4m.c +++

[PATCH v3 10/11] hw/sparc/leon3: Initialize GPIO before realizing CPU devices

2024-02-08 Thread Philippe Mathieu-Daudé
Inline cpu_create() in order to call qdev_init_gpio_in_named_with_opaque() before the CPU is realized. Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc/leon3.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index

[PATCH v3 11/11] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices

2024-02-08 Thread Philippe Mathieu-Daudé
Inline cpu_create() in order to call qdev_init_gpio_in_named_with_opaque() before the CPU is realized. Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc64/sparc64.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index

[PATCH v3 09/11] hw/sparc/leon3: Realize GRLIB IRQ controller before accessing it

2024-02-08 Thread Philippe Mathieu-Daudé
We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc/leon3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 2dfb742566..0df5fc949d 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c

[PATCH v3 02/11] hw/rx/rx62n: Reduce inclusion of 'qemu/units.h'

2024-02-08 Thread Philippe Mathieu-Daudé
"qemu/units.h" is not used in the "hw/rx/rx62n.h" header, include it in the source where it is. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/rx/rx62n.h | 1 - hw/rx/rx-gdbsim.c | 1 + hw/rx/rx62n.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v3 04/11] hw/i386/pc_q35: Realize LPC PCI function before accessing it

2024-02-08 Thread Philippe Mathieu-Daudé
We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc_q35.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 7ca3f465e0..f67e5a55df 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@

[PATCH v3 06/11] hw/misc/macio: Realize IDE controller before accessing it

2024-02-08 Thread Philippe Mathieu-Daudé
We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/macio/macio.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index c9f22f8515..db662a2065 100644 --- a/hw/misc/macio/macio.c

[PATCH v3 07/11] hw/sh4/r2d: Realize IDE controller before accessing it

2024-02-08 Thread Philippe Mathieu-Daudé
We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/sh4/r2d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index e9f316a6ce..c73e8f49b8 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -285,9 +285,9 @@

[PATCH v3 05/11] hw/ppc/prep: Realize ISA bridge before accessing it

2024-02-08 Thread Philippe Mathieu-Daudé
We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/prep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 1a6cd05c61..4eb5477069 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -278,9 +278,9 @@

[PATCH v3 03/11] hw/rx/rx62n: Only call qdev_get_gpio_in() when necessary

2024-02-08 Thread Philippe Mathieu-Daudé
Instead of filling an array of all the possible IRQs, only call qdev_get_gpio_in() when an IRQ is used. Remove the array from RX62NState. Doing so we avoid calling qdev_get_gpio_in() on an unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/rx/rx62n.h | 1 - hw/rx/rx62n.c

[PATCH v3 00/11] hw: Strengthen SysBus & QBus API

2024-02-08 Thread Philippe Mathieu-Daudé
Hi, This series ensure following is called *before* a device is realized: - qbus_new() - sysbus_init_mmio() - qdev_init_gpio_in_named_with_opaque() and these are called *after* it is: - sysbus_mmio_map() - sysbus_connect_irq(), - qdev_connect_gpio_out() - qdev_connect_gpio_out_named() Patches

[PATCH v3 01/11] hw/ide/ich9: Use AHCIPCIState typedef

2024-02-08 Thread Philippe Mathieu-Daudé
QEMU coding style recommend using structure typedefs: https://www.qemu.org/docs/master/devel/style.html#typedefs Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/ich.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ide/ich.c b/hw/ide/ich.c index

Re: [PATCH] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-02-08 Thread Eugenio Perez Martin
On Wed, Feb 7, 2024 at 11:18 AM Kevin Wolf wrote: > > Am 06.02.2024 um 17:44 hat Eugenio Perez Martin geschrieben: > > On Mon, Feb 5, 2024 at 2:49 PM Kevin Wolf wrote: > > > > > > Am 05.02.2024 um 13:22 hat Eugenio Perez Martin geschrieben: > > > > On Fri, Feb 2, 2024 at 2:25 PM Kevin Wolf

Re: [PATCH] iothread: Simplify expression in qemu_in_iothread()

2024-02-08 Thread Philippe Mathieu-Daudé
On 8/2/24 15:28, Peter Maydell wrote: On Thu, 8 Feb 2024 at 14:22, Kevin Wolf wrote: Am 08.02.2024 um 11:48 hat Philippe Mathieu-Daudé geschrieben: BTW using the same pattern: -- >8 -- diff --git a/hw/nvram/xlnx-zynqmp-efuse.c b/hw/nvram/xlnx-zynqmp-efuse.c index ec98456e5d..d074762a25

Re: [PATCH] iothread: Simplify expression in qemu_in_iothread()

2024-02-08 Thread Peter Maydell
On Thu, 8 Feb 2024 at 14:22, Kevin Wolf wrote: > > Am 08.02.2024 um 11:48 hat Philippe Mathieu-Daudé geschrieben: > > BTW using the same pattern: > > > > -- >8 -- > > diff --git a/hw/nvram/xlnx-zynqmp-efuse.c b/hw/nvram/xlnx-zynqmp-efuse.c > > index ec98456e5d..d074762a25 100644 > > ---

Re: [PATCH] iothread: Simplify expression in qemu_in_iothread()

2024-02-08 Thread Kevin Wolf
Am 08.02.2024 um 11:48 hat Philippe Mathieu-Daudé geschrieben: > On 8/2/24 11:16, Kevin Wolf wrote: > > 'a == b ? false : true' is a rather convoluted way of writing 'a != b'. > > Use the more obvious way to write it. > > > > Signed-off-by: Kevin Wolf > > --- > > iothread.c | 3 +-- > > 1

Re: [PATCH] hw/nvme: fix invalid check on mcl

2024-02-08 Thread Klaus Jensen
On Feb 8 21:33, Minwoo Im wrote: > On 24-02-08 13:22:48, Klaus Jensen wrote: > > From: Klaus Jensen > > > > The number of logical blocks within a source range is converted into a > > 1s based number at the time of parsing. However, when verifying the copy > > length we add one again, causing

Re: [PATCH] hw/nvme: fix invalid check on mcl

2024-02-08 Thread Minwoo Im
nvme_copy_source_range_parse(iocb->ranges, idx, iocb->format, NULL, > , NULL, NULL, NULL); > -copy_len += nlb + 1; > +copy_len += nlb; > } > > if (copy_len > ns->id_ns.mcl) { > > --- > base-commit: 39a6e4f87e7b75a45b08d6dc8b8b7c2954c87440 > change-id: 20240208-fix-copy-mcl-check-3a6d95327154 > > Best regards, > -- > Klaus Jensen > >

[PATCH] hw/nvme: fix invalid check on mcl

2024-02-08 Thread Klaus Jensen
> ns->id_ns.mcl) { --- base-commit: 39a6e4f87e7b75a45b08d6dc8b8b7c2954c87440 change-id: 20240208-fix-copy-mcl-check-3a6d95327154 Best regards, -- Klaus Jensen

Re: [PATCH] iothread: Simplify expression in qemu_in_iothread()

2024-02-08 Thread Philippe Mathieu-Daudé
On 8/2/24 11:16, Kevin Wolf wrote: 'a == b ? false : true' is a rather convoluted way of writing 'a != b'. Use the more obvious way to write it. Signed-off-by: Kevin Wolf --- iothread.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iothread.c b/iothread.c index

Re: [PATCH] iothread: Simplify expression in qemu_in_iothread()

2024-02-08 Thread Laurent Vivier
Le 08/02/2024 à 11:16, Kevin Wolf a écrit : 'a == b ? false : true' is a rather convoluted way of writing 'a != b'. Use the more obvious way to write it. Signed-off-by: Kevin Wolf --- iothread.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iothread.c b/iothread.c

[PATCH] iothread: Simplify expression in qemu_in_iothread()

2024-02-08 Thread Kevin Wolf
'a == b ? false : true' is a rather convoluted way of writing 'a != b'. Use the more obvious way to write it. Signed-off-by: Kevin Wolf --- iothread.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iothread.c b/iothread.c index 6c1fc8c856..e1e9e04736 100644 ---

Re: [PULL 1/1] virtio-blk: avoid using ioeventfd state in irqfd conditional

2024-02-08 Thread Michael Tokarev
08.02.2024 11:42, Kevin Wolf wrote: The patch email itself was CCed to qemu-stable and even contained a note for backporting to stable: https://lists.gnu.org/archive/html/qemu-block/2024-01/msg00278.html Ahh. Yes. I'm having a large(ish) queue in stable and missed the fact I already has

Re: [PULL 1/1] virtio-blk: avoid using ioeventfd state in irqfd conditional

2024-02-08 Thread Kevin Wolf
Am 08.02.2024 um 06:37 hat Michael Tokarev geschrieben: > 06.02.2024 18:31, 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