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

2022-07-28 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 --- hw/nvme/ctrl.c | 61 +++

[PATCH for-7.1 0/3] hw/nvme: misc ioeventfd fixes

2022-07-28 Thread Klaus Jensen
From: Klaus Jensen A set of fixes/changes to the ioeventfd support. Klaus Jensen (3): hw/nvme: skip queue processing if notifier is cleared hw/nvme: unregister the event notifier handler on the main loop hw/nvme: do not enable ioeventfd by default hw/nvme/ctrl.c | 12 +--- 1 file

[PATCH for-7.1 1/3] hw/nvme: skip queue processing if notifier is cleared

2022-07-28 Thread Klaus Jensen
From: Klaus Jensen While it is safe to process the queues when they are empty, skip it if the event notifier callback was invoked spuriously. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl

[PATCH for-7.1 2/3] hw/nvme: unregister the event notifier handler on the main loop

2022-07-28 Thread Klaus Jensen
From: Klaus Jensen Make sure the notifier handler is unregistered in the main loop prior to cleaning it up. Fixes: 2e53b0b45024 ("hw/nvme: Use ioeventfd to handle doorbell updates") Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/nvme/ctr

[PATCH for-7.1 3/3] hw/nvme: do not enable ioeventfd by default

2022-07-28 Thread Klaus Jensen
From: Klaus Jensen Do not enable ioeventfd by default. Let the feature mature a bit before we consider enabling it by default. Fixes: 2e53b0b45024 ("hw/nvme: Use ioeventfd to handle doorbell updates") Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 dele

Re: [PATCH v1 1/5] block/vhost-user-blk-server: don't expose VHOST_USER_F_PROTOCOL_FEATURES

2022-07-28 Thread Kevin Wolf
Am 27.07.2022 um 17:56 hat Alex Bennée geschrieben: > This bit is unused in actual VirtIO feature negotiation and should > only appear in the vhost-user messages between master and slave. > > [AJB: experiment, this doesn't break the tests but I'm not super > confident of the range of tests] > > S

Re: [PATCH v5 5/8] blockdev: Add a new IF type IF_OTHER

2022-07-28 Thread Peter Maydell
On Wed, 27 Jul 2022 at 20:03, Kevin Wolf wrote: > > Am 18.07.2022 um 11:49 hat Markus Armbruster geschrieben: > > An OTP device isn't really a parallel flash, and neither are eFuses. > > More fast-and-lose use of IF_PFLASH may exist in the tree, and maybe of > > other interface types, too. > > > >

Re: [PATCH v1 1/5] block/vhost-user-blk-server: don't expose VHOST_USER_F_PROTOCOL_FEATURES

2022-07-28 Thread Alex Bennée
Kevin Wolf writes: > Am 27.07.2022 um 17:56 hat Alex Bennée geschrieben: >> This bit is unused in actual VirtIO feature negotiation and should >> only appear in the vhost-user messages between master and slave. >> >> [AJB: experiment, this doesn't break the tests but I'm not super >> confident

Re: [PATCH v3 05/21] block/vhost-user-blk-server: don't expose VHOST_USER_F_PROTOCOL_FEATURES

2022-07-28 Thread Alex Bennée
Jason Wang writes: > 在 2022/7/27 03:21, Alex Bennée 写道: >> This bit is unused in actual VirtIO feature negotiation and should >> only appear in the vhost-user messages between master and slave. > > > I might be wrong, but this is actually used between master and slave > not the device and drive

Re: [PULL 0/2] block: fix parallels block driver

2022-07-28 Thread Richard Henderson
On 7/27/22 12:06, Vladimir Sementsov-Ogievskiy wrote: The following changes since commit f6cce6bcb2ef959cdd4da0e368f7c72045f21d6d: Merge tag 'pull-target-arm-20220726' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2022-07-26 08:32:01 -0700) are available in the Git repos

Re: [PATCH v5 5/8] blockdev: Add a new IF type IF_OTHER

2022-07-28 Thread Kevin Wolf
Am 28.07.2022 um 11:46 hat Peter Maydell geschrieben: > On Wed, 27 Jul 2022 at 20:03, Kevin Wolf wrote: > > > > Am 18.07.2022 um 11:49 hat Markus Armbruster geschrieben: > > > An OTP device isn't really a parallel flash, and neither are eFuses. > > > More fast-and-lose use of IF_PFLASH may exist i

Re: [PATCH v5 5/8] blockdev: Add a new IF type IF_OTHER

2022-07-28 Thread Peter Maydell
On Thu, 28 Jul 2022 at 14:30, Kevin Wolf wrote: > > Am 28.07.2022 um 11:46 hat Peter Maydell geschrieben: > > On Wed, 27 Jul 2022 at 20:03, Kevin Wolf wrote: > > > If the existing types aren't good enough (I don't have an opinion on > > > whether IF_PFLASH is a good match), let's add a new one. B

Re: [PATCH v5 5/8] blockdev: Add a new IF type IF_OTHER

2022-07-28 Thread Cédric Le Goater
On 7/28/22 15:29, Kevin Wolf wrote: Am 28.07.2022 um 11:46 hat Peter Maydell geschrieben: On Wed, 27 Jul 2022 at 20:03, Kevin Wolf wrote: Am 18.07.2022 um 11:49 hat Markus Armbruster geschrieben: An OTP device isn't really a parallel flash, and neither are eFuses. More fast-and-lose use of I

Re: [PATCH 1/1] block: add missed block_acct_setup with new block device init procedure

