Re: [PATCH v2 00/16] nvme: refactoring and cleanups

2020-04-22 Thread Klaus Birkelund Jensen
On Apr 21 19:24, Maxim Levitsky wrote: > Should I also review the V7 series or I should wait for V8 which will > not include these cleanups? Hi Maxim, Just wait for another series - I don't think I will post a v8, I will chop op the series into smaller ones instead. Most patches will hopefully

Re: [PATCH v2 00/16] nvme: refactoring and cleanups

2020-04-21 Thread Klaus Birkelund Jensen
On Apr 21 02:38, Keith Busch wrote: > The series looks good to me. > > Reviewed-by: Keith Busch Thanks for the review Keith! Kevin, should I rebase this on block-next? I think it might have some conflicts with the PMR patch that went in previously. Philippe, then I can also change the *err to

Re: [PATCH v2 00/16] nvme: refactoring and cleanups

2020-04-19 Thread Klaus Birkelund Jensen
On Apr 15 15:01, Klaus Jensen wrote: > From: Klaus Jensen > > Changes since v1 > > * nvme: fix pci doorbell size calculation > - added some defines and a better comment (Philippe) > > * nvme: rename trace events to pci_nvme > - changed the prefix from nvme_dev to pci_nvme

Re: [PATCH v2 13/16] nvme: factor out namespace setup

2020-04-16 Thread Klaus Birkelund Jensen
On Apr 15 15:26, Philippe Mathieu-Daudé wrote: > On 4/15/20 3:20 PM, Klaus Birkelund Jensen wrote: > > > > I'll get the v1.3 series ready next. > > > > Cool. What really matters (to me) is seeing tests. If we can merge tests > (without multiple namespaces) before

Re: [PATCH v2 13/16] nvme: factor out namespace setup

2020-04-15 Thread Klaus Birkelund Jensen
On Apr 15 15:16, Philippe Mathieu-Daudé wrote: > On 4/15/20 3:01 PM, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Signed-off-by: Klaus Jensen > > --- > > hw/block/nvme.c | 46 ++ > > 1 file changed, 26 insertions(+), 20 deletions(-) > > > >

Re: [PATCH 11/16] nvme: factor out block backend setup

2020-04-15 Thread Klaus Birkelund Jensen
On Apr 15 13:02, Klaus Birkelund Jensen wrote: > On Apr 15 12:52, Philippe Mathieu-Daudé wrote: > > On 4/15/20 12:24 PM, Klaus Jensen wrote: > > > From: Klaus Jensen > > > > > > Signed-off-by: Klaus Jensen > > > --- > > > hw/block/

Re: [PATCH 11/16] nvme: factor out block backend setup

2020-04-15 Thread Klaus Birkelund Jensen
On Apr 15 12:52, Philippe Mathieu-Daudé wrote: > On 4/15/20 12:24 PM, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Signed-off-by: Klaus Jensen > > --- > > hw/block/nvme.c | 15 --- > > 1 file changed, 12 insertions(+), 3 deletions(-) > > > > diff --git a/hw/block/nvme.c

Re: [PATCH 13/16] nvme: factor out namespace setup

2020-04-15 Thread Klaus Birkelund Jensen
On Apr 15 12:53, Klaus Birkelund Jensen wrote: > On Apr 15 12:38, Philippe Mathieu-Daudé wrote: > > > > I'm not sure this line belong to this patch. > > > > It does. It is already there in the middle of the realize function. It > is moved to nvme_init_namespace

Re: [PATCH 13/16] nvme: factor out namespace setup

2020-04-15 Thread Klaus Birkelund Jensen
On Apr 15 12:38, Philippe Mathieu-Daudé wrote: > On 4/15/20 12:24 PM, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Signed-off-by: Klaus Jensen > > --- > > hw/block/nvme.c | 47 ++- > > 1 file changed, 26 insertions(+), 21 deletions(-) > > >

Re: [PATCH v7 11/48] nvme: refactor device realization

2020-04-15 Thread Klaus Birkelund Jensen
On Apr 15 09:55, Philippe Mathieu-Daudé wrote: > On 4/15/20 9:25 AM, Klaus Birkelund Jensen wrote: > > On Apr 15 09:14, Philippe Mathieu-Daudé wrote: > > > Hi Klaus, > > > > > > This patch is a pain to review... Could you split it? I'd use one trivial > >

Re: [PATCH v7 45/48] nvme: support multiple namespaces

2020-04-15 Thread Klaus Birkelund Jensen
On Apr 15 09:38, Philippe Mathieu-Daudé wrote: > On 4/15/20 7:51 AM, Klaus Jensen wrote: > > From: Klaus Jensen > > > > This adds support for multiple namespaces by introducing a new 'nvme-ns' > > device model. The nvme device creates a bus named from the device name > > ('id'). The nvme-ns

Re: [PATCH v7 06/48] nvme: refactor nvme_addr_read

2020-04-15 Thread Klaus Birkelund Jensen
On Apr 15 09:03, Philippe Mathieu-Daudé wrote: > On 4/15/20 7:50 AM, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Pull the controller memory buffer check to its own function. The check > > will be used on its own in later patches. > > > > Signed-off-by: Klaus Jensen > > Acked-by: Keith

