Re: [PATCH] hw/nvme: Add helper functions for qid-db conversion

2022-08-02 Thread Keith Busch
On Wed, Aug 03, 2022 at 09:46:05AM +0800, Jinhao Fan wrote: > at 4:54 PM, Klaus Jensen wrote: > > > I am unsure if the compiler will transform that division into the shift > > if it can infer that the divisor is a power of two (it most likely > > will be able to). > > > > But I see no reason to

[PATCH v2] hw/nvme: Add helper functions for qid-db conversion

2022-08-02 Thread Jinhao Fan
With the introduction of shadow doorbell and ioeventfd, we need to do frequent conversion between qid and its doorbell offset. The original hard-coded calculation is confusing and error-prone. Add several helper functions to do this task. Signed-off-by: Jinhao Fan --- Changes since v1: - Use

Re: [PATCH] hw/nvme: Add helper functions for qid-db conversion

2022-08-02 Thread Jinhao Fan
at 4:54 PM, Klaus Jensen wrote: > I am unsure if the compiler will transform that division into the shift > if it can infer that the divisor is a power of two (it most likely > will be able to). > > But I see no reason to have a potential division here when we can do > without and to me it is

Re: [RFC 0/3] Add Generic SPI GPIO model

2022-08-02 Thread Iris Chen
Thanks everyone for the insightful feedback! This is really helpful for me. I am taking a look at all the comments now and will investigate into it. Best, Iris

Re: [PULL 0/7] Block layer patches

2022-08-02 Thread Richard Henderson
On 8/2/22 06:37, Kevin Wolf wrote: The following changes since commit 60205b71421cbc529ca60b12c79e0eeace007319: Merge tag 'pull-aspeed-20220801' of https://github.com/legoater/qemu into staging (2022-08-01 13:55:11 -0700) are available in the Git repository at:

Re: [PATCH] virtio: remove unnecessary host_features in ->get_features()

2022-08-02 Thread Cornelia Huck
On Tue, Aug 02 2022, Stefan Hajnoczi wrote: > Since at least commit 6b8f1020540c27246277377aa2c3331ad2bfb160 ("virtio: > move host_features") the ->get_features() function has been called with > host_features as an argument. > > Some devices manually add host_features in ->get_features()

Re: [RFC 0/3] Add Generic SPI GPIO model

2022-08-02 Thread Cédric Le Goater
On 7/31/22 00:06, Peter Delevoryas wrote: On Sat, Jul 30, 2022 at 11:18:33PM +0200, Cédric Le Goater wrote: On 7/29/22 19:30, Peter Delevoryas wrote: On Fri, Jul 29, 2022 at 03:25:55PM +0200, Cédric Le Goater wrote: Hello Iris, On 7/29/22 01:23, Iris Chen wrote: Hey everyone, I have been

[PULL 7/7] main loop: add missing documentation links to GS/IO macros

2022-08-02 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito If we go directly to GLOBAL_STATE_CODE, IO_CODE or IO_OR_GS_CODE definition, we just find that they "mark and check that the function is part of the {category} API". However, ther is no definition on what {category} API is, they are in include/block/block-*.h

Re: [PATCH 0/2] migration: fix coverity nits

2022-08-02 Thread Dr. David Alan Gilbert
* Peter Maydell (peter.mayd...@linaro.org) wrote: > On Thu, 21 Jul 2022 at 12:52, Peter Maydell wrote: > > > > This patchset fixes four Coverity nits in the migration code. > > The first patch is just adding an assert() to clue coverity in > > that an array index must be in-bounds. The second

[PULL 3/7] libvduse: Replace strcpy() with strncpy()

2022-08-02 Thread Kevin Wolf
From: Xie Yongji Coverity reported a string overflow issue since we copied "name" to "dev_config->name" without checking the length. This should be a false positive since we already checked the length of "name" in vduse_name_is_invalid(). But anyway, let's replace strcpy() with strncpy() (as a

[PULL 5/7] hw/block/hd-geometry: Do not override specified bios-chs-trans

2022-08-02 Thread Kevin Wolf
From: Lev Kujawski For small disk images (<4 GiB), QEMU and SeaBIOS default to the LARGE/ECHS disk translation method, but it is not uncommon for other BIOS software to use LBA in these cases as well. Some operating system boot loaders (e.g., NT 4) do not handle LARGE translations outside of

[PULL 4/7] libvduse: Pass positive value to strerror()

2022-08-02 Thread Kevin Wolf
From: Xie Yongji The value passed to strerror() should be positive. So let's fix it. Fixes: Coverity CID 1490226, 1490223 Signed-off-by: Xie Yongji Reviewed-by: Richard Henderson Reviewed-by: Markus Armbruster Message-Id: <20220706095624.328-4-xieyon...@bytedance.com> Signed-off-by: Kevin

