[PULL 10/11] hw/nvme: deprecate the use-intel-id compatibility parameter

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen Since version 5.2 commit 6eb7a071292a ("hw/block/nvme: change controller pci id"), the emulated NVMe controller has defaulted to a non-Intel PCI identifier. Deprecate the compatibility parameter so we can get rid of it once and for all. Reviewed-by: Philippe Mat

[PULL 08/11] hw/nvme: do not report null uuid

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen Do not report the "null uuid" (all zeros) in the namespace identification descriptors. Reported-by: Luis Chamberlain Reported-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/c

[PULL 05/11] hw/nvme: enforce common serial per subsystem

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen The Identify Controller Serial Number (SN) is the serial number for the NVM subsystem and must be the same across all controller in the NVM subsystem. Enforce this. Reviewed-by: Christoph Hellwig Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/nvme.h

[PULL 03/11] hw/nvme: fix copy cmd for pi enabled namespaces

2022-06-03 Thread Klaus Jensen
-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 74540a03d518..08574c4dcbc8 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -2787,6 +2787,10 @@ static void nvme_copy_in_completed_cb

[PULL 07/11] hw/nvme: do not auto-generate uuid

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen Do not default to generate an UUID for namespaces if it is not explicitly specified. This is a technically a breaking change in behavior. However, since the UUID changes on every VM launch, it is not spec compliant and is of little use since the UUID cannot be used reliably