Re: [PATCH v7 12/48] nvme: add temperature threshold feature

2020-04-15 Thread Klaus Birkelund Jensen
On Apr 15 09:24, Klaus Birkelund Jensen wrote: > On Apr 15 09:19, Philippe Mathieu-Daudé wrote: > > On 4/15/20 7:51 AM, Klaus Jensen wrote: > > > From: Klaus Jensen > > > > > > It might seem wierd to implement this feature for an emulated device,

Re: [PATCH v7 11/48] nvme: refactor device realization

2020-04-15 Thread Klaus Birkelund Jensen
On Apr 15 09:14, Philippe Mathieu-Daudé wrote: > Hi Klaus, > > This patch is a pain to review... Could you split it? I'd use one trivial > patch for each function extracted from nvme_realize(). > Understood, I will split it up!

Re: [PATCH v7 12/48] nvme: add temperature threshold feature

2020-04-15 Thread Klaus Birkelund Jensen
On Apr 15 09:19, Philippe Mathieu-Daudé wrote: > On 4/15/20 7:51 AM, Klaus Jensen wrote: > > From: Klaus Jensen > > > > It might seem wierd to implement this feature for an emulated device, > > 'weird' Thanks, fixed :) > > > but it is mandatory to support and the feature is useful for

Re: [PATCH v7 10/48] nvme: remove redundant cmbloc/cmbsz members

2020-04-15 Thread Klaus Birkelund Jensen
On Apr 15 09:10, Philippe Mathieu-Daudé wrote: > > "hw/block/nvme.h" should not pull in "block/nvme.h", both should include a > common "hw/block/nvme_spec.h" (or better named). Not related to this patch > although. > Hmm. It does pull in the "include/block/nvme.h" which is basically the

Re: [PATCH v6 32/42] nvme: allow multiple aios per command

2020-04-08 Thread Klaus Birkelund Jensen
On Mar 31 12:10, Maxim Levitsky wrote: > On Tue, 2020-03-31 at 07:47 +0200, Klaus Birkelund Jensen wrote: > > On Mar 25 12:57, Maxim Levitsky wrote: > > > On Mon, 2020-03-16 at 07:29 -0700, Klaus Jensen wrote: > > > > @@ -516,10 +613,10 @@ static inline uint1

Re: [PATCH v6 14/42] nvme: add missing mandatory features

2020-04-08 Thread Klaus Birkelund Jensen
On Mar 31 12:39, Maxim Levitsky wrote: > On Tue, 2020-03-31 at 07:41 +0200, Klaus Birkelund Jensen wrote: > > On Mar 25 12:41, Maxim Levitsky wrote: > > > BTW the user of the device doesn't have to have 1:1 mapping between qid > > > and msi interrupt index, > > &g

Re: [PATCH v1] nvme: indicate CMB support through controller capabilities register

2020-04-07 Thread Klaus Birkelund Jensen
On Apr 1 11:42, Andrzej Jakowski wrote: > This patch sets CMBS bit in controller capabilities register when user > configures NVMe driver with CMB support, so capabilites are correctly reported > to guest OS. > > Signed-off-by: Andrzej Jakowski > --- > hw/block/nvme.c | 2 ++ >

Re: [PATCH v6 12/42] nvme: add support for the get log page command

2020-03-31 Thread Klaus Birkelund Jensen
On Mar 31 12:45, Maxim Levitsky wrote: > On Tue, 2020-03-31 at 07:41 +0200, Klaus Birkelund Jensen wrote: > > On Mar 25 12:40, Maxim Levitsky wrote: > > > On Mon, 2020-03-16 at 07:28 -0700, Klaus Jensen wrote: > > > > From: Klaus Jensen > > > > > &

Re: [PATCH v6 07/42] nvme: refactor nvme_addr_read

2020-03-31 Thread Klaus Birkelund Jensen
On Mar 31 13:41, Maxim Levitsky wrote: > On Tue, 2020-03-31 at 07:39 +0200, Klaus Birkelund Jensen wrote: > > On Mar 25 12:38, Maxim Levitsky wrote: > > > Note that this patch still contains a bug that it removes the check > > > against the accessed > > >

Re: [PATCH v6 38/42] nvme: support multiple namespaces

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:59, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:29 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > This adds support for multiple namespaces by introducing a new 'nvme-ns' > > device model. The nvme device creates a bus named from the device name > > ('id'). The

Re: [PATCH v6 36/42] nvme: add support for scatter gather lists

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:58, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:29 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > For now, support the Data Block, Segment and Last Segment descriptor > > types. > > > > See NVM Express 1.3d, Section 4.4 ("Scatter Gather List (SGL)"). > > > >

Re: [PATCH v6 35/42] nvme: handle dma errors

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:58, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:29 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Handling DMA errors gracefully is required for the device to pass the > > block/011 test ("disable PCI device while doing I/O") in the blktests > > suite. > > > > With

Re: [PATCH v6 29/42] nvme: refactor request bounds checking

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:56, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:29 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Signed-off-by: Klaus Jensen > > --- > > hw/block/nvme.c | 28 ++-- > > 1 file changed, 22 insertions(+), 6 deletions(-) > > > > diff --git

