Failing iotest 206

2021-07-19 Thread Thomas Huth
Hi, iotest 206 fails for me with: $ ./check -qcow2 206 QEMU -- ".../tests/qemu-iotests/../../qemu-system-x86_64" -nodefaults -display none -accel qtest QEMU_IMG -- ".../tests/qemu-iotests/../../qemu-img" QEMU_IO -- ".../tests/qemu-iotests/../../qemu-io" --cache writeback

Re: [PATCH v3 3/5] hw/nvme: fix out-of-bounds reads

2021-07-19 Thread Stefan Hajnoczi
On Wed, Jul 14, 2021 at 08:01:23AM +0200, Klaus Jensen wrote: > From: Klaus Jensen > > Peter noticed that mmio access may read into the NvmeParams member in > the NvmeCtrl struct. > > Fix the bounds check. > > Reported-by: Peter Maydell > Signed-off-by: Klaus Jensen > --- > hw/nvme/ctrl.c |

Re: [PATCH v3 0/5] hw/nvme: fix mmio read

2021-07-19 Thread Stefan Hajnoczi
On Mon, Jul 19, 2021 at 08:43:33AM +0200, Klaus Jensen wrote: > On Jul 14 08:01, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Fix mmio read issues on big-endian hosts. The core issue is that values > > in the BAR is not stored in little endian as required. > > > > Fix that and add a regres

Re: [PATCH v5 3/5] block/nbd: refactor nbd_recv_coroutines_wake_all()

2021-07-19 Thread Vladimir Sementsov-Ogievskiy
17.07.2021 00:25, Eric Blake wrote: On Wed, Jul 14, 2021 at 07:59:14PM +0300, Vladimir Sementsov-Ogievskiy wrote: Split out nbd_recv_coroutine_wake(), as it will be used in separate. s/in separate/separately/ Also add a possibility to wake only first found sleeping coroutine. Signed-off-by:

Re: [PATCH v3 1/5] hw/nvme: split pmrmsc register into upper and lower

2021-07-19 Thread Peter Maydell
On Wed, 14 Jul 2021 at 07:01, Klaus Jensen wrote: > > From: Klaus Jensen > > The specification uses a set of 32 bit PMRMSCL and PMRMSCU registers to > make up the 64 bit logical PMRMSC register. > > Make it so. > > Signed-off-by: Klaus Jensen > --- > include/block/nvme.h | 31 --

Re: [PATCH v3 3/5] hw/nvme: fix out-of-bounds reads

2021-07-19 Thread Peter Maydell
On Wed, 14 Jul 2021 at 07:01, Klaus Jensen wrote: > > From: Klaus Jensen > > Peter noticed that mmio access may read into the NvmeParams member in > the NvmeCtrl struct. > > Fix the bounds check. > > Reported-by: Peter Maydell > Signed-off-by: Klaus Jensen > --- > hw/nvme/ctrl.c | 27 +

Re: [RFC PATCH 0/6] job: replace AioContext lock with job_mutex

2021-07-19 Thread Stefan Hajnoczi
On Fri, Jul 16, 2021 at 05:23:50PM +0200, Kevin Wolf wrote: > Am 13.07.2021 um 15:10 hat Stefan Hajnoczi geschrieben: > > AIO_WAIT_WHILE() requires that AioContext is acquired according to its > > documentation, but I'm not sure that's true anymore. Thread-safe/atomic > > primitives are used by AIO

Re: [PATCH v3 1/5] hw/nvme: split pmrmsc register into upper and lower

2021-07-19 Thread Klaus Jensen
On Jul 19 10:13, Peter Maydell wrote: > On Wed, 14 Jul 2021 at 07:01, Klaus Jensen wrote: > > > > From: Klaus Jensen > > > > The specification uses a set of 32 bit PMRMSCL and PMRMSCU registers to > > make up the 64 bit logical PMRMSC register. > > > > Make it so. > > > > Signed-off-by: Klaus Jen

Re: [PATCH v3 4/5] hw/nvme: fix mmio read