2022-07-28 Thread Vladimir Sementsov-Ogievskiy
On 7/11/22 14:07, Denis V. Lunev wrote: Commit 5f76a7aac156ca75680dad5df4a385fd0b58f6b1 is looking harmless from the first glance, but it has changed things a lot. 'libvirt' uses it to detect that it should follow new initialization way and this changes things considerably. With this procedure fo

Re: [PATCH v5 5/8] blockdev: Add a new IF type IF_OTHER

2022-07-28 Thread Peter Maydell
On Thu, 28 Jul 2022 at 15:50, Markus Armbruster wrote: > Kevin Wolf writes: > > > > But if you have more than one device, it becomes hard to predict which > > device gets which backend - it depends on the initialisation order in > > the code then, > > Really? Board code should use IF_OTHER devic

Re: [PATCH v5 5/8] blockdev: Add a new IF type IF_OTHER

2022-07-28 Thread Markus Armbruster
Kevin Wolf writes: > Am 28.07.2022 um 11:46 hat Peter Maydell geschrieben: >> On Wed, 27 Jul 2022 at 20:03, Kevin Wolf wrote: >> > >> > Am 18.07.2022 um 11:49 hat Markus Armbruster geschrieben: >> > > An OTP device isn't really a parallel flash, and neither are eFuses. >> > > More fast-and-lose

Re: [PATCH for-7.1 0/3] hw/nvme: misc ioeventfd fixes

2022-07-28 Thread Keith Busch
On Thu, Jul 28, 2022 at 10:25:19AM +0200, Klaus Jensen wrote: > From: Klaus Jensen > > A set of fixes/changes to the ioeventfd support. Series looks good. Reviewed-by: Keith Busch

Re: [PATCH for-7.1 0/3] hw/nvme: misc ioeventfd fixes

2022-07-28 Thread Jinhao Fan
at 4:25 PM, Klaus Jensen wrote: > From: Klaus Jensen > > A set of fixes/changes to the ioeventfd support. > > Klaus Jensen (3): > hw/nvme: skip queue processing if notifier is cleared > hw/nvme: unregister the event notifier handler on the main loop > hw/nvme: do not enable ioeventfd by def

Re: [RFC patch 0/1] block: vhost-blk backend

2022-07-28 Thread Stefano Garzarella
On Thu, Jul 28, 2022 at 7:28 AM Andrey Zhadchenko wrote: > On 7/27/22 16:06, Stefano Garzarella wrote: > > On Tue, Jul 26, 2022 at 04:15:48PM +0200, Denis V. Lunev wrote: > >> On 26.07.2022 15:51, Michael S. Tsirkin wrote: > >>> On Mon, Jul 25, 2022 at 11:55:26PM +0300, Andrey Zhadchenko wrote: >

Re: [PATCH v5 5/8] blockdev: Add a new IF type IF_OTHER

2022-07-28 Thread Kevin Wolf
Am 28.07.2022 um 16:50 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Am 28.07.2022 um 11:46 hat Peter Maydell geschrieben: > >> On Wed, 27 Jul 2022 at 20:03, Kevin Wolf wrote: > >> > > >> > Am 18.07.2022 um 11:49 hat Markus Armbruster geschrieben: > >> > > An OTP device isn't rea

Re: [PATCH 1/1] block: add missed block_acct_setup with new block device init procedure

2022-07-28 Thread Denis V. Lunev
On 28.07.2022 16:42, Vladimir Sementsov-Ogievskiy wrote: On 7/11/22 14:07, Denis V. Lunev wrote: Commit 5f76a7aac156ca75680dad5df4a385fd0b58f6b1 is looking harmless from the first glance, but it has changed things a lot. 'libvirt' uses it to detect that it should follow new initialization way an

[RFC 0/3] Add Generic SPI GPIO model

2022-07-28 Thread Iris Chen
Hey everyone, I have been working on a project to add support for SPI-based TPMs in QEMU. Currently, most of our vboot platforms using a SPI-based TPM use the Linux SPI-GPIO driver to "bit-bang" the SPI protocol. This is because the Aspeed SPI controller (modeled in QEMU under hw/ssi/aspeed_smc.

[RFC 1/3] hw: m25p80: add prereading ability in transfer8

2022-07-28 Thread Iris Chen
With SPI-GPIO we don't have the input bits until all 8 bits of the output have been shifted out, so we have to prime the MISO with bogus values (0xFF). Signed-off-by: Iris Chen --- hw/block/m25p80.c| 29 - hw/ssi/ssi.c | 4 include/hw/ssi/ssi.h | 5

[RFC 2/3] hw: spi_gpio: add spi gpio model

2022-07-28 Thread Iris Chen
Signed-off-by: Iris Chen --- hw/ssi/spi_gpio.c | 166 ++ include/hw/ssi/spi_gpio.h | 38 + 2 files changed, 204 insertions(+) create mode 100644 hw/ssi/spi_gpio.c create mode 100644 include/hw/ssi/spi_gpio.h diff --git a/hw/ssi/spi_gpio.c b/

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

2022-07-28 Thread Peter Delevoryas
On Thu, Jul 28, 2022 at 04:23:19PM -0700, Iris Chen wrote: > Hey everyone, > > I have been working on a project to add support for SPI-based TPMs in QEMU. > Currently, most of our vboot platforms using a SPI-based TPM use the Linux > SPI-GPIO driver to "bit-bang" the SPI protocol. This is because