Re: [PATCH v6 32/42] nvme: allow multiple aios per command

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:57, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:29 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > This refactors how the device issues asynchronous block backend > > requests. The NvmeRequest now holds a queue of NvmeAIOs that are > > associated with the command.

Re: [PATCH v6 24/42] nvme: remove redundant has_sg member

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:45, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:29 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Remove the has_sg member from NvmeRequest since it's redundant. > > To be honest this patch also replaces the dma_acct_start with block_acct_start > which looks right

Re: [PATCH v6 31/42] nvme: add check for prinfo

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:57, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:29 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Check the validity of the PRINFO field. > > > > Signed-off-by: Klaus Jensen > > --- > > hw/block/nvme.c | 50 --- > >

Re: [PATCH v6 23/42] nvme: add mapping helpers

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:45, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:29 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Add nvme_map_addr, nvme_map_addr_cmb and nvme_addr_to_cmb helpers and > > use them in nvme_map_prp. > > > > This fixes a bug where in the case of a CMB transfer, the

Re: [PATCH v6 14/42] nvme: add missing mandatory features

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:41, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:29 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Add support for returning a resonable response to Get/Set Features of > > mandatory features. > > > > Signed-off-by: Klaus Jensen > > Acked-by: Keith Busch > > --- >

Re: [PATCH v6 12/42] nvme: add support for the get log page command

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:40, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:28 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Add support for the Get Log Page command and basic implementations of > > the mandatory Error Information, SMART / Health Information and Firmware > > Slot Information

Re: [PATCH v6 19/42] nvme: enforce valid queue creation sequence

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:43, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:29 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Support returning Command Sequence Error if Set Features on Number of > > Queues is called after queues have been created. > > > > Signed-off-by: Klaus Jensen > > ---

Re: [PATCH v6 10/42] nvme: refactor device realization

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:40, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:28 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > This patch splits up nvme_realize into multiple individual functions, > > each initializing a different subset of the device. > > > > Signed-off-by: Klaus Jensen > >

Re: [PATCH v6 06/42] nvme: add identify cns values in header

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:37, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:28 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Signed-off-by: Klaus Jensen > > --- > > hw/block/nvme.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/hw/block/nvme.c

Re: [PATCH v6 09/42] nvme: add max_ioqpairs device parameter

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:39, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:28 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > The num_queues device paramater has a slightly confusing meaning because > > it accounts for the admin queue pair which is not really optional. > > Secondly, it is

Re: [PATCH v6 11/42] nvme: add temperature threshold feature

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:40, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:28 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > It might seem wierd to implement this feature for an emulated device, > > but it is mandatory to support and the feature is useful for testing > > asynchronous event

Re: [PATCH v6 07/42] nvme: refactor nvme_addr_read

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:38, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:28 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Pull the controller memory buffer check to its own function. The check > > will be used on its own in later patches. > > > > Signed-off-by: Klaus Jensen > > Acked-by:

Re: [PATCH v6 04/42] nvme: bump spec data structures to v1.3

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:37, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:28 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Add missing fields in the Identify Controller and Identify Namespace > > data structures to bring them in line with NVMe v1.3. > > > > This also adds data structures

Re: [PATCH v6 05/42] nvme: use constant for identify data size

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:37, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:28 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Signed-off-by: Klaus Jensen > > --- > > hw/block/nvme.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/hw/block/nvme.c

Re: [PATCH v6 01/42] nvme: rename trace events to nvme_dev

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 25 12:36, Maxim Levitsky wrote: > On Mon, 2020-03-16 at 07:28 -0700, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Change the prefix of all nvme device related trace events to 'nvme_dev' > > to not clash with trace events from the nvme block driver. > > > > Signed-off-by: Klaus

Re: [PATCH RESEND v4] nvme: introduce PMR support from NVMe 1.4 spec

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 31 03:13, Keith Busch wrote: > On Mon, Mar 30, 2020 at 08:07:32PM +0200, Klaus Birkelund Jensen wrote: > > On Mar 31 01:55, Keith Busch wrote: > > > On Mon, Mar 30, 2020 at 09:46:56AM -0700, Andrzej Jakowski wrote: > > > > This patch introduces support for PMR

Re: [PATCH RESEND v4] nvme: introduce PMR support from NVMe 1.4 spec

2020-03-30 Thread Klaus Birkelund Jensen
On Mar 31 01:55, Keith Busch wrote: > On Mon, Mar 30, 2020 at 09:46:56AM -0700, Andrzej Jakowski wrote: > > This patch introduces support for PMR that has been defined as part of NVMe > > 1.4 > > spec. User can now specify a pmrdev option that should point to > > HostMemoryBackend. > > pmrdev

Re: [PATCH v3] block/nvme: introduce PMR support from NVMe 1.4 spec

2020-03-19 Thread Klaus Birkelund Jensen
On Mar 18 13:03, Andrzej Jakowski wrote: > This patch introduces support for PMR that has been defined as part of NVMe > 1.4 > spec. User can now specify a pmrdev option that should point to > HostMemoryBackend. > pmrdev memory region will subsequently be exposed as PCI BAR 2 in emulated > NVMe

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