[PULL 6/7] qemu-iotests: Discard stderr when probing devices

2022-08-02 Thread Kevin Wolf
From: Cole Robinson qemu-iotests fails in the following setup: ./configure --enable-modules --enable-smartcard \ --target-list=x86_64-softmmu,s390x-softmmu make cd build QEMU_PROG=`pwd`/s390x-softmmu/qemu-system-s390x \ ../tests/check-block.sh qcow2 ... ---

[PULL 1/7] block/io_uring: add missing include file

2022-08-02 Thread Kevin Wolf
From: Jinhao Fan The commit "Use io_uring_register_ring_fd() to skip fd operations" uses warn_report but did not include the header file "qemu/error-report.h". This causes "error: implicit declaration of function ‘warn_report’". Include this header file. Fixes: e2848bc574 ("Use

[PULL 0/7] Block layer patches

2022-08-02 Thread Kevin Wolf
The following changes since commit 60205b71421cbc529ca60b12c79e0eeace007319: Merge tag 'pull-aspeed-20220801' of https://github.com/legoater/qemu into staging (2022-08-01 13:55:11 -0700) are available in the Git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you to

[PULL 2/7] libvduse: Fix the incorrect function name

2022-08-02 Thread Kevin Wolf
From: Xie Yongji In vduse_name_is_valid(), we actually check whether the name is invalid or not. So let's change the function name to vduse_name_is_invalid() to match the behavior. Signed-off-by: Xie Yongji Reviewed-by: Markus Armbruster Message-Id:

[PATCH] virtio: remove unnecessary host_features in ->get_features()

2022-08-02 Thread Stefan Hajnoczi
Since at least commit 6b8f1020540c27246277377aa2c3331ad2bfb160 ("virtio: move host_features") the ->get_features() function has been called with host_features as an argument. Some devices manually add host_features in ->get_features() although the features argument already contains host_features.

Re: [PATCH 8/9] scripts/qapi-gen: add -i option

2022-08-02 Thread Markus Armbruster
Marc-André Lureau writes: > Hi > > > On Tue, Jun 21, 2022 at 6:14 PM Markus Armbruster wrote: >> >> marcandre.lur...@redhat.com writes: >> >> > From: Marc-André Lureau >> > >> > Replace hard-coded "qemu/osdep.h" include with a qapi-gen option to >> > specify the headers to include. This will

[PATCH] virtio: remove unnecessary host_features in ->get_features()

2022-08-02 Thread Stefan Hajnoczi
Since at least commit 6b8f1020540c27246277377aa2c3331ad2bfb160 ("virtio: move host_features") the ->get_features() function has been called with host_features as an argument. Some devices manually add host_features in ->get_features() although the features argument already contains host_features.

Re: Deadlock between bdrv_drain_all_begin and prepare_mmio_access

2022-08-02 Thread Kevin Wolf
Am 24.07.2022 um 23:41 hat Liang Yan geschrieben: > Hello All, > > I am facing a lock situation between main-loop thread 1 and vcpu thread 4 > when doing a qmp snapshot. QEMU is running on 6.0.x, checked the upstream > code and did not see any big change since between. Guest is a Windows 10 VM. >

[PATCH] tests/qemu-iotests/264: Allow up to 5s for the BLOCK_JOB_CANCEL event to arrive

2022-08-02 Thread Thomas Huth
It is possible to hit the assertTrue(delta_t < 2.0) on very loaded systems. Increase the value to 5.0 to ease the situation a little bit. Signed-off-by: Thomas Huth --- See also https://lists.gnu.org/archive/html/qemu-devel/2022-07/msg03936.html tests/qemu-iotests/264 | 2 +- 1 file changed,

Re: [PATCH v2 06/15] qapi: move QEMU-specific dispatch code in monitor

2022-08-02 Thread Markus Armbruster
Marc-André Lureau writes: > Hi > > On Tue, Aug 2, 2022 at 3:04 PM Markus Armbruster wrote: > >> marcandre.lur...@redhat.com writes: >> >> > From: Marc-André Lureau >> > >> > Make QMP-dispatch code free from QEMU-specific OOB dispatch/async >> > coroutine handling. This will allow to move the

Re: [PATCH v2 06/15] qapi: move QEMU-specific dispatch code in monitor

2022-08-02 Thread Marc-André Lureau
Hi On Tue, Aug 2, 2022 at 3:04 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > Make QMP-dispatch code free from QEMU-specific OOB dispatch/async > > coroutine handling. This will allow to move the base code to > > qemu-common, and clear

Re: [PATCH v2 06/15] qapi: move QEMU-specific dispatch code in monitor

2022-08-02 Thread Markus Armbruster
marcandre.lur...@redhat.com writes: > From: Marc-André Lureau > > Make QMP-dispatch code free from QEMU-specific OOB dispatch/async > coroutine handling. This will allow to move the base code to > qemu-common, and clear other users from potential mis-ususe (QGA doesn't > have OOB or coroutine).

Re: [PATCH] hw/nvme: Add helper functions for qid-db conversion

2022-08-02 Thread Klaus Jensen
On Aug 2 10:54, Klaus Jensen wrote: > On Aug 2 16:31, Jinhao Fan wrote: > > at 2:02 PM, Klaus Jensen wrote: > > > > > On Jul 28 16:07, Jinhao Fan wrote: > > >> With the introduction of shadow doorbell and ioeventfd, we need to do > > >> frequent conversion between qid and its doorbell offset.

[PATCH v4 11/22] hw/virtio: move vhd->started check into helper and add FIXME

2022-08-02 Thread Alex Bennée
The `started` field is manipulated internally within the vhost code except for one place, vhost-user-blk via f5b22d06fb (vhost: recheck dev state in the vhost_migration_log routine). Mark that as a FIXME because it introduces a potential race. I think the referenced fix should be tracking its

Re: [PATCH] qemu-iotests: Discard stderr when probing devices

2022-08-02 Thread Kevin Wolf
Am 05.06.2022 um 16:57 hat Cole Robinson geschrieben: > ./configure --enable-modules --enable-smartcard \ > --target-list=x86_64-softmmu,s390x-softmmu > make > cd build > QEMU_PROG=`pwd`/s390x-softmmu/qemu-system-s390x \ > ../tests/check-block.sh qcow2 > ... > ---

Re: [PATCH] main loop: add missing documentation links to GS/IO macros

2022-08-02 Thread Kevin Wolf
Am 09.06.2022 um 14:22 hat Emanuele Giuseppe Esposito geschrieben: > If we go directly to GLOBAL_STATE_CODE, IO_CODE or IO_OR_GS_CODE > definition, we just find that they "mark and check that the function > is part of the {category} API". > However, ther is no definition on what {category} API is,

Re: [PATCH] hw/block/hd-geometry: Do not override specified bios-chs-trans

2022-08-02 Thread Kevin Wolf
Am 07.07.2022 um 22:40 hat Lev Kujawski geschrieben: > For small disk images (<4 GiB), QEMU and SeaBIOS default to the > LARGE/ECHS disk translation method, but it is not uncommon for other > BIOS software to use LBA in these cases as well. Some operating > system boot loaders (e.g., NT 4) do not

Re: [PATCH] hw/nvme: Add helper functions for qid-db conversion

2022-08-02 Thread Jinhao Fan
at 2:02 PM, Klaus Jensen wrote: > On Jul 28 16:07, Jinhao Fan wrote: >> With the introduction of shadow doorbell and ioeventfd, we need to do >> frequent conversion between qid and its doorbell offset. The original >> hard-coded calculation is confusing and error-prone. Add several helper >>

Re: [PATCH] hw/nvme: Add helper functions for qid-db conversion

2022-08-02 Thread Klaus Jensen
On Aug 2 16:31, Jinhao Fan wrote: > at 2:02 PM, Klaus Jensen wrote: > > > On Jul 28 16:07, Jinhao Fan wrote: > >> With the introduction of shadow doorbell and ioeventfd, we need to do > >> frequent conversion between qid and its doorbell offset. The original > >> hard-coded calculation is

Re: [PATCH v2 0/3] Fix some coverity issues on VDUSE

2022-08-02 Thread Kevin Wolf
Am 06.07.2022 um 11:56 hat Xie Yongji geschrieben: > This series fixes some issues reported by coverity. > > Patch 1 fixes a incorrect function name. > > Patch 2 fixes Coverity CID 1490224. > > Patch 3 fixes Coverity CID 1490226, 1490223. > > V1 to V2: > - Drop the patch to fix Coverity CID

Re: Feature - Add delay to NVMe device model

2022-08-02 Thread Klaus Jensen
On Aug 2 09:03, Klaus Jensen wrote: > In that case we would need to introduce a timer delay in > QEMU. I meant to type "[...] introduce a timer delay in the nvme device model", not "[...] in QEMU". Brain fart ;) signature.asc Description: PGP signature

Re: Feature - Add delay to NVMe device model

2022-08-02 Thread Klaus Jensen
On Aug 1 19:22, Stephen Bates wrote: > Hi > > I am interested in exploring the impact of increased storage IO delay > on applications and was thinking of doing this by adding a delay > argument to the NVMe device model in QEMU. Is this something that > others would be interested in? If so I

Re: [PATCH] hw/nvme: Add helper functions for qid-db conversion

2022-08-02 Thread Klaus Jensen
On Jul 28 16:07, Jinhao Fan wrote: > With the introduction of shadow doorbell and ioeventfd, we need to do > frequent conversion between qid and its doorbell offset. The original > hard-coded calculation is confusing and error-prone. Add several helper > functions to do this task. > >