2021-07-19 Thread Peter Maydell
On Wed, 14 Jul 2021 at 07:01, Klaus Jensen wrote: > > From: Klaus Jensen > > The new PMR test unearthed a long-standing issue with MMIO reads on > big-endian hosts. > > Fix this by unconditionally storing all controller registers in little > endian. > > Cc: Gollu Appalanaidu > Reported-by: Peter

Re: [PATCH 2/3] iothread: add aio-max-batch parameter

2021-07-19 Thread Stefano Garzarella
On Tue, Jul 13, 2021 at 03:51:15PM +0100, Stefan Hajnoczi wrote: On Wed, Jul 07, 2021 at 05:00:18PM +0200, Stefano Garzarella wrote: diff --git a/qapi/misc.json b/qapi/misc.json index 156f98203e..f64bb69f74 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -86,6 +86,9 @@ # @poll-shrink: how m

Re: [PATCH 1/1] block: Do not poll in bdrv_set_aio_context_ignore() when acquiring new_context

2021-07-19 Thread Kevin Wolf
Am 12.07.2021 um 07:38 hat Zhiyong Ye geschrieben: > When bdrv_set_aio_context_ignore() is called in the main loop to change > the AioContext onto the IO thread, the bdrv_drain_invoke_entry() never > gets to run and the IO thread hangs at co_schedule_bh_cb(). > > This is because the AioContext is

Re: [PATCH 3/3] linux-aio: limit the batch size using `aio-max-batch` parameter