2020-03-16 Thread Klaus Birkelund Jensen
On Feb 12 14:34, Maxim Levitsky wrote: > On Tue, 2020-02-04 at 10:52 +0100, Klaus Jensen wrote: > > This adds support for multiple namespaces by introducing a new 'nvme-ns' > > device model. The nvme device creates a bus named from the device name > > ('id'). The nvme-ns devices then connect to

Re: [PATCH v5 20/26] nvme: handle dma errors

2020-03-16 Thread Klaus Birkelund Jensen
On Feb 12 13:52, Maxim Levitsky wrote: > On Tue, 2020-02-04 at 10:52 +0100, Klaus Jensen wrote: > > Handling DMA errors gracefully is required for the device to pass the > > block/011 test ("disable PCI device while doing I/O") in the blktests > > suite. > > > > With this patch the device passes

Re: [PATCH v5 17/26] nvme: allow multiple aios per command

2020-03-16 Thread Klaus Birkelund Jensen
On Feb 12 13:48, Maxim Levitsky wrote: > On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > > This refactors how the device issues asynchronous block backend > > requests. The NvmeRequest now holds a queue of NvmeAIOs that are > > associated with the command. This allows multiple aios to be

Re: [PATCH v5 16/26] nvme: refactor prp mapping

2020-03-16 Thread Klaus Birkelund Jensen
On Feb 12 13:44, Maxim Levitsky wrote: > On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > > Refactor nvme_map_prp and allow PRPs to be located in the CMB. The logic > > ensures that if some of the PRP is in the CMB, all of it must be located > > there, as per the specification. > > To be

Re: [PATCH v5 21/26] nvme: add support for scatter gather lists

2020-03-16 Thread Klaus Birkelund Jensen
On Feb 12 14:07, Maxim Levitsky wrote: > On Tue, 2020-02-04 at 10:52 +0100, Klaus Jensen wrote: > > For now, support the Data Block, Segment and Last Segment descriptor > > types. > > > > See NVM Express 1.3d, Section 4.4 ("Scatter Gather List (SGL)"). > > > > Signed-off-by: Klaus Jensen > >

Re: [PATCH v5 15/26] nvme: bump supported specification to 1.3

2020-03-16 Thread Klaus Birkelund Jensen
On Feb 12 12:35, Maxim Levitsky wrote: > On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > > Add new fields to the Identify Controller and Identify Namespace data > > structures accoding to NVM Express 1.3d. > > > > NVM Express 1.3d requires the following additional features: > > -

Re: [PATCH v5 14/26] nvme: make sure ncqr and nsqr is valid

2020-03-16 Thread Klaus Birkelund Jensen
On Feb 12 12:30, Maxim Levitsky wrote: > On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > > 0x is not an allowed value for NCQR and NSQR in Set Features on > > Number of Queues. > > > > Signed-off-by: Klaus Jensen > > --- > > hw/block/nvme.c | 4 > > 1 file changed, 4

Re: [PATCH v5 12/26] nvme: add missing mandatory features

2020-03-16 Thread Klaus Birkelund Jensen
On Feb 12 12:27, Maxim Levitsky wrote: > On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > > Add support for returning a resonable response to Get/Set Features of > > mandatory features. > > > > Signed-off-by: Klaus Jensen > > --- > > hw/block/nvme.c | 57

Re: [PATCH v5 10/26] nvme: add support for the get log page command

2020-03-16 Thread Klaus Birkelund Jensen
On Feb 12 11:35, Maxim Levitsky wrote: > On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > > Add support for the Get Log Page command and basic implementations of > > the mandatory Error Information, SMART / Health Information and Firmware > > Slot Information log pages. > > > > In

Re: [PATCH v5 09/26] nvme: add temperature threshold feature

2020-03-16 Thread Klaus Birkelund Jensen
On Feb 12 11:31, Maxim Levitsky wrote: > On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > > It might seem wierd to implement this feature for an emulated device, > > but it is mandatory to support and the feature is useful for testing > > asynchronous event request support, which will be

Re: [PATCH v5 08/26] nvme: refactor device realization

2020-03-16 Thread Klaus Birkelund Jensen
On Feb 12 11:27, Maxim Levitsky wrote: > On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > > This patch splits up nvme_realize into multiple individual functions, > > each initializing a different subset of the device. > > > > Signed-off-by: Klaus Jensen > > --- > > hw/block/nvme.c | 175

Re: [PATCH RESEND v2] block/nvme: introduce PMR support from NVMe 1.4 spec

2020-03-12 Thread Klaus Birkelund Jensen
On Mar 11 15:54, Andrzej Jakowski wrote: > On 3/11/20 2:20 AM, Stefan Hajnoczi wrote: > > Please try: > > > > $ git grep pmem > > > > backends/hostmem-file.c is the backend that can be used and the > > pmem_persist() API can be used to flush writes. > > I've reworked this patch into

Re: [PATCH v5 01/26] nvme: rename trace events to nvme_dev

2020-02-12 Thread Klaus Birkelund Jensen
On Feb 12 11:08, Maxim Levitsky wrote: > On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > > Change the prefix of all nvme device related trace events to 'nvme_dev' > > to not clash with trace events from the nvme block driver. > > Hi Maxim, Thank you very much for your thorough reviews!

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