[PULL 04/11] hw/nvme: fix smart aen

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen Pass the right constant to nvme_smart_event(). The NVME_AER* values hold the bit position in the SMART byte, not the shifted value that we expect it to be in nvme_smart_event(). Fixes: c62720f137df ("hw/block/nvme: trigger async event during injecting smart warning&qu

[PULL 01/11] hw/nvme: fix narrowing conversion

2022-06-03 Thread Klaus Jensen
->moff which breaks namespace Signed-off-by: Dmitry Tikhov Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ns.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/nvme/ns.c b/hw/nvme/ns.c index 324f53ea0cd1..af6504fad2d8 100644 --- a/hw/nvme/ns.c +++ b

[PULL 06/11] hw/nvme: do not auto-generate eui64

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen We cannot provide auto-generated unique or persistent namespace identifiers (EUI64, NGUID, UUID) easily. Since 6.1, namespaces have been assigned a generated EUI64 of the form "52:54:00:". This is will be unique within a QEMU instance, but not globally. Revert th

[PULL 02/11] hw/nvme: add missing return statement

2022-06-03 Thread Klaus Jensen
d because of missing return on call stack unwinding by calling blk_aio_pwrite_zeroes and subsequent nvme_dsm_cb callback. Fixes: d7d1474fd85d ("hw/nvme: reimplement dsm to allow cancellation") Signed-off-by: Dmitry Tikhov Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/n

[PULL 00/11] hw/nvme updates

2022-06-03 Thread Klaus Jensen
From: Klaus Jensen Hi Peter, The following changes since commit 70e975203f366f2f30daaeb714bb852562b7b72f: Merge tag 'pull-request-2022-06-03' of https://gitlab.com/thuth/qemu into staging (2022-06-03 06:43:38 -0700) are available in the Git repository at: git://git.infradea

Re: [PATCH] hw/nvme: add new command abort case

2022-05-31 Thread Klaus Jensen
On Apr 20 14:48, Klaus Jensen wrote: > On Apr 20 15:31, Dmitry Tikhov wrote: > > On Wed, Apr 20, 2022 at 12:54:44, Klaus Jensen wrote: > > > > > > NVM Command Set Specification v1.0b, Section 5.2.3. It is exactly what > > > you quoted above. >

Re: [PATCH] hw/nvme: add new command abort case

2022-05-31 Thread Klaus Jensen
On May 31 13:13, Klaus Jensen wrote: > On Apr 20 14:48, Klaus Jensen wrote: > > On Apr 20 15:31, Dmitry Tikhov wrote: > > > On Wed, Apr 20, 2022 at 12:54:44, Klaus Jensen wrote: > > > > > > > > NVM Command Set Specification v1.0b, Section 5.2.3. I

[PATCH] hw/nvme: add command set independent identify namespace

2022-05-30 Thread Klaus Jensen
From: Klaus Jensen Add support for the command set independent identify namespace data structure (CNS 0x8). Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 28 hw/nvme/trace-events | 1 + include/block/nvme.h | 16 3 files changed, 45

Re: [PATCH] hw/nvme: deprecate the use-intel-id compatibility parameter

2022-05-30 Thread Klaus Jensen
On May 30 16:37, Philippe Mathieu-Daudé wrote: > On 29/4/22 07:41, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Since version 5.2 commit 6eb7a071292a ("hw/block/nvme: change controller > > pci id"), the emulated NVMe controller has defaul

[PATCH v2] hw/nvme: clean up CC register write logic

2022-05-25 Thread Klaus Jensen
From: Klaus Jensen The SRIOV series exposed an issued with how CC register writes are handled and how CSTS is set in response to that. Specifically, after applying the SRIOV series, the controller could end up in a state with CC.EN set to '1' but with CSTS.RDY cleared to '0'

Re: [PATCH] hw/nvme: clean up CC register write logic

2022-05-25 Thread Klaus Jensen
On May 19 14:11, Lukasz Maniak wrote: > On Tue, May 17, 2022 at 01:16:05PM +0200, Klaus Jensen wrote: > > From: Klaus Jensen > > > > The SRIOV series exposed an issued with how CC register writes are > > handled and how CSTS is set in response to that. Specifically, a

[PATCH] hw/nvme: clean up CC register write logic

2022-05-17 Thread Klaus Jensen
From: Klaus Jensen The SRIOV series exposed an issued with how CC register writes are handled and how CSTS is set in response to that. Specifically, after applying the SRIOV series, the controller could end up in a state with CC.EN set to '1' but with CSTS.RDY cleared to '0'

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

2022-05-17 Thread Klaus Jensen
On May 16 17:25, Lukasz Maniak wrote: > On Mon, May 09, 2022 at 04:16:08PM +0200, Lukasz Maniak wrote: > > Changes since v7: > > - Fixed description of hw/acpi: Make the PCI hot-plug aware of SR-IOV > > - Added description to docs: Add documentation for SR-IOV and > > Virtualization Enhancements

[PATCH] hw/nvme: clear aen mask on reset

2022-05-12 Thread Klaus Jensen
From: Klaus Jensen The internally maintained AEN mask is not cleared on reset. Fix this. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 1e6e0fcad918..4c8200dfb859 100644 --- a/hw/nvme/ctrl.c +++ b/hw

Re: [PATCH v2 0/5] hw/nvme: fix namespace identifiers

2022-05-12 Thread Klaus Jensen
On Apr 29 10:33, Klaus Jensen wrote: > From: Klaus Jensen > > The namespace identifiers reported by the controller is kind of a mess. > See [1,2]. > > This series should fix this for both the `-device nvme,drive=...` and > `-device nvme-ns,...` cases. > > [1]: ht

Re: [PATCH] hw/nvme: fix smart aen

2022-05-11 Thread Klaus Jensen
On May 6 08:36, Klaus Jensen wrote: > From: Klaus Jensen > > Pass the right constant to nvme_smart_event(). The NVME_AER* values hold > the bit position in the SMART byte, not the shifted value that we expect > it to be in nvme_smart_event(). > > Fixes: c62720f137df (&q

Re: [PATCH 0/2] hw/nvme: support smart AEN

2022-05-09 Thread Klaus Jensen
On May 7 15:26, zhenwei pi wrote: > Hi, > In this series, firstly introduce smart related bits of aen cfg, then > support this in oaes. > > Linux guest does not support this currently, I also send a series to > enable smart AEN: > https://lore.kernel.org/lkml/20220507065026.260306-1-pizhen...@byt

[PATCH] hw/nvme: fix smart aen

2022-05-05 Thread Klaus Jensen
From: Klaus Jensen Pass the right constant to nvme_smart_event(). The NVME_AER* values hold the bit position in the SMART byte, not the shifted value that we expect it to be in nvme_smart_event(). Fixes: c62720f137df ("hw/block/nvme: trigger async event during injecting smart warning&quo

[PATCH v2 5/5] hw/nvme: bump firmware revision

2022-04-29 Thread Klaus Jensen
From: Klaus Jensen The Linux kernel quirks the QEMU NVMe controller pretty heavily because of the namespace identifier mess. Since this is now fixed, bump the firmware revision number to allow the quirk to be disabled for this revision. As of now, bump the firmware revision number to be equal

[PATCH v2 4/5] hw/nvme: do not report null uuid

2022-04-29 Thread Klaus Jensen
From: Klaus Jensen Do not report the "null uuid" (all zeros) in the namespace identification descriptors. Reported-by: Luis Chamberlain Reported-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/c

[PATCH v2 3/5] hw/nvme: do not auto-generate uuid

2022-04-29 Thread Klaus Jensen
From: Klaus Jensen Do not default to generate an UUID for namespaces if it is not explicitly specified. This is a technically a breaking change in behavior. However, since the UUID changes on every VM launch, it is not spec compliant and is of little use since the UUID cannot be used reliably

[PATCH v2 2/5] hw/nvme: do not auto-generate eui64

2022-04-29 Thread Klaus Jensen
From: Klaus Jensen We cannot provide auto-generated unique or persistent namespace identifiers (EUI64, NGUID, UUID) easily. Since 6.1, namespaces have been assigned a generated EUI64 of the form "52:54:00:". This is will be unique within a QEMU instance, but not globally. Revert th

[PATCH v2 0/5] hw/nvme: fix namespace identifiers

2022-04-29 Thread Klaus Jensen
From: Klaus Jensen The namespace identifiers reported by the controller is kind of a mess. See [1,2]. This series should fix this for both the `-device nvme,drive=...` and `-device nvme-ns,...` cases. [1]: https://lore.kernel.org/linux-nvme/20220224192845.1097602-1-...@lst.de/ [2]: https

[PATCH v2 1/5] hw/nvme: enforce common serial per subsystem

2022-04-29 Thread Klaus Jensen
From: Klaus Jensen The Identify Controller Serial Number (SN) is the serial number for the NVM subsystem and must be the same across all controller in the NVM subsystem. Enforce this. Reviewed-by: Christoph Hellwig Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/nvme.h

[PATCH] hw/nvme: deprecate the use-intel-id compatibility parameter

2022-04-28 Thread Klaus Jensen
From: Klaus Jensen Since version 5.2 commit 6eb7a071292a ("hw/block/nvme: change controller pci id"), the emulated NVMe controller has defaulted to a non-Intel PCI identifier. Deprecate the compatibility parameter so we can get rid of it once and for all. Signed-off-by: Klaus Jensen

Re: [PATCH v2] hw/nvme: fix copy cmd for pi enabled namespaces

2022-04-28 Thread Klaus Jensen
On Apr 21 13:51, Dmitry Tikhov wrote: > Current implementation have problem in the read part of copy command. > Because there is no metadata mangling before nvme_dif_check invocation, > reftag error could be thrown for blocks of namespace that have not been > previously written to. > > Signed-off-

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

2022-04-28 Thread Klaus Jensen
> hw/nvme/subsys.c | 75 +++- > hw/nvme/trace-events | 6 + > include/block/nvme.h | 65 > include/hw/pci/pci_ids.h | 1 + > 9 files changed, 909 insertions(+), 56 deletions(-) > Series (hw/nvme parts) looks good. Reviewed-by: Klaus Jensen signature.asc Description: PGP signature

Re: [PATCH] nvme: fix bit buckets

2022-04-25 Thread Klaus Jensen
+qemu-devel On Apr 22 09:37, Keith Busch wrote: > We can't just ignore the bit buckets since the data offsets read from > disk need to be accounted for. We could either split into multiple reads > for the actual user data requested and skip the buckets, or we could > have a place holder for bucket

Re: [PATCH 2/2] hw/nvme: fix copy cmd for pi enabled namespaces

2022-04-21 Thread Klaus Jensen
On Apr 21 10:41, Dmitry Tikhov wrote: > On Wed, Apr 20, 2022 at 21:16:15, Klaus Jensen wrote: > > Discussed this with the TP authors and, no, reftag should not be > > re-computed for PRACT 0, regardless of the PI type. > Ok, should i resend patch with only adding nvme_dif_man

Re: [PATCH 2/2] hw/nvme: fix copy cmd for pi enabled namespaces

2022-04-20 Thread Klaus Jensen
On Apr 20 12:04, Klaus Jensen wrote: > On Apr 20 12:03, Dmitry Tikhov wrote: > > Current implementation have two problems: > > First in the read part of copy command. Because there is no metadata > > mangling before nvme_dif_check invocation, reftag error is thrown for > &g

Re: [PATCH] hw/nvme: add new command abort case

2022-04-20 Thread Klaus Jensen
On Apr 20 15:31, Dmitry Tikhov wrote: > On Wed, Apr 20, 2022 at 12:54:44, Klaus Jensen wrote: > > > > NVM Command Set Specification v1.0b, Section 5.2.3. It is exactly what > > you quoted above. > > > > I think you are interpreting > > > > "If

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

2022-04-20 Thread Klaus Jensen
On Apr 20 08:02, Michael S. Tsirkin wrote: > On Fri, Mar 18, 2022 at 08:18:07PM +0100, Lukasz Maniak wrote: > > Resubmitting v6 as v7 since Patchew got lost with my sophisticated CC of > > all maintainers just for the cover letter. > > > > Changes since v5: > > - Fixed PCI hotplug issue related to

Re: [PATCH] hw/nvme: add new command abort case

2022-04-20 Thread Klaus Jensen
On Apr 20 13:41, Dmitry Tikhov wrote: > On Wed, Apr 20, 2022 at 12:36:54, Klaus Jensen wrote: > > On Apr 20 12:13, Klaus Jensen wrote: > > > On Apr 20 11:20, Dmitry Tikhov wrote: > > > > NVMe command set specification for end-to-end data protection form

Re: [PATCH] hw/nvme: add new command abort case

2022-04-20 Thread Klaus Jensen
On Apr 20 12:13, Klaus Jensen wrote: > On Apr 20 11:20, Dmitry Tikhov wrote: > > NVMe command set specification for end-to-end data protection formatted > > namespace states: > > > > o If the Reference Tag Check bit of the PRCHK field is set to ‘1’ and > >

Re: [PATCH] hw/nvme: add new command abort case

2022-04-20 Thread Klaus Jensen
On Apr 20 11:20, Dmitry Tikhov wrote: > NVMe command set specification for end-to-end data protection formatted > namespace states: > > o If the Reference Tag Check bit of the PRCHK field is set to ‘1’ and > the namespace is formatted for Type 3 protection, then the > controller: >

Re: [PATCH 2/2] hw/nvme: fix copy cmd for pi enabled namespaces

2022-04-20 Thread Klaus Jensen
On Apr 20 12:03, Dmitry Tikhov wrote: > Current implementation have two problems: > First in the read part of copy command. Because there is no metadata > mangling before nvme_dif_check invocation, reftag error is thrown for > blocks of namespace that have not been previously written to. Yes, this

Re: [PATCH 4/5] hw/nvme: do not auto-generate uuid

2022-04-19 Thread Klaus Jensen
On Apr 20 08:53, Christoph Hellwig wrote: > On Wed, Apr 20, 2022 at 07:51:32AM +0200, Klaus Jensen wrote: > > > So unlike the EUI, UUIDs are designed to be autogenerated even if the > > > current algorithm is completely broken. We'd just need to persist them. > &

Re: [PATCH 2/5] hw/nvme: always set eui64

2022-04-19 Thread Klaus Jensen
On Apr 20 07:48, Klaus Jensen wrote: > On Apr 20 07:30, Christoph Hellwig wrote: > > Also EUI64 values are based on a OUI, while NVME_EUI64_DEFAULT seems > > to have the OUI values cleared to all zero as far as I can tell. > > > > It really should be a u8 array,

Re: [PATCH 4/5] hw/nvme: do not auto-generate uuid

2022-04-19 Thread Klaus Jensen
On Apr 20 07:33, Christoph Hellwig wrote: > On Tue, Apr 19, 2022 at 02:10:38PM +0200, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Do not default to generate an UUID for namespaces if it is not > > explicitly specified. > > > > This is a technically

Re: [PATCH 2/5] hw/nvme: always set eui64

2022-04-19 Thread Klaus Jensen
On Apr 20 07:30, Christoph Hellwig wrote: > On Tue, Apr 19, 2022 at 02:10:36PM +0200, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Unconditionally set an EUI64 for namespaces. The nvme-ns device defaults > > to auto-generating a persistent EUI64 if no

[PATCH 5/5] hw/nvme: bump firmware revision

2022-04-19 Thread Klaus Jensen
From: Klaus Jensen The Linux kernel quirks the QEMU NVMe controller pretty heavily because of the namespace identifier mess. Since this is now fixed, bump the firmware revision number to allow the quirk to be disabled for this revision. As of now, bump the firmware revision number to be equal

[PATCH 4/5] hw/nvme: do not auto-generate uuid

2022-04-19 Thread Klaus Jensen
From: Klaus Jensen Do not default to generate an UUID for namespaces if it is not explicitly specified. This is a technically a breaking change in behavior. However, since the UUID changes on every VM launch, it is not spec compliant and is of little use since the UUID cannot be used reliably

[PATCH 1/5] hw/nvme: enforce common serial per subsystem

2022-04-19 Thread Klaus Jensen
From: Klaus Jensen The Identify Controller Serial Number (SN) is the serial number for the NVM subsystem and must be the same across all controller in the NVM subsystem. Enforce this. Signed-off-by: Klaus Jensen --- hw/nvme/nvme.h | 1 + hw/nvme/subsys.c | 7 +++ 2 files changed, 8

[PATCH 3/5] hw/nvme: do not report null uuid

2022-04-19 Thread Klaus Jensen
From: Klaus Jensen Do not report the "null uuid" (all zeros) in the namespace identification descriptors. Reported-by: Luis Chamberlain Reported-by: Christoph Hellwig Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 17 +++-- 1 file changed, 7 insertions(+), 10

[PATCH 0/5] hw/nvme: fix namespace identifiers

2022-04-19 Thread Klaus Jensen
From: Klaus Jensen The namespace identifiers reported by the controller is kind of a mess. See [1,2]. This series should fix this for both the `-device nvme,drive=...` and `-device nvme-ns,...` cases. [1]: https://lore.kernel.org/linux-nvme/20220224192845.1097602-1-...@lst.de/ [2]: https

[PATCH 2/5] hw/nvme: always set eui64

2022-04-19 Thread Klaus Jensen
From: Klaus Jensen Unconditionally set an EUI64 for namespaces. The nvme-ns device defaults to auto-generating a persistent EUI64 if not specified, but for single namespace setups (-device nvme,drive=...), this does not happen. Since the EUI64 has previously been zeroed it is not considered

Re: [PATCH v2] hw/nvme: add missing return statement

2022-04-17 Thread Klaus Jensen
On Apr 15 23:48, Dmitry Tikhov wrote: > Since there is no return after nvme_dsm_cb invocation, metadata > associated with non-zero block range is currently zeroed. Also this > behaviour leads to segfault since we schedule iocb->bh two times. > First when entering nvme_dsm_cb with iocb->idx == iocb-

Re: [PATCH] hw/nvme: fix narrowing conversion

2022-04-17 Thread Klaus Jensen
On Apr 12 11:59, Dmitry Tikhov wrote: > Since nlbas is of type int, it does not work with large namespace size > values, e.g., 9 TB size of file backing namespace and 8 byte metadata > with 4096 bytes lbasz gives negative nlbas value, which is later > promoted to negative int64_t type value and res

Re: [PATCH] hw/nvme: fix control flow statement

2022-04-15 Thread Klaus Jensen
On Apr 15 23:23, Dmitry Tikhov wrote: > On Fri, Apr 15, 2022 at 21:42:05, Klaus Jensen wrote: > > On Apr 15 13:35, Keith Busch wrote: > > > On Fri, Apr 15, 2022 at 10:27:21PM +0300, Dmitry Tikhov wrote: > > > > Since there is no else after nvme_dsm_cb invocation, me

Re: [PATCH] hw/nvme: fix control flow statement

2022-04-15 Thread Klaus Jensen
On Apr 15 13:35, Keith Busch wrote: > On Fri, Apr 15, 2022 at 10:27:21PM +0300, Dmitry Tikhov wrote: > > Since there is no else after nvme_dsm_cb invocation, metadata associated > > with non-zero block range is currently zeroed. Also this behaviour leads > > to segfault since we schedule iocb->bh t

Re: [PATCH] hw/nvme: fix narrowing conversion

2022-04-12 Thread Klaus Jensen
f = (int64_t)nlbas << ns->lbaf.ds; > +ns->moff = nlbas << ns->lbaf.ds; > > npdg = ns->blkconf.discard_granularity / ns->lbasz; > > -- > 2.35.1 > Thanks Dmitry. Looks reasonable, Reviewed-by: Klaus Jensen signature.asc Description: PGP signature

Re: [PATCH v2 3/3] Use g_new() & friends where that makes obvious sense

2022-03-22 Thread Klaus Jensen
Signed-off-by: Markus Armbruster > Reviewed-by: Philippe Mathieu-Daudé > Reviewed-by: Cédric Le Goater > Reviewed-by: Alex Bennée > Acked-by: Dr. David Alan Gilbert > --- > hw/nvme/ns.c | 2 +- For hw/nvme, Acked-by: Klaus Jensen signature.asc Description: PGP signature

Re: [PATCH v5 14/15] docs: Add documentation for SR-IOV and Virtualization Enhancements

2022-03-21 Thread Klaus Jensen
On Mar 21 13:36, Lukasz Maniak wrote: > On Tue, Mar 01, 2022 at 01:23:18PM +0100, Klaus Jensen wrote: > > On Feb 17 18:45, Lukasz Maniak wrote: > > > Signed-off-by: Lukasz Maniak > > > > Please add a short commit description as well. Otherwise, > > K

[PULL 3/6] hw/nvme: move format parameter parsing

2022-03-03 Thread Klaus Jensen
From: Klaus Jensen There is no need to extract the format command parameters for each namespace. Move it to the entry point. Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-) diff

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

2022-03-03 Thread Klaus Jensen
/ Reviewed-by: Keith Busch Signed-off-by: Naveen Nagar Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 163 +++ hw/nvme/dif.c| 363 +-- hw/nvme/dif.h| 143 - hw/nvme/ns.c | 35 - hw/nvme

[PULL 4/6] hw/nvme: add support for the lbafee hbs feature

2022-03-03 Thread Klaus Jensen
From: Naveen Nagar Add support for up to 64 LBA formats through the LBAFEE field of the Host Behavior Support feature. Reviewed-by: Keith Busch Signed-off-by: Naveen Nagar Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 34 +++--- hw/nvme/ns.c | 15

[PULL 5/6] hw/nvme: add pi tuple size helper

2022-03-03 Thread Klaus Jensen
From: Klaus Jensen A subsequent patch will introduce a new tuple size; so add a helper and use that instead of sizeof() and magic numbers. Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 14 -- hw/nvme/dif.c | 16 hw/nvme/dif.h | 5

[PULL 2/6] hw/nvme: add host behavior support feature

2022-03-03 Thread Klaus Jensen
From: Naveen Nagar Add support for getting and setting the Host Behavior Support feature. Reviewed-by: Keith Busch Signed-off-by: Naveen Nagar Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 8 hw/nvme/nvme.h | 4 +++- include/block/nvme.h | 9 + 3 files

[PULL 1/6] hw/nvme: move dif/pi prototypes into dif.h

2022-03-03 Thread Klaus Jensen
From: Klaus Jensen Move dif/pi data structures and inlines to dif.h. Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 1 + hw/nvme/dif.c | 1 + hw/nvme/dif.h | 53 ++ hw/nvme/nvme.h | 50

[PULL 0/6] hw/nvme updates

2022-03-03 Thread Klaus Jensen
From: Klaus Jensen Hi Peter, Last round of hw/nvme updates for v7.0. The following changes since commit 64ada298b98a51eb2512607f6e6180cb330c47b1: Merge remote-tracking branch 'remotes/legoater/tags/pull-ppc-20220302' into staging (2022-03-02 12:38:46 +) are available

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

2022-03-03 Thread Klaus Jensen
On Mar 1 06:54, Keith Busch wrote: > On Tue, Mar 01, 2022 at 11:44:22AM +0100, Klaus Jensen wrote: > > From: Klaus Jensen > > > > This adds support for one possible new protection information format > > introduced in TP4068 (and integrated in NVMe 2.0): the 64-b

Re: [PATCH v5 13/15] hw/nvme: Add support for the Virtualization Management command

2022-03-01 Thread Klaus Jensen
On Feb 17 18:45, Lukasz Maniak wrote: > From: Łukasz Gieryk > > With the new command one can: > - assign flexible resources (queues, interrupts) to primary and >secondary controllers, > - toggle the online/offline state of given controller. > QEMU segfaults (or asserts depending on the wi

Re: [PATCH v5 14/15] docs: Add documentation for SR-IOV and Virtualization Enhancements

2022-03-01 Thread Klaus Jensen
On Feb 17 18:45, Lukasz Maniak wrote: > Signed-off-by: Lukasz Maniak Please add a short commit description as well. Otherwise, Reviewed-by: Klaus Jensen > --- > docs/system/devices/nvme.rst | 82 > 1 file changed, 82 insertions(+) > >

Re: [PATCH v5 09/15] hw/nvme: Make max_ioqpairs and msix_qsize configurable in runtime

2022-03-01 Thread Klaus Jensen
pdate_msixcap_ts) > updates the corresponding capability register, to signal configuration > changes. > > Signed-off-by: Łukasz Gieryk LGTM. Reviewed-by: Klaus Jensen > --- > hw/nvme/ctrl.c | 52 ++ > hw/nvme/nvme.h | 2 ++

[PATCH v2 4/6] hw/nvme: add support for the lbafee hbs feature

2022-03-01 Thread Klaus Jensen
From: Naveen Nagar Add support for up to 64 LBA formats through the LBAFEE field of the Host Behavior Support feature. Reviewed-by: Keith Busch Signed-off-by: Naveen Nagar Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 34 +++--- hw/nvme/ns.c | 15

[PATCH v2 3/6] hw/nvme: move format parameter parsing

2022-03-01 Thread Klaus Jensen
From: Klaus Jensen There is no need to extract the format command parameters for each namespace. Move it to the entry point. Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-) diff

[PATCH v2 2/6] hw/nvme: add host behavior support feature

2022-03-01 Thread Klaus Jensen
From: Naveen Nagar Add support for getting and setting the Host Behavior Support feature. Reviewed-by: Keith Busch Signed-off-by: Naveen Nagar Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 8 hw/nvme/nvme.h | 4 +++- include/block/nvme.h | 9 + 3 files

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

2022-03-01 Thread Klaus Jensen
/ Signed-off-by: Naveen Nagar Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 163 +++ hw/nvme/dif.c| 363 +-- hw/nvme/dif.h| 143 - hw/nvme/ns.c | 35 - hw/nvme/nvme.h | 3 + hw/nvme

[PATCH v2 1/6] hw/nvme: move dif/pi prototypes into dif.h

2022-03-01 Thread Klaus Jensen
From: Klaus Jensen Move dif/pi data structures and inlines to dif.h. Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 1 + hw/nvme/dif.c | 1 + hw/nvme/dif.h | 53 ++ hw/nvme/nvme.h | 50

[PATCH v2 5/6] hw/nvme: add pi tuple size helper

2022-03-01 Thread Klaus Jensen
From: Klaus Jensen A subsequent patch will introduce a new tuple size; so add a helper and use that instead of sizeof() and magic numbers. Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 14 -- hw/nvme/dif.c | 16 hw/nvme/dif.h | 5

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

2022-03-01 Thread Klaus Jensen
From: Klaus Jensen This adds support for one possible new protection information format introduced in TP4068 (and integrated in NVMe 2.0): the 64-bit CRC guard and 48-bit reference tag. This version does not support storage tags. Like the CRC16 support already present, this uses a software

Re: [PATCH v5 00/15] hw/nvme: SR-IOV with Virtualization Enhancements

2022-02-18 Thread Klaus Jensen
On Feb 18 03:26, Michael S. Tsirkin wrote: > On Thu, Feb 17, 2022 at 06:44:49PM +0100, Lukasz Maniak wrote: > > Changes since v4: > > - Added hello world example for SR-IOV to the docs > > - Moved AER initialization from nvme_init_ctrl to nvme_init_state > > - Fixed division by zero issue in calcul

Re: [PATCH v5 05/15] hw/nvme: Add support for SR-IOV

2022-02-17 Thread Klaus Jensen
+-- > hw/nvme/nvme.h | 3 +- > include/hw/pci/pci_ids.h | 1 + > 3 files changed, 85 insertions(+), 4 deletions(-) > LGTM. Reviewed-by: Klaus Jensen signature.asc Description: PGP signature

Re: [PATCH v5 15/15] hw/nvme: Update the initalization place for the AER queue

2022-02-17 Thread Klaus Jensen
ched to the > controller through the parent PF. An event generated in such case ends > up on an uninitialized queue. > > While it’s an interesting question whether a VF should support AER in > the first place, I don’t think it must be answered today. > > Signed-off-b

[PATCH 2/6] hw/nvme: add host behavior support feature

2022-02-14 Thread Klaus Jensen
From: Naveen Nagar Add support for getting and setting the Host Behavior Support feature. Signed-off-by: Naveen Nagar Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 8 hw/nvme/nvme.h | 4 +++- include/block/nvme.h | 9 + 3 files changed, 20 insertions(+), 1

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

2022-02-14 Thread Klaus Jensen
/ Signed-off-by: Naveen Nagar Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 163 +++ hw/nvme/dif.c| 363 +-- hw/nvme/dif.h| 143 - hw/nvme/ns.c | 12 ++ hw/nvme/nvme.h | 3 + hw/nvme

[PATCH 4/6] hw/nvme: add support for the lbafee hbs feature

2022-02-14 Thread Klaus Jensen
From: Naveen Nagar Add support for up to 64 LBA formats through the LBAFEE field of the Host Behavior Support feature. Signed-off-by: Naveen Nagar Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 34 +++--- hw/nvme/ns.c | 15 +-- hw/nvme

[PATCH 3/6] hw/nvme: move format parameter parsing

2022-02-14 Thread Klaus Jensen
From: Klaus Jensen There is no need to extract the format command parameters for each namespace. Move it to the entry point. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw

[PATCH 5/6] hw/nvme: add pi tuple size helper

2022-02-14 Thread Klaus Jensen
From: Klaus Jensen A subsequent patch will introduce a new tuple size; so add a helper and use that instead of sizeof() and magic numbers. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 14 -- hw/nvme/dif.c | 16 hw/nvme/dif.h | 5 + 3 files changed, 21

[PATCH 1/6] hw/nvme: move dif/pi prototypes into dif.h

2022-02-14 Thread Klaus Jensen
From: Klaus Jensen Move dif/pi data structures and inlines to dif.h. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 1 + hw/nvme/dif.c | 1 + hw/nvme/dif.h | 53 ++ hw/nvme/nvme.h | 50 --- 4

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

2022-02-14 Thread Klaus Jensen
From: Klaus Jensen This adds support for one possible new protection information format introduced in TP4068 (and integrated in NVMe 2.0): the 64-bit CRC guard and 48-bit reference tag. This version does not support storage tags. Like the CRC16 support already present, this uses a software

[PULL 6/6] hw/nvme: add support for zoned random write area

2022-02-14 Thread Klaus Jensen
From: Klaus Jensen Add support for TP 4076 ("Zoned Random Write Area"), v2021.08.23 ("Ratified"). This adds three new namespace parameters: "zoned.numzrwa" (number of zrwa resources, i.e. number of zones that can have a zrwa), "zoned.zrwas" (zrwa size

[PULL 4/6] hw/nvme: add struct for zone management send

2022-02-14 Thread Klaus Jensen
From: Klaus Jensen Add struct for Zone Management Send in preparation for more zone send flags. Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 10 -- include/block/nvme.h | 19 +++ 2 files changed, 23 insertions(+), 6 deletions

[PULL 3/6] hw/nvme/ctrl: Pass buffers as 'void *' types

2022-02-14 Thread Klaus Jensen
From: Philippe Mathieu-Daudé These buffers can be anything, not an array of chars, so use the 'void *' type for them. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 10 +- hw/nvme/nvme.h | 4 ++-- 2 files

[PULL 0/6] hw/nvme updates

2022-02-14 Thread Klaus Jensen
From: Klaus Jensen Hi Peter, The following changes since commit 48033ad678ae2def43bf0d543a2c4c3d2a93feaf: Merge remote-tracking branch 'remotes/vsementsov/tags/pull-nbd-2022-02-09-v2' into staging (2022-02-12 22:04:07 +) are available in the Git repository

[PULL 1/6] hw/nvme: fix CVE-2021-3929

2022-02-14 Thread Klaus Jensen
From: Klaus Jensen This fixes CVE-2021-3929 "locally" by denying DMA to the iomem of the device itself. This still allows DMA to MMIO regions of other devices (e.g. doing P2P DMA to the controller memory buffer of another NVMe device). Fixes: CVE-2021-3929 Reported-by: Qiuhao Li R

[PULL 5/6] hw/nvme: add ozcs enum

2022-02-14 Thread Klaus Jensen
From: Klaus Jensen Add enumeration for OZCS values. Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/ns.c | 3 ++- include/block/nvme.h | 4 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/nvme/ns.c b/hw/nvme/ns.c index 8b5f98c76180..356b6c1c2f14

[PULL 2/6] hw/nvme/ctrl: Have nvme_addr_write() take const buffer

2022-02-14 Thread Klaus Jensen
From: Philippe Mathieu-Daudé The 'buf' argument is not modified, so better pass it as const type. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/n

Re: [PATCH v4 10/15] hw/nvme: Remove reg_size variable and update BAR0 size calculation

2022-02-11 Thread Klaus Jensen
hw/nvme/nvme.h > +++ b/hw/nvme/nvme.h > @@ -414,7 +414,6 @@ typedef struct NvmeCtrl { > uint16_tmax_prp_ents; > uint16_tcqe_size; > uint16_tsqe_size; > -uint32_treg_size; > uint32_tmax_q_ents; > uint8_t outstanding_aers; > uint32_tirq_status; > -- > 2.25.1 > Nice catch. Reviewed-by: Klaus Jensen signature.asc Description: PGP signature

Re: [PATCH v4 11/15] hw/nvme: Calculate BAR attributes in a function

2022-02-10 Thread Klaus Jensen
six_pba_size; > -bar_size = pow2ceil(bar_size); > +bar_size = nvme_bar_size(n->params.max_ioqpairs + 1, > n->params.msix_qsize, > + &msix_table_offset, &msix_pba_offset); > > memory_region_init(&n->bar0, OBJECT(n), "nvme-bar0", bar_size); > memory_region_init_io(&n->iomem, OBJECT(n), &nvme_mmio_ops, n, "nvme", > -- > 2.25.1 > Looks good, Reviewed-by: Klaus Jensen signature.asc Description: PGP signature

Re: [PATCH v4 12/15] hw/nvme: Initialize capability structures for primary/secondary controllers

2022-02-10 Thread Klaus Jensen
On Jan 26 18:11, Lukasz Maniak wrote: > From: Łukasz Gieryk > > With four new properties: > - sriov_v{i,q}_flexible, > - sriov_max_v{i,q}_per_vf, > one can configure the number of available flexible resources, as well as > the limits. The primary and secondary controller capability structures >

Re: [PATCH v4 15/15] hw/nvme: Update the initalization place for the AER queue

2022-02-10 Thread Klaus Jensen
id->cmic |= NVME_CMIC_MULTI_CTRL; > } > > +QTAILQ_INIT(&n->aer_queue); > + > NVME_CAP_SET_MQES(cap, 0x7ff); > NVME_CAP_SET_CQR(cap, 1); > NVME_CAP_SET_TO(cap, 0xf); > -- > 2.25.1 > Fix is good, but I think this belongs in nvme_init_state(). Otherwise, Reviewed-by: Klaus Jensen signature.asc Description: PGP signature

Re: [PATCH v4 00/15] hw/nvme: SR-IOV with Virtualization Enhancements

2022-02-10 Thread Klaus Jensen
On Jan 26 18:11, Lukasz Maniak wrote: > Changes since v3: > - Addressed comments to review on pcie: Add support for Single Root I/O > Virtualization (SR/IOV) > - Fixed issues reported by checkpatch.pl > > Knut Omang (2): > pcie: Add support for Single Root I/O Virtualization (SR/IOV) > pcie:

Re: [PATCH v2 0/3] hw/nvme: zoned random write area

2022-02-03 Thread Klaus Jensen
On Jan 27 09:19, Klaus Jensen wrote: > From: Klaus Jensen > > This series adds support for a zoned random write area as standardized > in TP 4076 ("Zoned Random Write Area"). > > v2: > * fixed rsvd member in NvmeZoneSendCmd (Keith) > * dropped patch 2 (&q

[PATCH v2 3/3] hw/nvme: add support for zoned random write area

2022-01-27 Thread Klaus Jensen
From: Klaus Jensen Add support for TP 4076 ("Zoned Random Write Area"), v2021.08.23 ("Ratified"). This adds three new namespace parameters: "zoned.numzrwa" (number of zrwa resources, i.e. number of zones that can have a zrwa), "zoned.zrwas" (zrwa size

<    1   2   3   4   5   6   7   8   9   10   >