2021-07-19 Thread Stefano Garzarella
On Tue, Jul 13, 2021 at 03:58:04PM +0100, Stefan Hajnoczi wrote: On Wed, Jul 07, 2021 at 05:00:19PM +0200, Stefano Garzarella wrote: @@ -371,7 +375,7 @@ static int laio_do_submit(int fd, struct qemu_laiocb *laiocb, off_t offset, s->io_q.in_queue++; if (!s->io_q.blocked && (!s

Re: [PATCH 02/14] iotests.py: qemu_img*("create"): support IMGOPTS='compression_type=zstd'

2021-07-19 Thread Vladimir Sementsov-Ogievskiy
16.07.2021 13:34, Vladimir Sementsov-Ogievskiy wrote: 16.07.2021 13:07, Max Reitz wrote: On 05.07.21 11:15, Vladimir Sementsov-Ogievskiy wrote: Adding support of IMGOPTS (like in bash tests) allows user to pass a lot of different options. Still, some may require additional logic. Now we want c

Re: [PATCH 02/14] iotests.py: qemu_img*("create"): support IMGOPTS='compression_type=zstd'

2021-07-19 Thread Vladimir Sementsov-Ogievskiy
19.07.2021 15:58, Vladimir Sementsov-Ogievskiy wrote: Could also be done with something like imgopts = os.environ.get('IMGOPTS') imgopts is a string after it. So you don't need to join it? opts = optstr2dict(','.join(([imgopts] if imgopts else []) + parsed.o)) Build a string to be than

Re: [RFC PATCH 0/6] job: replace AioContext lock with job_mutex

2021-07-19 Thread Kevin Wolf
Am 19.07.2021 um 11:29 hat Stefan Hajnoczi geschrieben: > On Fri, Jul 16, 2021 at 05:23:50PM +0200, Kevin Wolf wrote: > > Am 13.07.2021 um 15:10 hat Stefan Hajnoczi geschrieben: > > > AIO_WAIT_WHILE() requires that AioContext is acquired according to its > > > documentation, but I'm not sure that's

Re: [RFC PATCH nvme-cli 2/2] nvme-cli/plugins/mi:add support

2021-07-19 Thread Mohit Kapoor
On Fri, Jul 09, 2021 at 09:04:30AM -0700, Keith Busch wrote: +int hal_init() +{ +int retval = -1; +switch (GetSidebandInterface()) { +case qemu_nvme_mi: +retval = qemu_mi_init(); +break; +default: +break; +} +return retval; +} + +int hal_open() +{ +

[PULL 1/6] blkdebug: refactor removal of a suspended request

2021-07-19 Thread Max Reitz
From: Emanuele Giuseppe Esposito Extract to a separate function. Do not rely on FOREACH_SAFE, which is only "safe" if the *current* node is removed---not if another node is removed. Instead, just walk the entire list from the beginning when asked to resume all suspended requests with a given ta

[PULL 3/6] blkdebug: track all actions

2021-07-19 Thread Max Reitz
From: Emanuele Giuseppe Esposito Add a counter for each action that a rule can trigger. This is mainly used to keep track of how many coroutine_yield() we need to perform after processing all rules in the list. Co-developed-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito Reviewed-b

[PULL 0/6] Block patches for 6.1-rc0

2021-07-19 Thread Max Reitz
The following changes since commit 7457b407edd6e8555e4b46488aab2f13959fccf8: Merge remote-tracking branch 'remotes/thuth-gitlab/tags/pull-request-2021-07-19' into staging (2021-07-19 11:34:08 +0100) are available in the Git repository at: https://github.com/XanClic/qemu.git tags/pull-block

[PULL 2/6] blkdebug: move post-resume handling to resume_req_by_tag

2021-07-19 Thread Max Reitz
From: Emanuele Giuseppe Esposito We want to move qemu_coroutine_yield() after the loop on rules, because QLIST_FOREACH_SAFE is wrong if the rule list is modified while the coroutine has yielded. Therefore move the suspended request to the heap and clean it up from the remove side. All that is le

[PULL 4/6] blkdebug: do not suspend in the middle of QLIST_FOREACH_SAFE

2021-07-19 Thread Max Reitz
From: Emanuele Giuseppe Esposito That would be unsafe in case a rule other than the current one is removed while the coroutine has yielded. Keep FOREACH_SAFE because suspend_request deletes the current rule. After this patch, *all* matching rules are deleted before suspending the coroutine, rath

[PULL 6/6] blkdebug: protect rules and suspended_reqs with a lock

2021-07-19 Thread Max Reitz
From: Emanuele Giuseppe Esposito First, categorize the structure fields to identify what needs to be protected and what doesn't. We essentially need to protect only .state, and the 3 lists in BDRVBlkdebugState. Then, add the lock and mark the functions accordingly. Co-developed-by: Paolo Bonzi

[PULL 5/6] block/blkdebug: remove new_state field and instead use a local variable

2021-07-19 Thread Max Reitz
From: Emanuele Giuseppe Esposito There seems to be no benefit in using a field. Replace it with a local variable, and move the state update before the yields. The state update has do be done before the yields because now using a local variable does not allow the new updated state to be visible b

[PATCH v4 1/5] hw/nvme: split pmrmsc register into upper and lower

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen The specification uses a set of 32 bit PMRMSCL and PMRMSCU registers to make up the 64 bit logical PMRMSC register. Make it so. Signed-off-by: Klaus Jensen --- include/block/nvme.h | 31 --- hw/nvme/ctrl.c | 9 + 2 files changed, 2

[PATCH v4 0/5] hw/nvme: fix mmio read

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen Fix mmio read issues on big-endian hosts. The core issue is that values in the BAR is not stored in little endian as required. Fix that and add a regression test for this. This required a bit of cleanup, so it blew up into a series. v4: * "hw/nvme: split pmrmsc register int

[PATCH v4 3/5] hw/nvme: fix out-of-bounds reads

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen Peter noticed that mmio access may read into the NvmeParams member in the NvmeCtrl struct. Fix the bounds check. Reported-by: Peter Maydell Signed-off-by: Klaus Jensen Reviewed-by: Stefan Hajnoczi Reviewed-by: Peter Maydell --- hw/nvme/ctrl.c | 27 +++

[PATCH v4 4/5] hw/nvme: fix mmio read

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen The new PMR test unearthed a long-standing issue with MMIO reads on big-endian hosts. Fix this by unconditionally storing all controller registers in little endian. Cc: Gollu Appalanaidu Reported-by: Peter Maydell Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 290 +

[PATCH v4 2/5] hw/nvme: use symbolic names for registers

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen Add the NvmeBarRegs enum and use these instead of explicit register offsets. Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu Reviewed-by: Philippe Mathieu-Daudé --- include/block/nvme.h | 29 - hw/nvme/ctrl.c | 44 ++

Re: [PATCH v4 4/5] hw/nvme: fix mmio read

2021-07-19 Thread Klaus Jensen
On Jul 19 22:07, Klaus Jensen wrote: > From: Klaus Jensen > > The new PMR test unearthed a long-standing issue with MMIO reads on > big-endian hosts. > > Fix this by unconditionally storing all controller registers in little > endian. > > Cc: Gollu Appalanaidu > Reported-by: Peter Maydell > S

[PATCH v4 5/5] tests/qtest/nvme-test: add mmio read test

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen Add a regression test for mmio read on big-endian hosts. Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu --- tests/qtest/nvme-test.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/tests/qtest/nvme-test.c b/tests/qtest/nvme-test.c

[PATCH v5 0/5] hw/nvme: fix mmio read

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen Fix mmio read issues on big-endian hosts. The core issue is that values in the BAR is not stored in little endian as required. Fix that and add a regression test for this. This required a bit of cleanup, so it blew up into a series. v5: * "hw/nvme: fix mmio read" - Hurr

[PATCH v5 1/5] hw/nvme: split pmrmsc register into upper and lower

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen The specification uses a set of 32 bit PMRMSCL and PMRMSCU registers to make up the 64 bit logical PMRMSC register. Make it so. Signed-off-by: Klaus Jensen --- include/block/nvme.h | 31 --- hw/nvme/ctrl.c | 9 + 2 files changed, 2

[PATCH v5 2/5] hw/nvme: use symbolic names for registers

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen Add the NvmeBarRegs enum and use these instead of explicit register offsets. Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu Reviewed-by: Philippe Mathieu-Daudé --- include/block/nvme.h | 29 - hw/nvme/ctrl.c | 44 ++

[PATCH v5 3/5] hw/nvme: fix out-of-bounds reads

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen Peter noticed that mmio access may read into the NvmeParams member in the NvmeCtrl struct. Fix the bounds check. Reported-by: Peter Maydell Signed-off-by: Klaus Jensen Reviewed-by: Stefan Hajnoczi Reviewed-by: Peter Maydell --- hw/nvme/ctrl.c | 27 +++

[PATCH v5 5/5] tests/qtest/nvme-test: add mmio read test

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen Add a regression test for mmio read on big-endian hosts. Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu --- tests/qtest/nvme-test.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/tests/qtest/nvme-test.c b/tests/qtest/nvme-test.c

[PATCH v5 4/5] hw/nvme: fix mmio read

2021-07-19 Thread Klaus Jensen
From: Klaus Jensen The new PMR test unearthed a long-standing issue with MMIO reads on big-endian hosts. Fix this by unconditionally storing all controller registers in little endian. Cc: Gollu Appalanaidu Reported-by: Peter Maydell Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 290 +

Re: [PATCH v5 2/5] hw/nvme: use symbolic names for registers

2021-07-19 Thread Keith Busch
On Tue, Jul 20, 2021 at 12:46:44AM +0200, Klaus Jensen wrote: > From: Klaus Jensen > > Add the NvmeBarRegs enum and use these instead of explicit register > offsets. Thanks, this is a very nice cleanup. For a suggested follow-up companion patch, we should add "ASSERT_OFFSET()" checks for each re

Re: Failing iotest 206

2021-07-19 Thread Eric Blake
On Mon, Jul 19, 2021 at 10:06:01AM +0200, Thomas Huth wrote: > Hi, > > iotest 206 fails for me with: > > --- 206.out > +++ 206.out.bad > @@ -99,55 +99,19 @@ > > {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": > {"driver": "qcow2", "encrypt": {"cipher-alg": "twofish-1