2020-02-05 Thread Klaus Birkelund Jensen
On Feb 5 01:47, Keith Busch wrote: > On Tue, Feb 04, 2020 at 10:51:42AM +0100, Klaus Jensen wrote: > > Hi, > > > > > > Changes since v4 > > - Changed vendor and device id to use a Red Hat allocated one. For > >backwards compatibility add the 'x-use-intel-id' nvme device > >parameter.

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

2020-02-05 Thread Klaus Birkelund Jensen
On Feb 5 01:35, Keith Busch wrote: > On Tue, Feb 04, 2020 at 10:52:06AM +0100, Klaus Jensen wrote: > > There are two reasons for changing this: > > > > 1. The nvme device currently uses an internal Intel device id. > > > > 2. Since commits "nvme: fix write zeroes offset and count" and

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

2020-02-05 Thread Klaus Birkelund Jensen
On Feb 5 01:31, Keith Busch wrote: > On Tue, Feb 04, 2020 at 10:52:04AM +0100, Klaus Jensen wrote: > > This adds support for multiple namespaces by introducing a new 'nvme-ns' > > device model. The nvme device creates a bus named from the device name > > ('id'). The nvme-ns devices then connect

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

2020-02-05 Thread Klaus Birkelund Jensen
On Feb 5 01:43, Keith Busch wrote: > 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(-) > > > >

Re: [PATCH v4 20/24] nvme: add support for scatter gather lists

