Re: [Qemu-devel] [PATCH] NVMe: Initial commit to add an NVM Express device

2012-12-08 Thread Keith Busch
On Sat, Dec 8, 2012 at 10:59 AM, Andreas Färber wrote: > Generally we encourage people to upstream their devices, given they are > sufficiently isolated and/or maintainable. Yes, that makes sense and have been doing that. We maintain an upstream repo, but needed to merge with a more recent qemu r

[Qemu-devel] [PATCH 08/11] QEMU NVMe: Enqueue critial temperature event

2013-02-26 Thread Keith Busch
If the temperature threshold warning is set below the controller temperature, enqueue the async event warning. Signed-off-by: Keith Busch --- hw/nvme.c |9 + hw/nvme.h |1 + 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/hw/nvme.c b/hw/nvme.c index c65c179

[Qemu-devel] [PATCH 03/11] QEMU NVMe: Implement NVMe features

2013-02-26 Thread Keith Busch
This allows a driver to set and retrieve the various nvme features defined in the spec. Where applicable, setting the features changes the device behavior to reflect the desired feature. Signed-off-by: Keith Busch --- hw/nvme.c | 148

[Qemu-devel] [PATCH 02/11] QEMU NVMe: Add command line options

2013-02-26 Thread Keith Busch
For controller capabilities and features visibile to a host driver, add command line parameters to allow them to be any value the spec allows. Useful for verifying a driver against a device with various constraints. Signed-off-by: Keith Busch --- hw/nvme.c | 161

[Qemu-devel] [PATCH 09/11] QEMU NVMe: Implement discontiguous queues

2013-02-26 Thread Keith Busch
This seems like a silly feature, but the spec allows it, so this adds support for queues that are not physically contiguous. Signed-off-by: Keith Busch --- hw/nvme.c | 143 +--- hw/nvme.h |2 + 2 files changed, 118 insertions(+), 27

[Qemu-devel] [PATCH 00/11] *** SUBJECT HERE ***

2013-02-26 Thread Keith Busch
tches add optional command support, or implement additional features. Keith Busch (11): NVMe: Initial commit for NVM Express device QEMU NVMe: Add command line options QEMU NVMe: Implement NVMe features QEMU NVMe: Implement additional admin commands QEMU NVMe: Add DSM command support QEMU

[Qemu-devel] [PATCH 10/11] QEMU NVMe: Add logging

2013-02-26 Thread Keith Busch
Adds logging at various levels of detail throughout the code so that a developer may see what is occuring within a device interacting with their nvme drivers and utilities. Signed-off-by: Keith Busch --- hw/nvme.c | 266 +++-- 1 files

[Qemu-devel] [PATCH 01/11] NVMe: Initial commit for NVM Express device

2013-02-26 Thread Keith Busch
required for an nvme device to work with existing block drivers. Cc: Keith Busch Signed-off-by: Keith Busch --- MAINTAINERS |5 + blockdev.c|6 + default-configs/pci.mak |1 + hw/Makefile.objs |2 + hw/nvme.c | 851

[Qemu-devel] [PATCH 07/11] QEMU NVMe: Set error pages with error data

2013-02-26 Thread Keith Busch
When errors are detected in commands, set the error log page so that the host driver may see relevent error data. Signed-off-by: Keith Busch --- hw/nvme.c | 25 + hw/nvme.h |2 ++ 2 files changed, 27 insertions(+), 0 deletions(-) diff --git a/hw/nvme.c b/hw/nvme.c

[Qemu-devel] [PATCH 11/11] QEMU NVMe: Support NVMe DIF and Meta-data

2013-02-26 Thread Keith Busch
rom a host driver perspected, except for perhaps controller PRACT bit set to 1. Signed-off-by: Keith Busch --- hw/nvme.c | 72 +--- hw/nvme.h |3 ++ 2 files changed, 61 insertions(+), 14 deletions(-) diff --git a/hw/nvme.c b/hw/nvme.c

[Qemu-devel] [PATCH 04/11] QEMU NVMe: Implement additional admin commands

2013-02-26 Thread Keith Busch
This adds support for format, asynch event, abort, and format admin commands, and helper routines to make it easier to put interesting data in the log pages. Signed-off-by: Keith Busch --- hw/nvme.c | 420 - hw/nvme.h | 21 +++ 2

[Qemu-devel] [PATCH 05/11] QEMU NVMe: Add DSM command support

2013-02-26 Thread Keith Busch
This adds support for the optional data-set-management command. Action is only done for the deallocate option. Signed-off-by: Keith Busch --- hw/nvme.c | 46 ++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/hw/nvme.c b/hw/nvme.c

[Qemu-devel] [PATCH 06/11] QEMU NVMe: Implement flush and dsm

2013-02-26 Thread Keith Busch
Signed-off-by: Keith Busch --- hw/nvme.c | 72 +++-- hw/nvme.h |2 + 2 files changed, 67 insertions(+), 7 deletions(-) diff --git a/hw/nvme.c b/hw/nvme.c index 69136e0..087fce9 100644 --- a/hw/nvme.c +++ b/hw/nvme.c @@ -327,7 +327,6

Re: [Qemu-devel] [PATCH 00/11] *** SUBJECT HERE ***

2013-02-27 Thread Keith Busch
On Wed, 27 Feb 2013, Stefan Hajnoczi wrote: Hi Keith, Any pointers on how to test this? For example NVMe-specific userspace tools that poke the more exotic commands/features? I use internal tools not externally available, but I know some folks use the compliance suite here: http://github.com/

Re: [Qemu-devel] [PATCH 01/11] NVMe: Initial commit for NVM Express device

2013-02-27 Thread Keith Busch
On Wed, 27 Feb 2013, Paolo Bonzini wrote: Il 27/02/2013 10:30, Andreas Färber ha scritto: +id->vwc = 1; +snprintf((char *)id->mn, sizeof(id->mn), "QEMU NVMe Ctrl"); +snprintf((char *)id->fr, sizeof(id->fr), "1.0"); +snprintf((char *)id->sn, sizeof(id->sn), "NVMeQx10%02x", n->

[Qemu-devel] [PATCH] NVMe: Initial commit

2013-04-10 Thread Keith Busch
Initial commit for emulated nvme pci storage device. Implements the minimum from the specification to work with existing drivers. Cc: Keith Busch Signed-off-by: Keith Busch A lot of people are very interested in this, so I should have more time to dedicate working on submitting this upstream

Re: [Qemu-devel] [PATCH] NVMe: Initial commit

2013-04-19 Thread Keith Busch
On Fri, 19 Apr 2013, Stefan Hajnoczi wrote: I don't see bdrv_aio_flush() in this patch. How does the guest ensure that data is safely on persistent storage (e.g. protected against data loss by power failure). Great point! This is to be consistent with the NVMe spec. This commit is the bare min

Re: [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices

2014-03-27 Thread Keith Busch
On Thu, 27 Mar 2014, Andreas Färber wrote: Am 12.03.2014 21:13, schrieb Keith Busch: On Wed, 12 Mar 2014, Andreas Färber wrote: Tonight is Hard Freeze for 2.0. If you could also review the matching test case http://patchwork.ozlabs.org/patch/329627/ I would put both in my pull. Looks great

Re: [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices

2014-03-12 Thread Keith Busch
On Wed, 12 Mar 2014, Andreas Färber wrote: It may not be sensible for normal use cases, but it allows to use /dev/null in QTest. Thanks! Sounds useful despite not being usable as storage. :) I applied to my nvme tree here: http://git.infradead.org/users/kbusch/qemu-nvme.git It's quite a bit

Re: [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices

2014-03-12 Thread Keith Busch
8afc13e460a63cac22: nvme: Permit zero-length block devices (2014-03-12 13:17:58 -0600) Andreas Färber (1): nvme: Permit zero-length block devices Keith Busch (4): NVMe: Implement remainder from spec NVMe:

Re: [Qemu-devel] [PATCH] nvme: Fix get/set number of queues feature

2015-01-08 Thread Keith Busch
On Wed, 7 Jan 2015, Stefan Hajnoczi wrote: On Fri, Dec 05, 2014 at 02:40:24PM +0200, a...@e8storage.com wrote: From: Alex Friedman According to the specification, the low 16 bits should contain the number of I/O submission queues, and the high 16 bits should contain the number of I/O completio

Re: [Qemu-devel] [PATCH] nvme: Fix get/set number of queues feature

2014-12-05 Thread Keith Busch
the fix! Acked-by: Keith Busch --- hw/block/nvme.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index b6263dc..405cf4f 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -476,7 +476,8 @@ static uint16_t nvme_get_feature(NvmeCtrl

Re: [Qemu-devel] [PATCH] Enable NVMe start controller for Windows guest.

2015-04-24 Thread Keith Busch
e the configuration data and then handle enable and NVMe driver works on Windows 8.1. Hm, Microsoft's driver must be issuing MMIO reads to mask in the enable bit rather than keep the state known. Sounds odd, but thanks for the fix. Acked-by: Keith Busch

Re: [Qemu-devel] Quick question on NVME on qemu

2015-10-12 Thread Keith Busch
On Mon, 12 Oct 2015, Kevin Wolf wrote: Am 12.10.2015 um 10:05 hat Igor Mammedov geschrieben: On Sat, 10 Oct 2015 00:39:43 -0700 sahlot arvind wrote: Hello, Does qemu emulate a proper NVMe controller? Can someone please tell me how s far as I'm aware, QEMU doesn't emulate any NVMe controlle

Re: [Qemu-devel] [PATCH] nvme: generate OpenFirmware device path in the "bootorder" fw_cfg file

2016-01-29 Thread Keith Busch
Thanks, sounds and looks good. Acked-by: Keith Busch > Background on QEMU boot indices > --- > > Normally, the "bootindex" property is configured for bootable devices > with: > > DEVICE_instance_init() > device_add_

Re: [Qemu-devel] [PATCH] nvme: fix identify to be NVMe 1.1 compliant

2015-11-17 Thread Keith Busch
> any OS trying to use the Namespace List will fail the probe. Thanks for the fix! Minor comment below, no need to fix. Acked-by: Keith Busch

Re: [Qemu-devel] [PATCH] nvme: fix identify to be NVMe 1.1 compliant

2015-11-17 Thread Keith Busch
On Tue, Nov 17, 2015 at 09:33:11AM -0800, Busch, Keith wrote: > I accidently deleted my comment. Here's what it said: > > +list = g_malloc(data_len); > +for (i = 0; i < n->num_namespaces; i++) { > +if (i <= min_nsid) { > +continue; > +} > +list[i] = i; >

Re: [Qemu-devel] [Qemu-block] [PATCH 0/2] import nvme fix

2015-11-25 Thread Keith Busch
o me. I had some difficulty finding the right patches in the midst of Christoph's Linux patch bombs. :) Acked-by: Keith Busch

Re: [Qemu-devel] [Bug 1529449] [NEW] serial is required for -device nvme

2016-01-11 Thread Keith Busch
On Mon, Jan 11, 2016 at 05:35:50PM +0100, Markus Armbruster wrote: > Tom Yan writes: > > Public bug reported: > > > > I am not exactly sure if this is a bug, but I don't see why the option > > "serial" should be required for -device nvme like the option "drive". > > Truth is it seem to accept rand

[Qemu-devel] [PATCH v3] NVMe: Initial commit

2013-03-19 Thread Keith Busch
Initial commit for emulated nvme pci device. Implements the minimum from the specification to work with existing drivers. Cc: Keith Busch Signed-off-by: Keith Busch Just going for the simplest patch possible for this device. If this is okay, the remainining features implementing the full

Re: [Qemu-devel] [PATCH] NVMe: Initial commit

2013-05-28 Thread Keith Busch
On Mon, 27 May 2013, Kevin Wolf wrote: Am 10.04.2013 um 22:16 hat Keith Busch geschrieben: Initial commit for emulated nvme pci storage device. Implements the minimum from the specification to work with existing drivers. Cc: Keith Busch Signed-off-by: Keith Busch A lot of people are very

[Qemu-devel] [PATCH v5] NVMe: Initial commit for new storage interface

2013-06-04 Thread Keith Busch
on the organizations website at: http://www.nvmexpress.org/ This commit implements the minimum from the specification to work with existing drivers. Cc: Keith Busch Signed-off-by: Keith Busch --- v4 -> v5: Call bdrv_flush on controller shutdown. Mark device as 'unmigratable'.

Re: [Qemu-devel] [edk2] NVMe question

2015-06-02 Thread Keith Busch
Hi, On Tue, 2 Jun 2015, Laszlo Ersek wrote: removed the nonzero initialization of Cc.Iosqes (submission queue size?) and Cc.Iocqes (completion queue size?) in function NvmeEnableController(). And the removal of these field initializations seems to cause the early sanity check in QEMU's nvme_star

Re: [Qemu-devel] [PATCH] nvme: Fix memleak in nvme_dma_read_prp

2015-06-19 Thread Keith Busch
On Fri, 19 Jun 2015, Stefan Hajnoczi wrote: From: Lu Lina Signed-off-by: Lu Lina Thanks for the fix. Acked-by: Keith Busch @@ -154,6 +154,7 @@ static uint16_t nvme_dma_read_prp(NvmeCtrl *n, uint8_t *ptr, uint32_t len, qemu_sglist_destroy(&qsg); re

Re: [Qemu-devel] [Bug 1576347] [NEW] Only one NVMe device is usable in Windows (10) guest

2016-05-04 Thread Keith Busch
On Fri, Apr 29, 2016 at 10:10:39AM +0100, Stefan Hajnoczi wrote: > On Thu, Apr 28, 2016 at 05:44:21PM -, Tom Yan wrote: > > CCing Keith Busch , maintainer of QEMU NVMe. > Maybe he has an idea. Thanks for the report. Sounds like a Windows specific issue as I have no problem with m

Re: [Qemu-devel] [Bug 1576347] [NEW] Only one NVMe device is usable in Windows (10) guest

2016-05-04 Thread Keith Busch
> > C:\Windows\system32>sg_vpd -p sn PD1 > > Unit serial number VPD page: > > Unit serial number: ___." I checked your serial number against the SNT refernce on nvmexpress.org and it's definitely the wrong translation, so that has to be a guest OS driver bug (Linux has the

Re: [Qemu-devel] [PATCH] nvme: support NVME_VOLATILE_WRITE_CACHE feature

2015-04-30 Thread Keith Busch
migratable guest-visible state we always return 1 here. Thanks, this fix was long overdue and already incorporated in my tree. I really need to get my act together for a legit pull request with all the other 1.0, 1.1 and 1.2 features. Acked-by: Keith Busch Signed-off-by: Christoph Hellwig diff

Re: [PATCH for-7.2 1/5] hw/nvme: fix aio cancel in format

2022-11-22 Thread Keith Busch
UBH member from the above struct with this patch. Otherwise looks good. Reviewed-by: Keith Busch

Re: [PULL for-7.2 0/5] hw/nvme fixes

2022-12-04 Thread Keith Busch
On Sun, Dec 04, 2022 at 11:06:13AM -0500, Stefan Hajnoczi wrote: > On Thu, 1 Dec 2022 at 11:50, Klaus Jensen wrote: > > > > From: Klaus Jensen > > > > Hi, > > > > The following changes since commit c4ffd91aba1c3d878e99a3e7ba8aad4826728ece: > > > > Update VERSION for v7.2.0-rc3 (2022-11-29 18:15

Re: [PATCH] hw/nvme: Add iothread support

2022-07-26 Thread Keith Busch
On Tue, Jul 26, 2022 at 04:55:54PM +0800, Jinhao Fan wrote: > > Hi Klaus and Keith, > > I just added support for interrupt masking. How can I test interrupt > masking? Are you asking about MSI masking? I don't think any drivers are using the feature, so you'd need to modify one to test it. I can

Re: [PATCH] hw/nvme: Add iothread support

2022-07-26 Thread Keith Busch
On Tue, Jul 26, 2022 at 11:32:57PM +0800, Jinhao Fan wrote: > at 10:45 PM, Keith Busch wrote: > > > On Tue, Jul 26, 2022 at 04:55:54PM +0800, Jinhao Fan wrote: > >> Hi Klaus and Keith, > >> > >> I just added support for interrupt masking. How can I test i

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] 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

Re: [RFC] hw/nvme: Use irqfd to send interrupts

2022-08-09 Thread Keith Busch
On Mon, Aug 08, 2022 at 10:23:03AM +0800, Jinhao Fan wrote: > at 12:35 PM, Jinhao Fan wrote: > > > static void nvme_irq_assert(NvmeCtrl *n, NvmeCQueue *cq) > > { > > if (cq->irq_enabled) { > > if (msix_enabled(&(n->parent_obj))) { > > +/* Initialize CQ irqfd */ > > +

Re: Re: [RFC] hw/nvme: Use irqfd to send interrupts

2022-08-09 Thread Keith Busch
On Wed, Aug 10, 2022 at 12:48:53AM +0800, 樊金昊 wrote: >> The driver will create the cq with an allocated vector, but it's not >> activated >> until after the driver wires it up to a handler. I think that's what you're >> observing with the incomplete MSIx table entry on creation. > > Also, I'm won

Re: [PATCH] hw/nvme: Add support for setting the MQES for the NVMe emulation

2024-04-04 Thread Keith Busch
create_sq() was getting its limit from when processing the host command, and sure enough it's directly from the register field. Reviewed-by: Keith Busch

[Qemu-devel] [PATCH] nvme: fix write zeroes offset and count

2019-03-11 Thread Keith Busch
The implementation used blocks units rather than the expected bytes. Fixes: c03e7ef12a9 ("nvme: Implement Write Zeroes") Reported-by: Ming Lei Signed-off-by: Keith Busch --- hw/block/nvme.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/block/nvme.c

Re: [PATCH v5 22/26] nvme: support multiple namespaces

2020-02-04 Thread Keith Busch
d 1. > > Signed-off-by: Klaus Jensen > Signed-off-by: Klaus Jensen I like this feature a lot, thanks for doing it. Reviewed-by: Keith Busch > @@ -1256,18 +1272,24 @@ static uint16_t nvme_smart_info(NvmeCtrl *n, NvmeCmd > *cmd, uint8_t rae, > uint64_t units_read = 0, un

Re: [PATCH v5 24/26] nvme: change controller pci id

2020-02-04 Thread Keith Busch
'x-use-intel-id' parameter to > the nvme device to force use of the Intel vendor and device id. This is > off by default but add a compat property to set this for machines 4.2 > and older. > > Signed-off-by: Klaus Jensen Yay, thank you for following through on getting this identifier assigned. Reviewed-by: Keith Busch

Re: [PATCH v5 26/26] nvme: make lba data size configurable

2020-02-04 Thread Keith Busch
On Tue, Feb 04, 2020 at 10:52:08AM +0100, Klaus Jensen wrote: > Signed-off-by: Klaus Jensen > --- > hw/block/nvme-ns.c | 2 +- > hw/block/nvme-ns.h | 4 +++- > hw/block/nvme.c| 1 + > 3 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c >

Re: [PATCH v5 00/26] nvme: support NVMe v1.3d, SGLs and multiple namespaces

2020-02-04 Thread Keith Busch
fault but is added as a machine compat >property to be true for machine types <= 4.2. > > - SGL mapping code has been refactored. Looking pretty good to me. For the series beyond the individually reviewed patches: Acked-by: Keith Busch If you need to send a v5, you may add my tag

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-12 Thread Keith Busch
On Thu, Jan 12, 2023 at 02:10:51PM +0100, Klaus Jensen wrote: > > The pin-based interrupt logic in hw/nvme seems sound enough to me, so I > am wondering if there is something going on with the kernel driver (but > I certainly do not rule out that hw/nvme is at fault here, since > pin-based interru

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-12 Thread Keith Busch
On Thu, Jan 12, 2023 at 06:45:55PM +0100, Klaus Jensen wrote: > On Jan 12 09:34, Keith Busch wrote: > > On Thu, Jan 12, 2023 at 02:10:51PM +0100, Klaus Jensen wrote: > > > > > > The pin-based interrupt logic in hw/nvme seems sound enough to me, so I > > > am w

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-12 Thread Keith Busch
On Thu, Jan 12, 2023 at 06:45:55PM +0100, Klaus Jensen wrote: > On Jan 12 09:34, Keith Busch wrote: > > On Thu, Jan 12, 2023 at 02:10:51PM +0100, Klaus Jensen wrote: > > > > > > The pin-based interrupt logic in hw/nvme seems sound enough to me, so I > > > am w

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-13 Thread Keith Busch
On Fri, Jan 13, 2023 at 12:32:29PM +, Peter Maydell wrote: > On Fri, 13 Jan 2023 at 08:55, Klaus Jensen wrote: > > > > +CC qemu pci maintainers > > > > Michael, Marcel, > > > > Do you have any comments on this thread? As you can see one solution is > > to simply deassert prior to asserting, th

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-16 Thread Keith Busch
On Mon, Jan 16, 2023 at 10:14:07PM +0100, Klaus Jensen wrote: > I noticed that the Linux driver does not use the INTMS/INTMC registers > to mask interrupts on the controller while processing CQEs. While not > required by the spec, it is *recommended* in setups not using MSI-X to > reduce the risk o

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-17 Thread Keith Busch
On Thu, Jan 12, 2023 at 02:10:51PM +0100, Klaus Jensen wrote: > Hi all (linux-nvme, qemu-devel, maintainers), > > On QEMU riscv64, which does not use MSI/MSI-X and thus relies on > pin-based interrupts, I'm seeing occasional completion timeouts, i.e. > > nvme nvme0: I/O 333 QID 1 timeout, compl

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-18 Thread Keith Busch
On Wed, Jan 18, 2023 at 03:04:06PM +, Peter Maydell wrote: > On Tue, 17 Jan 2023 at 19:21, Guenter Roeck wrote: > > Anyway - any idea what to do to help figuring out what is happening ? > > Add tracing support to pci interrupt handling, maybe ? > > For intermittent bugs, I like recording the

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-18 Thread Keith Busch
Klaus, This isn't going to help your issue, but there are at least two legacy irq bugs in the nvme qemu implementation. 1. The admin queue breaks if start with legacy and later initialize msix. 2. The legacy vector is shared among all queues, but it's being deasserted when the first queue's door

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-18 Thread Keith Busch
On Wed, Jan 18, 2023 at 09:33:05AM -0700, Keith Busch wrote: > On Wed, Jan 18, 2023 at 03:04:06PM +, Peter Maydell wrote: > > On Tue, 17 Jan 2023 at 19:21, Guenter Roeck wrote: > > > Anyway - any idea what to do to help figuring out what is happening ? > > >

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-18 Thread Keith Busch
On Thu, Jan 19, 2023 at 10:41:42AM +1000, Alistair Francis wrote: > On Thu, Jan 19, 2023 at 9:07 AM Keith Busch wrote: > > --- > > diff --git a/hw/intc/sifive_plic.c b/hw/intc/sifive_plic.c > > index c2dfacf028..f8f7af08dc 100644 > > --- a/hw/intc/sifive_plic.c >

Re: completion timeouts with pin-based interrupts in QEMU hw/nvme

2023-01-18 Thread Keith Busch
On Thu, Jan 19, 2023 at 01:10:57PM +1000, Alistair Francis wrote: > On Thu, Jan 19, 2023 at 12:44 PM Keith Busch wrote: > > > > Further up, it says the "interrupt gateway" is responsible for > > forwarding new interrupt requests while the level remains asserte

Re: [PATCH 0/2] hw/nvme: fix namespace attachment on controller hotplug

2021-11-16 Thread Keith Busch
ond patch changes the default for 'shared' such that namespaces > are shared by default and will thus by default be attached to hotplugged > controllers. This adds a compat property for older machine versions and > updates the documentation to reflect this. Series looks good. Reviewed-by: Keith Busch

Re: [PATCH v2 08/15] hw/nvme: Implement the Function Level Reset

2021-11-16 Thread Keith Busch
On Tue, Nov 16, 2021 at 04:34:39PM +0100, Łukasz Gieryk wrote: > if (!pci_is_vf(&n->parent_obj) && n->params.sriov_max_vfs) { > -pcie_sriov_pf_disable_vfs(&n->parent_obj); > +if (rst != NVME_RESET_CONTROLLER) { > +pcie_sriov_pf_disable_vfs(&n->parent_obj); Shouldn'

Re: [PATCH v3 1/2] hw/nvme: Implement shadow doorbell buffer support

2022-06-27 Thread Keith Busch
On Thu, Jun 16, 2022 at 08:34:07PM +0800, Jinhao Fan wrote: > } > sq->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, nvme_process_sq, sq); > > +if (n->dbbuf_enabled) { > +sq->db_addr = n->dbbuf_dbs + (sqid << 3); > +sq->ei_addr = n->dbbuf_eis + (sqid << 3); > +} > + >

Re: [PATCH] hw/nvme: Use ioeventfd to handle doorbell updates

2022-06-29 Thread Keith Busch
On Wed, Jun 29, 2022 at 05:04:25PM +0800, Jinhao Fan wrote: > Ping~ > > > @@ -4271,6 +4343,11 @@ static void nvme_init_sq(NvmeSQueue *sq, NvmeCtrl > > *n, uint64_t dma_addr, > > if (n->dbbuf_enabled) { > > sq->db_addr = n->dbbuf_dbs + (sqid << 3); > > sq->ei_addr = n->dbbuf_ei

Re: [PATCH v2] hw/nvme: Use ioeventfd to handle doorbell updates

2022-07-01 Thread Keith Busch
On Thu, Jun 30, 2022 at 11:22:31AM +0800, Jinhao Fan wrote: > +static int nvme_init_sq_ioeventfd(NvmeSQueue *sq) > +{ > +NvmeCtrl *n = sq->ctrl; > +uint16_t offset = sq->sqid << 3; > +int ret; > + > +ret = event_notifier_init(&sq->notifier, 0); > +if (ret < 0) { > +retur

Re: [PATCH v4] hw/nvme: Use ioeventfd to handle doorbell updates

2022-07-05 Thread Keith Busch
On Tue, Jul 05, 2022 at 07:11:36PM +0200, Klaus Jensen wrote: > On Jul 5 22:24, Jinhao Fan wrote: > > @@ -1374,7 +1374,14 @@ static void nvme_enqueue_req_completion(NvmeCQueue > > *cq, NvmeRequest *req) > > > > QTAILQ_REMOVE(&req->sq->out_req_list, req, entry); > > QTAILQ_INSERT_TAIL(

Re: [PATCH v2 0/6] hw/nvme: enhanced protection information (64-bit guard)

2022-03-01 Thread Keith Busch
inux kernel[1]. > > [1]: > https://lore.kernel.org/linux-nvme/20220201190128.3075065-1-kbu...@kernel.org/ Thanks Klaus, this looks good to me. Reviewed-by: Keith Busch

Re: [PATCH] hw/nvme: fix CVE-2021-3929

2022-01-20 Thread Keith Busch
updated if that assumption ever changes. Reviewed-by: Keith Busch

Re: [PATCH for-7.0 1/4] hw/nvme: add struct for zone management send

2022-01-26 Thread Keith Busch
t; +uint64_tslba; > +uint32_trsvd12; > +uint8_t zsa; > +uint8_t zsflags[3]; This should be just a single uint8_t for zsflags, followed by 'uint8_t rsvd[2]'. Otherwise, looks good. Reviewed-by: Keith Busch

Re: [PATCH for-7.0 3/4] hw/nvme: add ozcs enum

2022-01-26 Thread Keith Busch
On Thu, Nov 25, 2021 at 08:37:34AM +0100, Klaus Jensen wrote: > From: Klaus Jensen > > Add enumeration for OZCS values. Looks good. Reviewed-by: Keith Busch

Re: [PATCH for-7.0 2/4] hw/nvme: add zone attribute get/set helpers

2022-01-26 Thread Keith Busch
On Thu, Nov 25, 2021 at 08:37:33AM +0100, Klaus Jensen wrote: > @@ -295,7 +295,7 @@ static void nvme_assign_zone_state(NvmeNamespace *ns, > NvmeZone *zone, > case NVME_ZONE_STATE_READ_ONLY: > break; > default: > -zone->d.za = 0; > +NVME_ZA_CLEAR_ALL(zone->d.za);

Re: [PATCH for-7.0 4/4] hw/nvme: add support for zoned random write area

2022-01-26 Thread Keith Busch
rwa resources, i.e. number of zones that can have a zrwa), > "zoned.zrwas" (zrwa size in LBAs), "zoned.zrwafg" (granularity in LBAs > for flushes). > > Signed-off-by: Klaus Jensen Looks good, and will just need a minor update if you choose to take the feedback from patch 2 onboard. Reviewed-by: Keith Busch

Re: [PATCH v8 00/12] hw/nvme: SR-IOV with Virtualization Enhancements

2022-05-17 Thread Keith Busch
On Tue, May 17, 2022 at 01:04:56PM +0200, Klaus Jensen wrote: > > > > Should we consider this series ready to merge? > > > > Hi Lukasz and Lukasz :) > > Yes, I'm queing this up. FWIW, this looks good to me. I was hoping to give it a test run, but I don't think I'll get to that for another week

Re: [PATCH 6/6] hw/nvme: 64-bit pi support

2022-02-16 Thread Keith Busch
On Mon, Feb 14, 2022 at 01:30:29PM +0100, Klaus Jensen wrote: > @@ -384,6 +389,12 @@ static int nvme_ns_check_constraints(NvmeNamespace *ns, > Error **errp) > return -1; > } > > +if (ns->params.pif != NVME_PI_GUARD_16 && > +ns->params.pif != NVME_PI_GUARD_64) { > +

Re: [PATCH 0/6] hw/nvme: enhanced protection information (64-bit guard)

2022-02-16 Thread Keith Busch
Linux kernel[1]. > > [1]: > https://lore.kernel.org/linux-nvme/20220201190128.3075065-1-kbu...@kernel.org/ Other than comment on 6/6, series looks good to me. Reviewed-by: Keith Busch

Re: Call for GSoC and Outreachy project ideas for summer 2022

2022-02-22 Thread Keith Busch
On Tue, Feb 22, 2022 at 09:48:06AM +, Stefan Hajnoczi wrote: > On Mon, 21 Feb 2022 at 12:00, Klaus Jensen wrote: > > > > Yes, I'll go ahead as mentor for this. > > > > @Keith, if you want to join in, let us know :) Thank you for setting this up, I would be happy assist with the cause! > > Su

Re: [PATCH v2 2/3] hw/nvme: use KVM irqfd when available

2022-08-26 Thread Keith Busch
On Fri, Aug 26, 2022 at 05:45:21PM +0200, Klaus Jensen wrote: > On Aug 26 09:34, Keith Busch wrote: > > On Fri, Aug 26, 2022 at 11:12:04PM +0800, Jinhao Fan wrote: > > > Use KVM's irqfd to send interrupts when possible. This approach is > > > thread safe. More

Re: [PATCH v2 2/3] hw/nvme: use KVM irqfd when available

2022-08-26 Thread Keith Busch
On Fri, Aug 26, 2022 at 11:12:04PM +0800, Jinhao Fan wrote: > Use KVM's irqfd to send interrupts when possible. This approach is > thread safe. Moreover, it does not have the inter-thread communication > overhead of plain event notifiers since handler callback are called > in the same system call a

Re: [PATCH 4/5] hw/nvme: basic directives support

2023-02-16 Thread Keith Busch
On Thu, Feb 16, 2023 at 05:48:05PM +0100, Jesper Devantier wrote: > +enum NvmeDirective { > +NVME_DIRECTIVE_SUPPORTED = 0x0, > +NVME_DIRECTIVE_ENABLED = 0x1, > +}; What's this?

Re: [PATCH 4/5] hw/nvme: basic directives support

2023-02-16 Thread Keith Busch
On Thu, Feb 16, 2023 at 06:35:27PM +0100, Klaus Jensen wrote: > On Thu, Feb 16, 2023, at 18:23, Keith Busch wrote: > > On Thu, Feb 16, 2023 at 05:48:05PM +0100, Jesper Devantier wrote: > >> +enum NvmeDirective { > >> +NVME_DIRECTIVE_SUPPORTED = 0x0, > >>

Re: [PATCH 5/5] hw/nvme: flexible data placement emulation

2023-02-16 Thread Keith Busch
This mostly looks fine. I need to clarify some spec decisions, though. By default, FDP feature is disabled: "The default value of this Feature shall be 0h." You can't change the value as long as namespaces exist within the group, so FDP requires NS Mgmt be supported if you're going to enable it. T

Re: [PATCH 5/5] hw/nvme: flexible data placement emulation

2023-02-16 Thread Keith Busch
On Thu, Feb 16, 2023 at 05:48:06PM +0100, Jesper Devantier wrote: > +static bool nvme_ns_init_fdp(NvmeNamespace *ns, Error **errp) > +{ > +NvmeEnduranceGroup *endgrp = ns->endgrp; > +NvmeRuHandle *ruh; > +uint8_t lbafi = NVME_ID_NS_FLBAS_INDEX(ns->id_ns.flbas); > +unsigned int *ruhi

Re: [PATCH v2 5/5] hw/nvme: flexible data placement emulation

2023-02-17 Thread Keith Busch
nlb); > + > +while (nlb) { > +if (nlb < ru->ruamw) { > +ru->ruamw -= nlb; > +break; > +} > + > +nlb -= ru->ruamw; > +//trace_pci_nvme_fdp_ruh_change(ruh->rgid, ruh->ruhid); Please use the trace points if you find them useful, otherwise just delete them instead of committing commented out code. Beyond that, looks good! For the series: Reviewed-by: Keith Busch

Re: [PATCHv2] block: use the request length for iov alignment

2022-09-29 Thread Keith Busch
On Fri, Sep 23, 2022 at 08:34:51AM -0700, Keith Busch wrote: > > An iov length needs to be aligned to the logical block size, which may > be larger than the memory alignment. And since this is only used with > file-posix backing storage, move the alignment function to there, where &g

Re: Commit 'iomap: add support for dma aligned direct-io' causes qemu/KVM boot failures

2022-09-29 Thread Keith Busch
On Thu, Sep 29, 2022 at 07:16:29PM +0300, Maxim Levitsky wrote: > On Thu, 2022-09-29 at 09:48 -0600, Keith Busch wrote: > > I am aware, and I've submitted the fix to qemu here: > > > > https://lists.nongnu.org/archive/html/qemu-block/2022-09/msg00398.html > > &

Re: Commit 'iomap: add support for dma aligned direct-io' causes qemu/KVM boot failures

2022-09-29 Thread Keith Busch
I am aware, and I've submitted the fix to qemu here: https://lists.nongnu.org/archive/html/qemu-block/2022-09/msg00398.html

Re: [PATCHv2] block: use the request length for iov alignment

2022-09-29 Thread Keith Busch
On Thu, Sep 29, 2022 at 07:59:50PM +0200, Kevin Wolf wrote: > Am 29.09.2022 um 18:09 hat Keith Busch geschrieben: > > On Fri, Sep 23, 2022 at 08:34:51AM -0700, Keith Busch wrote: > > > > > > An iov length needs to be aligned to the logical block size, which may >

[PATCHv3 2/2] block: use the request length for iov alignment

2022-09-29 Thread Keith Busch
From: Keith Busch An iov length needs to be aligned to the logical block size, which may be larger than the memory alignment. Tested-by: Jens Axboe Signed-off-by: Keith Busch --- block/file-posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b

[PATCHv3 1/2] block: move bdrv_qiov_is_aligned to file-posix

2022-09-29 Thread Keith Busch
From: Keith Busch There is only user of bdrv_qiov_is_aligned(), so move the alignment function to there and make it static. Signed-off-by: Keith Busch --- block/file-posix.c | 21 + block/io.c | 21 - include/block/block-io.h | 1

[PATCHv3 0/2] qemu direct io alignment fix

2022-09-29 Thread Keith Busch
From: Keith Busch Changes from v2: Split the patch so that the function move is separate from the functional change. This makes it immediately obvious what criteria is changing. (Kevin Wolf) Added received Tested-by tag in the changelog. Keith Busch (2): block: move

Re: Commit 'iomap: add support for dma aligned direct-io' causes qemu/KVM boot failures

2022-10-02 Thread Keith Busch
On Sun, Oct 02, 2022 at 11:59:42AM +0300, Maxim Levitsky wrote: > On Thu, 2022-09-29 at 19:35 +0200, Paolo Bonzini wrote: > > On 9/29/22 18:39, Christoph Hellwig wrote: > > > On Thu, Sep 29, 2022 at 10:37:22AM -0600, Keith Busch wrote: > > > > > I am aware, and I&

Re: [PATCH] hw/nvme: reenable cqe batching

2022-10-20 Thread Keith Busch
bottom halfs and instead of > calling nvme_post_cqes() immediately (causing an interrupt per cqe), we > defer the call. Nice change, looks good! Timers never did seem to be the best fit for this. Reviewed-by: Keith Busch

Re: [PATCH v3 1/2] hw/nvme: Support for Namespaces Management from guest OS - create-ns

2022-10-27 Thread Keith Busch
On Thu, Oct 27, 2022 at 01:00:45PM -0500, Jonathan Derrick wrote: > +Parameters: > + > +``auto-ns-path=`` > + If specified indicates a support for dynamic management of nvme namespaces > + by means of nvme create-ns command. This path points > + to the storage area for backend images must exist.

Re: [PATCH 1/2] hw/nvme: Implement shadow doorbell buffer support

2022-06-09 Thread Keith Busch
On Wed, Jun 08, 2022 at 10:55:30PM +0200, Klaus Jensen wrote: > > Keith, is this a bug in the kernel? If the code here would expect the > doorbell buffer to be updated for the admin queue as well, would we > break? The admin queue has to be created before db buffer can be set up, so we can't rely

Re: [PATCH 1/2] hw/nvme: Implement shadow doorbell buffer support

2022-06-13 Thread Keith Busch
On Sun, Jun 12, 2022 at 07:40:55PM +0800, Jinhao Fan wrote: > > > On Jun 10, 2022, at 1:27 AM, Klaus Jensen wrote: > > > > I'm ok with following the concensus here, but we all agree that this is > > a blatant spec violation that ended up manifesting itself down the > > stack, right? > > > > So.

Re: [PATCH 1/2] hw/nvme: Implement shadow doorbell buffer support

2022-06-14 Thread Keith Busch
On Tue, Jun 14, 2022 at 03:24:37PM +0800, Jinhao Fan wrote: > > On Jun 14, 2022, at 5:15 AM, Keith Busch wrote: > > @@ -6538,9 +6544,25 @@ static void nvme_process_db(NvmeCtrl *n, hwaddr > > addr, int val) > > > > trace_pci_nvme_mmio_doorbell_sq(sq->sqid

Re: [PATCH 0/4] hw/nvme: add support for TP4084

2022-06-16 Thread Keith Busch
On Thu, Jun 16, 2022 at 12:42:49PM +0200, Klaus Jensen wrote: > On Jun 8 03:28, Niklas Cassel via wrote: > > Hello there, > > > > considering that Linux v5.19-rc1 is out which includes support for > > NVMe TP4084: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drive

Re: [PATCH v3 0/2] hw/nvme: Add shadow doorbell buffer support

2022-06-17 Thread Keith Busch
; entry to being greater than that value. Therefore, the number of MMIO's > on the doorbell registers is greatly reduced. Looks good to me, and passes my sanity tests. Reviewed-by: Keith Busch

  1   2   3   4   >