2020-01-13 Thread Klaus Birkelund Jensen
On Jan 9 11:44, Beata Michalska wrote: > Hi Klaus, > > On Thu, 19 Dec 2019 at 13:09, Klaus Jensen wrote: > > @@ -73,7 +73,12 @@ static inline bool nvme_addr_is_cmb(NvmeCtrl *n, hwaddr > > addr) > > > > static int nvme_addr_read(NvmeCtrl *n, hwaddr addr, void *buf, int size) > > { > > -if

Re: [PATCH v4 17/24] nvme: allow multiple aios per command

2020-01-13 Thread Klaus Birkelund Jensen
On Jan 9 11:40, Beata Michalska wrote: > Hi Klaus, > > On Thu, 19 Dec 2019 at 13:09, Klaus Jensen wrote: > > +static NvmeAIO *nvme_aio_new(BlockBackend *blk, int64_t offset, size_t len, > > +QEMUSGList *qsg, QEMUIOVector *iov, NvmeRequest *req, > > +NvmeAIOCompletionFunc *cb) > >

Re: [PATCH v4 19/24] nvme: handle dma errors

2020-01-13 Thread Klaus Birkelund Jensen
On Jan 9 11:35, Beata Michalska wrote: > Hi Klaus, > Hi Beata, Your reviews are, as always, much appreciated! Thanks! > On Thu, 19 Dec 2019 at 13:09, Klaus Jensen wrote: > > @@ -1595,7 +1611,12 @@ static void nvme_process_sq(void *opaque) > > > > while (!(nvme_sq_empty(sq) ||

Re: [PATCH v4 22/24] nvme: bump controller pci device id

2019-12-19 Thread Klaus Birkelund Jensen
On Dec 20 02:46, Keith Busch wrote: > On Thu, Dec 19, 2019 at 06:24:57PM +0100, Klaus Birkelund Jensen wrote: > > On Dec 20 01:16, Keith Busch wrote: > > > On Thu, Dec 19, 2019 at 02:09:19PM +0100, Klaus Jensen wrote: > > > > @@ -2480,7 +2480,7 @@ static void nvme_i

Re: [PATCH v4 21/24] nvme: support multiple namespaces

2019-12-19 Thread Klaus Birkelund Jensen
On Dec 19 16:11, Michal Prívozník wrote: > On 12/19/19 2:09 PM, Klaus Jensen wrote: > > This adds support for multiple namespaces by introducing a new 'nvme-ns' > > device model. The nvme device creates a bus named from the device name > > ('id'). The nvme-ns devices then connect to this and

Re: [PATCH v4 22/24] nvme: bump controller pci device id

2019-12-19 Thread Klaus Birkelund Jensen
On Dec 20 01:16, Keith Busch wrote: > On Thu, Dec 19, 2019 at 02:09:19PM +0100, Klaus Jensen wrote: > > @@ -2480,7 +2480,7 @@ static void nvme_init_pci(NvmeCtrl *n, PCIDevice > > *pci_dev) > > pci_conf[PCI_INTERRUPT_PIN] = 1; > > pci_config_set_prog_interface(pci_conf, 0x2); > >

Re: [PATCH v2 15/20] nvme: add support for scatter gather lists

2019-11-26 Thread Klaus Birkelund
On Mon, Nov 25, 2019 at 02:10:37PM +, Beata Michalska wrote: > On Mon, 25 Nov 2019 at 06:21, Klaus Birkelund wrote: > > > > On Tue, Nov 12, 2019 at 03:25:18PM +, Beata Michalska wrote: > > > Hi Klaus, > > > > > > On Tue, 15 Oct 2019 at 11:57, Kla

Re: [PATCH v2 12/20] nvme: bump supported specification version to 1.3

2019-11-26 Thread Klaus Birkelund
On Mon, Nov 25, 2019 at 12:13:15PM +, Beata Michalska wrote: > On Mon, 18 Nov 2019 at 09:48, Klaus Birkelund wrote: > > > > On Tue, Nov 12, 2019 at 03:05:06PM +, Beata Michalska wrote: > > > Hi Klaus, > > > > > > On Tue, 15 Oct 2019 at 11:52, Kl

Re: [PATCH v2 15/20] nvme: add support for scatter gather lists

2019-11-24 Thread Klaus Birkelund
On Tue, Nov 12, 2019 at 03:25:18PM +, Beata Michalska wrote: > Hi Klaus, > > On Tue, 15 Oct 2019 at 11:57, Klaus Jensen wrote: > > +static uint16_t nvme_map_sgl(NvmeCtrl *n, QEMUSGList *qsg, > > +NvmeSglDescriptor sgl, uint32_t len, NvmeRequest *req) > > +{ > > +const int MAX_NSGLD =

Re: [PATCH v2 14/20] nvme: allow multiple aios per command

2019-11-21 Thread Klaus Birkelund
On Tue, Nov 12, 2019 at 03:25:06PM +, Beata Michalska wrote: > Hi Klaus, > > On Tue, 15 Oct 2019 at 11:55, Klaus Jensen wrote: > > @@ -341,19 +344,18 @@ static uint16_t nvme_dma_write_prp(NvmeCtrl *n, > > uint8_t *ptr, uint32_t len, > Any reason why the nvme_dma_write_prp is missing the

Re: [PATCH v2 13/20] nvme: refactor prp mapping

2019-11-20 Thread Klaus Birkelund
On Tue, Nov 12, 2019 at 03:23:43PM +, Beata Michalska wrote: > Hi Klaus, > > On Tue, 15 Oct 2019 at 11:57, Klaus Jensen wrote: > > > > Instead of handling both QSGs and IOVs in multiple places, simply use > > QSGs everywhere by assuming that the request does not involve the > > controller

Re: [PATCH v2 08/20] nvme: add support for the get log page command

2019-11-19 Thread Klaus Birkelund
On Tue, Nov 12, 2019 at 03:04:52PM +, Beata Michalska wrote: > Hi Klaus, > > > On Tue, 15 Oct 2019 at 11:45, Klaus Jensen wrote: > > +if (!nsid || (nsid != 0x && nsid > n->num_namespaces)) { > > +trace_nvme_err_invalid_ns(nsid, n->num_namespaces); > > +return

Re: [PATCH v2 09/20] nvme: add support for the asynchronous event request command

2019-11-19 Thread Klaus Birkelund
On Tue, Nov 12, 2019 at 03:04:59PM +, Beata Michalska wrote: > Hi Klaus, > > On Tue, 15 Oct 2019 at 11:49, Klaus Jensen wrote: > > @@ -1188,6 +1326,9 @@ static int nvme_start_ctrl(NvmeCtrl *n) > > > > nvme_set_timestamp(n, 0ULL); > > > > +n->aer_timer =

Re: [PATCH v2 12/20] nvme: bump supported specification version to 1.3

2019-11-18 Thread Klaus Birkelund
On Tue, Nov 12, 2019 at 03:05:06PM +, Beata Michalska wrote: > Hi Klaus, > > On Tue, 15 Oct 2019 at 11:52, Klaus Jensen wrote: > > > > +static uint16_t nvme_identify_ns_descr_list(NvmeCtrl *n, NvmeCmd *c) > > +{ > > +static const int len = 4096; > > + > > +struct ns_descr { > > +

Re: [PATCH v2 06/20] nvme: add support for the abort command

2019-11-18 Thread Klaus Birkelund
On Fri, Nov 15, 2019 at 11:56:00AM +, Beata Michalska wrote: > Hi Klaus, > > On Wed, 13 Nov 2019 at 06:12, Klaus Birkelund wrote: > > > > On Tue, Nov 12, 2019 at 03:04:38PM +, Beata Michalska wrote: > > > Hi Klaus > > > > > > > Hi B

Re: [PATCH v2 19/20] nvme: make lba data size configurable

2019-11-12 Thread Klaus Birkelund
On Tue, Nov 12, 2019 at 03:24:00PM +, Beata Michalska wrote: > Hi Klaus, > > On Tue, 15 Oct 2019 at 11:50, Klaus Jensen wrote: > > #define DEFINE_NVME_NS_PROPERTIES(_state, _props) \ > > -DEFINE_PROP_UINT32("nsid", _state, _props.nsid, 0) > > +DEFINE_PROP_UINT32("nsid", _state,

Re: [PATCH v2 04/20] nvme: populate the mandatory subnqn and ver fields

2019-11-12 Thread Klaus Birkelund
On Tue, Nov 12, 2019 at 03:04:45PM +, Beata Michalska wrote: > Hi Klaus > > On Tue, 15 Oct 2019 at 11:42, Klaus Jensen wrote: > > +n->bar.vs = 0x00010201; > > Very minor: > > The version number is being set twice in the patch series already. > And it is being set in two places. > It

Re: [PATCH v2 06/20] nvme: add support for the abort command

2019-11-12 Thread Klaus Birkelund
On Tue, Nov 12, 2019 at 03:04:38PM +, Beata Michalska wrote: > Hi Klaus > Hi Beata, Thank you very much for your thorough reviews! I'll start going through them one by one :) You might have seen that I've posted a v3, but I will make sure to consolidate between v2 and v3! > On Tue, 15 Oct

Re: [PATCH 1/1] pci: pass along the return value of dma_memory_rw

2019-11-11 Thread Klaus Birkelund
On Mon, Nov 11, 2019 at 05:16:41AM -0500, Michael S. Tsirkin wrote: > On Mon, Nov 11, 2019 at 10:30:07AM +0100, Klaus Birkelund wrote: > > On Thu, Oct 24, 2019 at 01:13:36AM +0200, Philippe Mathieu-Daudé wrote: > > > On 10/11/19 9:01 AM, Klaus Jensen wrote: > > > >

Re: [PATCH 1/1] pci: pass along the return value of dma_memory_rw

2019-11-11 Thread Klaus Birkelund
On Thu, Oct 24, 2019 at 01:13:36AM +0200, Philippe Mathieu-Daudé wrote: > On 10/11/19 9:01 AM, Klaus Jensen wrote: > > Some might actually care about the return value of dma_memory_rw. So > > let us pass it along instead of ignoring it. > > > > Signed-off-by: Klaus Jensen > > --- > >

Re: [Qemu-devel] [PATCH 16/16] nvme: support multiple namespaces

2019-11-04 Thread Klaus Birkelund
On Mon, Nov 04, 2019 at 08:46:29AM +, Ross Lagerwall wrote: > On 8/23/19 9:10 AM, Klaus Birkelund wrote: > > On Thu, Aug 22, 2019 at 02:18:05PM +0100, Ross Lagerwall wrote: > >> On 7/5/19 8:23 AM, Klaus Birkelund Jensen wrote: > >> > >> I tried thi

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

2019-10-28 Thread Klaus Birkelund
On Tue, Oct 15, 2019 at 12:38:40PM +0200, Klaus Jensen wrote: > Hi, > > (Quick note to Fam): most of this series is irrelevant to you as the > maintainer of the nvme block driver, but patch "nvme: add support for > scatter gather lists" touches block/nvme.c due to changes in the shared > NvmeCmd

Re: [PATCH] nvme: fix NSSRS offset in CAP register

2019-10-23 Thread Klaus Birkelund
On Wed, Oct 23, 2019 at 11:26:57AM -0400, John Snow wrote: > > > On 10/23/19 3:33 AM, Klaus Jensen wrote: > > Fix the offset of the NSSRS field the CAP register. > > From NVME 1.4, section 3 ("Controller Registers"), subsection 3.1.1 > ("Offset 0h: CAP – Controller Capabilities")

Re: [PATCH 0/1] pci: pass along the return value of dma_memory_rw

2019-10-23 Thread Klaus Birkelund
On Fri, Oct 11, 2019 at 09:01:40AM +0200, Klaus Jensen wrote: > Hi, > > While working on fixing the emulated nvme device to pass more tests in > the blktests suite, I discovered that the pci_dma_rw function ignores > the return value of dma_memory_rw. > > The nvme device needs to handle DMA

Re: [Qemu-devel] [PATCH 16/16] nvme: support multiple namespaces

2019-08-23 Thread Klaus Birkelund
On Thu, Aug 22, 2019 at 02:18:05PM +0100, Ross Lagerwall wrote: > On 7/5/19 8:23 AM, Klaus Birkelund Jensen wrote: > > I tried this patch series by installing Windows with a single NVME > controller having two namespaces. QEMU crashed in get_feature / > NVME_VOLATILE_WRITE_CACHE

Re: [Qemu-devel] [Qemu-block] [RFC, v1] Namespace Management Support

2019-07-09 Thread Klaus Birkelund
he current "QEMU model". > I'm in the middle of going through the patch you posted. Nice job!  I'm glad > to see more people adding enhancements. It was pretty stale for years. > Thanks for looking at it, I know it's a lot to go through ;) > -Matt > On 7/5/19 12:50 AM, Kl

Re: [Qemu-devel] [Qemu-block] [PATCH 16/16] nvme: support multiple namespaces

2019-07-05 Thread Klaus Birkelund
On Fri, Jul 05, 2019 at 02:49:29PM +0100, Daniel P. Berrangé wrote: > On Fri, Jul 05, 2019 at 03:36:17PM +0200, Klaus Birkelund wrote: > > On Fri, Jul 05, 2019 at 09:23:33AM +0200, Klaus Birkelund Jensen wrote: > > > This adds support for multiple namespaces by introduc

Re: [Qemu-devel] [Qemu-block] [PATCH 16/16] nvme: support multiple namespaces

2019-07-05 Thread Klaus Birkelund
On Fri, Jul 05, 2019 at 09:23:33AM +0200, Klaus Birkelund Jensen wrote: > This adds support for multiple namespaces by introducing a new 'nvme-ns' > device model. The nvme device creates a bus named from the device name > ('id'). The nvme-ns devices then connect to this and registers >

Re: [Qemu-devel] [Qemu-block] [RFC, v1] Namespace Management Support

2019-07-05 Thread Klaus Birkelund
On Tue, Jul 02, 2019 at 10:39:36AM -0700, Matt Fitzpatrick wrote: > Adding namespace management support to the nvme device. Namespace creation > requires contiguous block space for a simple method of allocation. > > I wrote this a few years ago based on Keith's fork and nvmeqemu fork and > have

[Qemu-devel] [PATCH 16/16] nvme: support multiple namespaces

2019-07-05 Thread Klaus Birkelund Jensen
-by: Klaus Birkelund Jensen --- hw/block/Makefile.objs | 2 +- hw/block/nvme-ns.c | 139 + hw/block/nvme-ns.h | 35 + hw/block/nvme.c| 169 - hw/block/nvme.h| 29 --- hw/block/trace-events

[Qemu-devel] [PATCH 02/16] nvme: move device parameters to separate struct

2019-07-05 Thread Klaus Birkelund Jensen
Move device configuration parameters to separate struct to make it explicit what is configurable and what is set internally. Also, clean up some includes. Signed-off-by: Klaus Birkelund Jensen --- hw/block/nvme.c | 54 +++-- hw/block/nvme.h | 16

[Qemu-devel] [PATCH 13/16] nvme: simplify dma/cmb mappings

2019-07-05 Thread Klaus Birkelund Jensen
helpers anyway, so the CMB path is not unfairly affected by this simplifying change. As a side-effect, this patch also allows PRPs to be located in the CMB. The logic ensures that if some of the PRP is in the CMB, all of it must be located there. Signed-off-by: Klaus Birkelund Jensen --- hw

[Qemu-devel] [PATCH 08/16] nvme: refactor device realization

2019-07-05 Thread Klaus Birkelund Jensen
Signed-off-by: Klaus Birkelund Jensen --- hw/block/nvme.c | 196 ++-- hw/block/nvme.h | 11 +++ 2 files changed, 152 insertions(+), 55 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 4b9ff51868c0..eb6af6508e2d 100644 --- a/hw/block

[Qemu-devel] [PATCH 15/16] nvme: support scatter gather lists

2019-07-05 Thread Klaus Birkelund Jensen
For now, support the Data Block, Segment and Last Segment descriptor types. See NVM Express 1.3d, Section 4.4 ("Scatter Gather List (SGL)"). Signed-off-by: Klaus Birkelund Jensen --- block/nvme.c | 18 +- hw/block/nvme.c | 390 +++-

[Qemu-devel] [PATCH 14/16] nvme: support multiple block requests per request

2019-07-05 Thread Klaus Birkelund Jensen
device is ready for that. Signed-off-by: Klaus Birkelund Jensen --- hw/block/nvme.c | 322 -- hw/block/nvme.h | 49 +-- hw/block/trace-events | 3 + 3 files changed, 290 insertions(+), 84 deletions(-) diff --git a/hw/block/nvme.c b/hw

[Qemu-devel] [PATCH 05/16] nvme: populate the mandatory subnqn and ver fields

2019-07-05 Thread Klaus Birkelund Jensen
Required for compliance with NVMe revision 1.2.1 or later. See NVM Express 1.2.1, Section 5.11 ("Identify command"), Figure 90 and Section 7.9 ("NVMe Qualified Names"). This also bumps the supported version to 1.2.1. Signed-off-by: Klaus Birkelund Jensen --- hw/block/nv

[Qemu-devel] [PATCH 11/16] nvme: add missing mandatory Features

2019-07-05 Thread Klaus Birkelund Jensen
Add support for returning a resonable response to Get/Set Features of mandatory features. Signed-off-by: Klaus Birkelund Jensen --- hw/block/nvme.c | 49 --- hw/block/trace-events | 2 ++ include/block/nvme.h | 3 ++- 3 files changed, 50

[Qemu-devel] [PATCH 06/16] nvme: support completion queue in cmb

2019-07-05 Thread Klaus Birkelund Jensen
While not particularly useful, allow completion queues in the controller memory buffer. Could be useful for testing. Signed-off-by: Klaus Birkelund Jensen --- hw/block/nvme.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c

[Qemu-devel] [PATCH 09/16] nvme: support Asynchronous Event Request command

2019-07-05 Thread Klaus Birkelund Jensen
Required for compliance with NVMe revision 1.2.1. See NVM Express 1.2.1, Section 5.2 ("Asynchronous Event Request command"). Modified from Keith's qemu-nvme tree. Signed-off-by: Klaus Birkelund Jensen --- hw/block/nvme.c | 88 ++- hw/bl

[Qemu-devel] [PATCH 10/16] nvme: support Get Log Page command

2019-07-05 Thread Klaus Birkelund Jensen
Signed-off-by: Klaus Birkelund Jensen --- hw/block/nvme.c | 209 ++ hw/block/nvme.h | 3 + hw/block/trace-events | 3 + include/block/nvme.h | 4 +- 4 files changed, 217 insertions(+), 2 deletions(-) diff --git a/hw/block/nvme.c b/hw/bl

  1   2   >