[PATCH 1/2] hw/ufs: Update MCQ-related fields to block/ufs.h

2024-05-21 Thread Minwoo Im
This patch is a prep patch for the following MCQ support patch for hw/ufs. This patch updated minimal mandatory fields to support MCQ based on UFSHCI 4.0. Signed-off-by: Minwoo Im --- include/block/ufs.h | 108 +++- 1 file changed, 106 insertions(+), 2

[PATCH 0/2] hw/ufs: Add support MCQ

2024-05-21 Thread Minwoo Im
actual changes for MCQ. Please review. Thanks, Minwoo Im (2): hw/ufs: Update MCQ-related fields to block/ufs.h hw/ufs: Add support MCQ of UFSHCI 4.0 hw/ufs/trace-events | 17 ++ hw/ufs/ufs.c| 474 ++-- hw/ufs/ufs.h| 98

[PATCH 0/2] hw/ufs: Add support MCQ

2024-05-21 Thread Minwoo Im
actual changes for MCQ. Please review. Thanks, Minwoo Im (2): hw/ufs: Update MCQ-related fields to block/ufs.h hw/ufs: Add support MCQ of UFSHCI 4.0 hw/ufs/trace-events | 17 ++ hw/ufs/ufs.c| 474 ++-- hw/ufs/ufs.h| 98

[PATCH 2/2] hw/ufs: Add support MCQ of UFSHCI 4.0

2024-05-21 Thread Minwoo Im
qReg, UfsMcqSqIntReg, UfsMcqCqReg, UfsMcqCqIntReg The maxinum number of queue is 32 as per spec, and the default MAC(Multiple Active Commands) are 32 in the device. Example: -device ufs,serial=foo,id=ufs0,mcq=true,mcq-maxq=8 Signed-off-by: Minwoo Im --- hw/ufs/trace-events | 17 ++ hw/ufs/u

Re: [PATCH 2/2] hw/ufs: Add support MCQ of UFSHCI 4.0

2024-05-27 Thread Minwoo Im
On 24-05-28 10:00:35, Jeuk Kim wrote: > Thanks for your contribution! > > There are only two minor comments. Thanks for your review. > > Please check it and send patch v2. > > > Thank you! > > On 5/21/2024 8:05 PM, Minwoo Im wrote: > > @@ -1288,12 +1717,

[PATCH v2 0/2] hw/ufs: Add support MCQ

2024-05-27 Thread Minwoo Im
and to ensure that io_queues exist to handle device commands. Please review. Thanks, Minwoo Im (2): hw/ufs: Update MCQ-related fields to block/ufs.h hw/ufs: Add support MCQ of UFSHCI 4.0 hw/ufs/trace-events | 17 ++ hw/ufs/ufs.c| 478 ++-- hw

[PATCH v2 1/2] hw/ufs: Update MCQ-related fields to block/ufs.h

2024-05-27 Thread Minwoo Im
This patch is a prep patch for the following MCQ support patch for hw/ufs. This patch updated minimal mandatory fields to support MCQ based on UFSHCI 4.0. Signed-off-by: Minwoo Im --- include/block/ufs.h | 108 +++- 1 file changed, 106 insertions(+), 2

[PATCH v2 2/2] hw/ufs: Add support MCQ of UFSHCI 4.0

2024-05-27 Thread Minwoo Im
qReg, UfsMcqSqIntReg, UfsMcqCqReg, UfsMcqCqIntReg The maxinum number of queue is 32 as per spec, and the default MAC(Multiple Active Commands) are 32 in the device. Example: -device ufs,serial=foo,id=ufs0,mcq=true,mcq-maxq=8 Signed-off-by: Minwoo Im --- hw/ufs/trace-events | 17 ++ hw/ufs/u

[PATCH v4 4/4] hw/nvme: Expand VI/VQ resource to uint32

2024-05-29 Thread Minwoo Im
. Reviewed-by: Klaus Jensen Signed-off-by: Minwoo Im --- hw/nvme/ctrl.c | 8 hw/nvme/nvme.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 90a58e71bd..b957debdc3 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -8460,10

[PATCH v4 3/4] hw/nvme: Allocate sec-ctrl-list as a dynamic array

2024-05-29 Thread Minwoo Im
To prevent further bumping up the number of maximum VF te support, this patch allocates a dynamic array (NvmeCtrl *)->sec_ctrl_list based on number of VF supported by sriov_max_vfs property. Signed-off-by: Minwoo Im --- hw/nvme/ctrl.c | 8 +--- hw/nvme/nvme.h | 5 ++--- hw/nvme/subsy

[PATCH v4 1/4] hw/nvme: add Identify Endurance Group List

2024-05-29 Thread Minwoo Im
But, yes, only just for the endurance group #1. This patch allows host applications to ask for which endurance group is available and utilize FDP through that endurance group. Reviewed-by: Klaus Jensen Signed-off-by: Minwoo Im --- hw/nvme/ctrl.c | 22 ++ include/block/n

[PATCH v4 2/4] hw/nvme: separate identify data for sec. ctrl list

2024-05-29 Thread Minwoo Im
n the command comes in. Signed-off-by: Minwoo Im --- hw/nvme/ctrl.c | 21 ++--- hw/nvme/nvme.h | 14 -- hw/nvme/subsys.c | 8 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 18672f6619..7cf1e8e384 100644

[PATCH v4 0/4] hw/nvme: FDP and SR-IOV enhancements

2024-05-29 Thread Minwoo Im
array of secondary controller list rather than a static array with a fixed size of maximum number of VF to support (Suggested by Klaus). v2: - Added [2/4] commit to fix crash due to entry overflow Minwoo Im (4): hw/nvme: add Identify Enduran

Re: [PATCH v4 09/10] hw/nvme: add reservation protocal command

2024-05-31 Thread Minwoo Im
On 24-05-31 11:34:54, Changqi Lu wrote: > Add reservation acquire, reservation register, > reservation release and reservation report commands > in the nvme device layer. > > By introducing these commands, this enables the nvme > device to perform reservation-related tasks, including > querying ke

[PATCH] hw/nvme: fix BAR size mismatch of SR-IOV VF

2024-06-04 Thread Minwoo Im
different elements: PF: `max_ioqpairs + 1` with `msix_qsize` VF: VQFRSM with VIFRSM Signed-off-by: Minwoo Im --- hw/nvme/ctrl.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 127c3d2383..57bc26034c 100644

Re: [PATCH] hw/ufs: Fix mcq register range determination logic

2024-07-04 Thread Minwoo Im
his could cause ufs_mmio_read()/ufs_mmio_write() to overflow the > buffer. So fix it. > > Fixes: 5c079578d2e4 ("hw/ufs: Add support MCQ of UFSHCI 4.0") > Signed-off-by: Jeuk Kim Reviewed-by: Minwoo Im

[PATCH] nvme: Print 'cqid' for nvme_del_cq

2020-03-24 Thread Minwoo Im
The given argument for this trace should be cqid, not sqid. Signed-off-by: Minwoo Im --- hw/block/trace-events | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/trace-events b/hw/block/trace-events index f78939fa9da1..bf6d11b58b85 100644 --- a/hw/block/trace-events

Re: [PATCH v8 1/5] hw/block/nvme: remove superfluous NvmeCtrl parameter

2020-11-16 Thread Minwoo Im
On 11/12 20:59, Klaus Jensen wrote: > From: Klaus Jensen > > nvme_check_bounds has no use of the NvmeCtrl parameter; remove it. > > Signed-off-by: Klaus Jensen Reviewed-by: Minwoo Im

Re: [PATCH v8 2/5] hw/block/nvme: pull aio error handling

2020-11-16 Thread Minwoo Im
On 11/12 20:59, Klaus Jensen wrote: > From: Klaus Jensen > > Add a new function, nvme_aio_err, to handle errors resulting from AIOs > and use this from the callbacks. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 61 + > 1 file change

Re: [PATCH v8 3/5] hw/block/nvme: add dulbe support

2020-11-16 Thread Minwoo Im
On 11/12 20:59, Klaus Jensen wrote: > From: Klaus Jensen > > Add support for reporting the Deallocated or Unwritten Logical Block > Error (DULBE). > > Rely on the block status flags reported by the block layer and consider > any block with the BDRV_BLOCK_ZERO flag to be deallocated. > > Multipl

Re: [PATCH v8 4/5] nvme: add namespace I/O optimization fields to shared header

2020-11-16 Thread Minwoo Im
Stefan Hajnoczi Reviewed-by: Minwoo Im

Re: [PATCH] hw/block/nvme: add compare command

2020-11-25 Thread Minwoo Im
Hello, On 20-11-24 08:37:14, Klaus Jensen wrote: > From: Gollu Appalanaidu > > Add the Compare command. > > This implementation uses a bounce buffer to read in the data from > storage and then compare with the host supplied buffer. > > Signed-off-by: Gollu Appalanaidu > [k.jensen: rebased] >

Re: [PATCH 1/2] nvme: updated shared header for copy command

2020-11-25 Thread Minwoo Im
< 5, > NVME_ONCS_TIMESTAMP = 1 << 6, > +NVME_ONCS_COPY = 1 << 8, > +}; > + > +enum NvmeIdCtrlOcfs { > +NVME_OCFS_COPY_FORMAT_0 = 1 << NVME_COPY_FORMAT_0, I'd prefer (1 << 0) to (1 << enum) which is more obvious and same style with enum NvmeIdCtrlOncs. But I'm fine with both cases. Please add: Reviewed-by: Minwoo Im

Re: [PATCH v2] hw/block/nvme: add compare command

2020-11-26 Thread Minwoo Im
lu Appalanaidu > [k.jensen: rebased] > Signed-off-by: Klaus Jensen Reviewed-by: Minwoo Im

Re: [PATCH] hw/block/nvme: fix bad clearing of CAP

2020-12-09 Thread Minwoo Im
Hello, Reviewed-by: Minwoo Im

[Qemu-block] [PATCH] qemu-block: add support HMB with feature commands.

2017-10-20 Thread Minwoo Im
Add support HMB(Host Memory Block) with feature commands(Get Feature, Set Feature). nvme-4.14 tree supports HMB features. This patch will make nvme controller to return 32MiB preferred size of HMB to host via identify command. Set Feature, Get Feature implemented for HMB. Signed-off-by: Minwoo

Re: [Qemu-block] [PATCH] qemu-block: add support HMB with feature commands.

2017-10-28 Thread Minwoo Im
I'll send a patch only when there is a clear real use case. Thanks for your reply. On Mon, Oct 23, 2017 at 11:30 PM, Keith Busch wrote: > On Sat, Oct 21, 2017 at 03:54:16PM +0900, Minwoo Im wrote: >> Add support HMB(Host Memory Block) with feature commands(Get Feature, Set >&g

Re: [Qemu-block] [PATCH] qemu-block: add support HMB with feature commands.

2017-10-28 Thread Minwoo Im
On Tue, Oct 24, 2017 at 1:18 AM, Stefan Hajnoczi wrote: > On Sat, Oct 21, 2017 at 03:54:16PM +0900, Minwoo Im wrote: >> Add support HMB(Host Memory Block) with feature commands(Get Feature, Set >> Feature). >> nvme-4.14 tree supports HMB features. >> This patch w

Re: [PATCH 02/16] hw/block/nvme: add mapping helpers

2020-07-29 Thread Minwoo Im
tor *iov, uint64_t prp1, > } else { > if (unlikely(prp2 & (n->page_size - 1))) { > trace_pci_nvme_err_invalid_prp2_align(prp2); > +status = NVME_INVALID_FIELD | NVME_DNR; > goto unmap; > } > -

Re: [PATCH 03/16] hw/block/nvme: replace dma_acct with blk_acct equivalent

2020-07-29 Thread Minwoo Im
k_acct_start(blk_get_stats(n->conf.blk), &req->acct, > req->iov.size, > + acct); > req->aiocb = is_write ? > blk_aio_pwritev(n->conf.blk, data_offset, &req->iov, 0, > nvme_rw_cb, > req) : Reviewed-by: Minwoo Im Thanks,

Re: [PATCH 04/16] hw/block/nvme: remove redundant has_sg member

2020-07-29 Thread Minwoo Im
Klaus, On 20-07-20 13:37:36, Klaus Jensen wrote: > From: Klaus Jensen > > Remove the has_sg member from NvmeRequest since it's redundant. > > Also, make sure the request iov is destroyed at completion time. > > Signed-off-by: Klaus Jensen > Reviewed-by: Maxim Levitsky > --- > hw/block/nvme.

Re: [PATCH 05/16] hw/block/nvme: refactor dma read/write

2020-07-29 Thread Minwoo Im
Klaus, On 20-07-20 13:37:37, Klaus Jensen wrote: > From: Klaus Jensen > > Refactor the nvme_dma_{read,write}_prp functions into a common function > taking a DMADirection parameter. > > Signed-off-by: Klaus Jensen > Reviewed-by: Maxim Levitsky Reviewed-by: Minwoo Im Thanks,

Re: [PATCH 06/16] hw/block/nvme: pass request along for tracing

2020-07-29 Thread Minwoo Im
Klaus, On 20-07-20 13:37:38, Klaus Jensen wrote: > From: Klaus Jensen > > Pass along the NvmeRequest in various functions since it is very useful > for tracing. One doubt here. This patch has put NvmeRequest argument to the nvme_map_prp() to trace the request's command id. But can we just

Re: [PATCH 08/16] hw/block/nvme: verify validity of prp lists in the cmb

2020-07-29 Thread Minwoo Im
some of the PRPs in a PRP list are in the CMB, then ALL entries must > be there. This patch makes sure that requirement is verified as well as > properly announcing support for PRP lists in the CMB. > > Signed-off-by: Klaus Jensen > Reviewed-by: Maxim Levitsky Reviewed-by: Minwoo Im

Re: [PATCH 09/16] hw/block/nvme: refactor request bounds checking

2020-07-29 Thread Minwoo Im
On 20-07-20 13:37:41, Klaus Jensen wrote: > From: Klaus Jensen > > Hoist bounds checking into its own function and check for wrap-around. > > Signed-off-by: Klaus Jensen > Reviewed-by: Maxim Levitsky Reviewed-by: Minwoo Im

Re: [PATCH 07/16] hw/block/nvme: add request mapping helper

2020-07-29 Thread Minwoo Im
Klaus, On 20-07-20 13:37:39, Klaus Jensen wrote: > From: Klaus Jensen > > Introduce the nvme_map helper to remove some noise in the main nvme_rw > function. > > Signed-off-by: Klaus Jensen > Reviewed-by: Maxim Levitsky > --- > hw/block/nvme.c | 13 ++--- > 1 file changed, 10 insertio

Re: [PATCH 11/16] hw/block/nvme: be consistent about zeros vs zeroes

2020-07-29 Thread Minwoo Im
Reviewed-by: Minwoo Im Thanks,

Re: [PATCH 10/16] hw/block/nvme: add check for mdts

2020-07-29 Thread Minwoo Im
e-events > index 6d0cd588c786..5d7d4679650b 100644 > --- a/hw/block/trace-events > +++ b/hw/block/trace-events > @@ -85,6 +85,7 @@ pci_nvme_mmio_shutdown_set(void) "shutdown bit set" > pci_nvme_mmio_shutdown_cleared(void) "shutdown bit cleared" > > # nvme traces for error conditions > +pci_nvme_err_mdts(uint16_t cid, size_t len) "cid %"PRIu16" len %"PRIu64"" > pci_nvme_err_invalid_dma(void) "PRP/SGL is too small for transfer size" > pci_nvme_err_invalid_prplist_ent(uint64_t prplist) "PRP list entry is null > or not page aligned: 0x%"PRIx64"" > pci_nvme_err_invalid_prp2_align(uint64_t prp2) "PRP2 is not page aligned: > 0x%"PRIx64"" > -- > 2.27.0 > > Reviewed-by: Minwoo Im Thanks,

Re: [PATCH 13/16] hw/block/nvme: add a namespace reference in NvmeRequest

2020-07-29 Thread Minwoo Im
On 20-07-20 13:37:45, Klaus Jensen wrote: > From: Klaus Jensen > > Instead of passing around the NvmeNamespace, add it as a member in the > NvmeRequest structure. > > Signed-off-by: Klaus Jensen Reviewed-by: Minwoo Im

Re: [PATCH 12/16] hw/block/nvme: refactor NvmeRequest clearing

2020-07-29 Thread Minwoo Im
On 20-07-20 13:37:44, Klaus Jensen wrote: > From: Klaus Jensen > > Move clearing of the structure from "clear before use" to "clear > after use". Yah, agree on this. Reviewed-by: Minwoo Im

Re: [PATCH 14/16] hw/block/nvme: consolidate qsg/iov clearing

2020-07-29 Thread Minwoo Im
he previous patch in this series. And I also agree on starting to make focus on nvme_req_clear() for wrap-up. Looks good to me. Reviewed-by: Minwoo Im

Re: [PATCH 15/16] hw/block/nvme: remove NvmeCmd parameter

2020-07-29 Thread Minwoo Im
On 20-07-20 13:37:47, Klaus Jensen wrote: > From: Klaus Jensen > > Keep a copy of the raw nvme command in the NvmeRequest and remove the > now redundant NvmeCmd parameter. > > Signed-off-by: Klaus Jensen I would really have suggested this change from 13th patch! Revi

Re: [PATCH 16/16] hw/block/nvme: use preallocated qsg/iov in nvme_dma_prp

2020-07-29 Thread Minwoo Im
On 20-07-20 13:37:48, Klaus Jensen wrote: > From: Klaus Jensen > > Since clean up of the request qsg/iov is now always done post-use, there > is no need to use a stack-allocated qsg/iov in nvme_dma_prp. > > Signed-off-by: Klaus Jensen > Acked-by: Keith Busch > Reviewed-by: Maxim Levitsky > -

Re: [PATCH 04/16] hw/block/nvme: remove redundant has_sg member

2020-07-29 Thread Minwoo Im
> -Original Message- > From: Qemu-devel On > Behalf Of Klaus Jensen > Sent: Thursday, July 30, 2020 3:29 AM > To: Minwoo Im > Cc: Kevin Wolf ; qemu-block@nongnu.org; Klaus Jensen > ; qemu-de...@nongnu.org; Max Reitz ; > Keith Busch > Subject: Re: [PATCH 0

Re: [PATCH v2 04/16] hw/block/nvme: remove redundant has_sg member

2020-07-30 Thread Minwoo Im
On Thu, Jul 30, 2020 at 7:06 AM Klaus Jensen wrote: > > From: Klaus Jensen > > Remove the has_sg member from NvmeRequest since it's redundant. > > Signed-off-by: Klaus Jensen Looks better than the previous one to me. Reviewed-by: Minwoo Im

Re: [PATCH v2 05/16] hw/block/nvme: destroy request iov before reuse

2020-07-30 Thread Minwoo Im
On Thu, Jul 30, 2020 at 7:06 AM Klaus Jensen wrote: > > From: Klaus Jensen > > Make sure the request iov is destroyed before reuse; fixing a memory > leak. > > Signed-off-by: Klaus Jensen Looks good to me and Thanks for splitting this up. Reviewed-by: Minwoo Im

Re: [PATCH v2 01/16] hw/block/nvme: memset preallocated requests structures

2020-07-30 Thread Minwoo Im
us Jensen > Reviewed-by: Maxim Levitsky Reviewed-by: Minwoo Im

Re: [PATCH v2 07/16] hw/block/nvme: add tracing to nvme_map_prp

2020-07-30 Thread Minwoo Im
s) + 1; > uint16_t status; > > +trace_pci_nvme_map_prp(trans_len, len, prp1, prp2, num_prps); Hmm.. Okay with this. But once QEMUSGList and QEMUIOVector instances are coming into the NvmeRequest, we just can pass the NvmeRequest instance here and print the cid as well l

Re: [PATCH v2 08/16] hw/block/nvme: add request mapping helper

2020-07-30 Thread Minwoo Im
;dptr.prp2); > + > +return nvme_map_prp(&req->qsg, &req->iov, prp1, prp2, len, n); > +} Let's do something for MPTR laster also when we are right in front of that. Looks good to me. Reviewed-by: Minwoo Im > + > static void nvme_post_cqes(void *opaque) > { >

Re: [PATCH v2 15/16] hw/block/nvme: use preallocated qsg/iov in nvme_dma_prp

2020-07-30 Thread Minwoo Im
iewed-by: Maxim Levitsky Reviewed-by: Minwoo Im

Re: [PATCH v2 14/16] hw/block/nvme: consolidate qsg/iov clearing

2020-07-30 Thread Minwoo Im
On 20-07-30 00:06:36, Klaus Jensen wrote: > From: Klaus Jensen > > Always destroy the request qsg/iov at the end of request use. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 52 - > 1 file changed, 21 insertions(+), 31 deletions(-) >

Re: [PATCH v2 16/16] hw/block/nvme: remove explicit qsg/iov parameters

2020-07-30 Thread Minwoo Im
On 20-07-30 00:06:38, Klaus Jensen wrote: > From: Klaus Jensen > > Since nvme_map_prp always operate on the request-scoped qsg/iovs, just > pass a single pointer to the NvmeRequest instead of two for each of the > qsg and iov. > > Suggested-by: Minwoo Im > Sig

Re: [PATCH v2 14/16] hw/block/nvme: consolidate qsg/iov clearing

2020-07-30 Thread Minwoo Im
wanted to make it clear to understand myself here. Reviewed-by: Minwoo Im

Re: [PATCH v2 2/4] hw/block/nvme: support multiple namespaces

2020-08-07 Thread Minwoo Im
th nsid 1. > > Signed-off-by: Klaus Jensen > Signed-off-by: Klaus Jensen > Reviewed-by: Keith Busch Reviewed-by: Minwoo Im

Re: [PATCH v5 07/13] hw/block/nvme: prefer runtime helpers instead of device parameters

2021-03-15 Thread Minwoo Im
Reviewed-by: Minwoo Im

Re: [PATCH v5 08/13] hw/block/nvme: pull lba format initialization

2021-03-15 Thread Minwoo Im
Reviewed-by: Minwoo Im

Re: [PATCH v5 09/13] hw/block/nvme: parameterize nvme_ns_nlbas

2021-03-15 Thread Minwoo Im
On 21-03-10 10:53:43, Klaus Jensen wrote: > From: Klaus Jensen > > Provide a more flexible nlbas helper. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme-ns.h | 14 ++ > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/hw/block/nvme-ns.h b/hw/block/nvme-ns.h

Re: [PATCH v5 09/13] hw/block/nvme: parameterize nvme_ns_nlbas

2021-03-16 Thread Minwoo Im
On 21-03-16 08:19:08, Klaus Jensen wrote: > On Mar 16 15:53, Minwoo Im wrote: > > On 21-03-10 10:53:43, Klaus Jensen wrote: > > > From: Klaus Jensen > > > > > > Provide a more flexible nlbas helper. > > > > > > Signed-off-by:

Re: [PATCH for-6.0 v2 7/8] hw/block/nvme: fix handling of private namespaces

2021-04-05 Thread Minwoo Im
ached" (in > QEMU terms that is) to an nvme controller device through an NvmeBus, the > nvme-ns namespace device can always get a reference to the subsystem of > the controller it is explicitly (using 'bus=' parametr) or implicitly > attaching to. > > Fixes: e57076

Re: [PATCH] hw/block/nvme: slba equal to nsze is out of bounds if nlb is 1-based

2021-04-09 Thread Minwoo Im
On 21-04-09 13:14:02, Gollu Appalanaidu wrote: > NSZE is the total size of the namespace in logical blocks. So the max > addressable logical block is NLB minus 1. So your starting logical > block is equal to NSZE it is a out of range. > > Signed-off-by: Gollu Appalanaidu > --- > hw/block/nvme.c

Re: [PATCH 2/2] hw/block/nvme: drain namespaces on sq deletion

2021-04-09 Thread Minwoo Im
") > Fixes: e4e430b3d6ba ("hw/block/nvme: add simple copy command") > Fixes: 5f5dc4c6a942 ("hw/block/nvme: zero out zones on reset") > Fixes: 2605257a26b8 ("hw/block/nvme: add the dataset management command") > Cc: Gollu Appalanaidu > Cc:

Re: [PATCH 1/2] hw/block/nvme: store aiocb in compare

2021-04-09 Thread Minwoo Im
On 21-04-08 21:37:08, Klaus Jensen wrote: > From: Klaus Jensen > > nvme_compare() fails to store the aiocb from the blk_aio_preadv() call. > Fix this. > > Fixes: 0a384f923f51 ("hw/block/nvme: add compare command") > Cc: Gollu Appalanaidu > Signed-off-by: Klaus Jensen Reviewed-by: Minwoo Im

Re: [PATCH] hw/block/nvme: slba equal to nsze is out of bounds if nlb is 1-based

2021-04-09 Thread Minwoo Im
On 21-04-09 13:55:01, Klaus Jensen wrote: > On Apr 9 20:05, Minwoo Im wrote: > > On 21-04-09 13:14:02, Gollu Appalanaidu wrote: > > > NSZE is the total size of the namespace in logical blocks. So the max > > > addressable logical block is NLB minus 1. So your starting l

Re: [PATCH] hw/block/nvme: slba equal to nsze is out of bounds if nlb is 1-based

2021-04-09 Thread Minwoo Im
On 21-04-09 14:36:19, Klaus Jensen wrote: > On Apr 9 21:31, Minwoo Im wrote: > > On 21-04-09 13:55:01, Klaus Jensen wrote: > > > On Apr 9 20:05, Minwoo Im wrote: > > > > On 21-04-09 13:14:02, Gollu Appalanaidu wrote: > > > > > NSZE is the total size o

[PATCH 1/2] hw/nvme: consider COPY command in nvme_aio_err

2023-03-24 Thread Minwoo Im
ritten in the nvme_aio_err(). Add consideration for the NVME_CMD_COPY not to overwrite the status at the end of the function. Signed-off-by: Minwoo Im Reviewed-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 49c1210fce..fef5

[PATCH 2/2] hw/nvme: check maximum copy length (MCL) for COPY

2023-03-24 Thread Minwoo Im
MCL(Maximum Copy Length) in the Identify Namespace data structure limits the number of LBAs to be copied inside of the controller. We've not checked it at all, so added the check with returning the proper error status. Signed-off-by: Minwoo Im Reviewed-by: Klaus Jensen --- hw/nvme/ctrl.c

[PATCH] hw/nvme: add comment for nvme-ns properties

2023-04-17 Thread Minwoo Im
From: Minwoo Im Add more comments of existing properties for nvme-ns device. Signed-off-by: Minwoo Im Reviewed-by: Klaus Jensen --- hw/nvme/ctrl.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 8b7be14209..87c07f5dbb 100644

[PATCH RESEND 0/2] hw/nvme: COPY fixes

2023-04-17 Thread Minwoo Im
Fix status code overwritten issue in the COPY command and a trivial patch to check the Maximum Copy Length (MCL) for COPY command. Minwoo Im (2): hw/nvme: consider COPY command in nvme_aio_err hw/nvme: check maximum copy length (MCL) for COPY hw/nvme/ctrl.c | 25 + 1

[PATCH RESEND 2/2] hw/nvme: check maximum copy length (MCL) for COPY

2023-04-17 Thread Minwoo Im
From: Minwoo Im MCL(Maximum Copy Length) in the Identify Namespace data structure limits the number of LBAs to be copied inside of the controller. We've not checked it at all, so added the check with returning the proper error status. Signed-off-by: Minwoo Im Reviewed-by: Klaus J

[PATCH RESEND 0/2] hw/nvme: COPY fixes

2023-04-17 Thread Minwoo Im
Fix status code overwritten issue in the COPY command and a trivial patch to check the Maximum Copy Length (MCL) for COPY command. Minwoo Im (2): hw/nvme: consider COPY command in nvme_aio_err hw/nvme: check maximum copy length (MCL) for COPY hw/nvme/ctrl.c | 25 + 1

[PATCH RESEND 1/2] hw/nvme: consider COPY command in nvme_aio_err

2023-04-17 Thread Minwoo Im
From: Minwoo Im If we don't have NVME_CMD_COPY consideration in the switch statement in nvme_aio_err(), it will go to have NVME_INTERNAL_DEV_ERROR and `req->status` will be ovewritten to it. During the aio context, it might set the NVMe status field like NVME_CMD_SIZE_LIMIT,

[RFC PATCH 4/5] nvme: add NMIC enum value for Identify Namespace

2021-01-15 Thread Minwoo Im
Added Namespace Multi-path I/O and Namespace Sharing Capabilities (NMIC) field to support shared namespace from controller(s). This field is in Identify Namespace data structure in [30]. Signed-off-by: Minwoo Im --- include/block/nvme.h | 4 1 file changed, 4 insertions(+) diff --git a

[RFC PATCH 0/5] hw/block/nvme: support multi-path for ctrl/ns

2021-01-15 Thread Minwoo Im
sure this is a good start for this feature, so I put the RFC tag here. Please kindly review! Thanks, Minwoo Im (5): hw/block/nvme: add controller id parameter nvme: add CMIC enum value for Identify Controller hw/block/nvme: add multi-controller param for mpath nvme: add NMIC enum value for

[RFC PATCH 5/5] hw/block/nvme: add namespace sharing param for mpath

2021-01-15 Thread Minwoo Im
=,bus=nvme0,nsid=1,... -device nvme-ns,uuid=,bus=nvme1,nsid=1,... Signed-off-by: Minwoo Im --- hw/block/nvme-ns.c | 14 -- hw/block/nvme-ns.h | 2 ++ hw/block/nvme.c| 6 ++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/hw/block/nvme-ns.c b/hw/block/nvme

[RFC PATCH 2/5] nvme: add CMIC enum value for Identify Controller

2021-01-15 Thread Minwoo Im
Added Controller Multi-path I/O and Namespace Sharing Capabilities (CMIC) field to support multi-controller in the following patches. This field is in Identify Controller data structure in [76]. Signed-off-by: Minwoo Im --- include/block/nvme.h | 4 1 file changed, 4 insertions(+) diff

[RFC PATCH 1/5] hw/block/nvme: add controller id parameter

2021-01-15 Thread Minwoo Im
user wants to set up multi-controller in a NVM subsystem. Signed-off-by: Minwoo Im --- hw/block/nvme.c | 10 ++ hw/block/nvme.h | 1 + 2 files changed, 11 insertions(+) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index cf0fe28fe6eb..132e61c0ee7b 100644 --- a/hw/block/nvme.c +++ b/hw

[RFC PATCH 3/5] hw/block/nvme: add multi-controller param for mpath

2021-01-15 Thread Minwoo Im
. Signed-off-by: Minwoo Im --- hw/block/nvme.c | 10 ++ hw/block/nvme.h | 1 + 2 files changed, 11 insertions(+) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 132e61c0ee7b..50b349cf9ea3 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -57,6 +57,11 @@ * This value will be

[PATCH] hw/block/nvme: error if drive less than a zone size

2021-01-15 Thread Minwoo Im
If a user gives backing device file less than a single zone size, the namespace capacity will be reported to 0 and the kerenl will fail to allocate namespace silently. This patch errors in case that num_zones are 0 which is backing device is less than a single zone size. Signed-off-by: Minwoo Im

Re: [PATCH] hw/block/nvme: add zoned I/O commands to nvme_io_opc_str()

2021-01-15 Thread Minwoo Im
Oh, I think I missed that one :-). Thanks!

[PATCH] hw/block/nvme: add zoned I/O commands to nvme_io_opc_str()

2021-01-15 Thread Minwoo Im
Currently, Zoned I/O commands are parsed as unknown: pci_nvme_io_cmd cid 768 nsid 1 sqid 4 opc 0x79 opname 'NVME_NVM_CMD_UNKNOWN' Parse zoned I/O commands along with other I/O commands to print. Signed-off-by: Minwoo Im --- hw/block/nvme.h | 3 +++ 1 file changed, 3 insertions(+)

Re: [RFC PATCH 0/5] hw/block/nvme: support multi-path for ctrl/ns

2021-01-15 Thread Minwoo Im
On 21-01-15 18:47:20, Klaus Jensen wrote: > On Jan 15 09:35, Keith Busch wrote: > > On Fri, Jan 15, 2021 at 02:57:45PM +0100, Klaus Jensen wrote: > > > > > > As you already mentioned, the problem I see with this approach is that > > > we have separate namespaces attached to separate controllers. S

[RFC PATCH V2 00/11] hw/block/nvme: support multi-path for ctrl/ns

2021-01-17 Thread Minwoo Im
-subsys hierarchy. [10/11 - 11/11] Since RFC V1: - Updated namespace sharing scheme to be based on nvme-subsys hierarchy. Thanks, [1] https://lists.gnu.org/archive/html/qemu-block/2021-01/msg00425.html Minwoo Im (11): hw/block/nvme: remove unused argument in nvme_ns_init_zoned hw/bl

[RFC PATCH V2 02/11] hw/block/nvme: open code for volatile write cache

2021-01-17 Thread Minwoo Im
. Also, it open coded the Get Features for VWC to check all namespaces attached to the controller, and if false detected, return directly false. Signed-off-by: Minwoo Im --- hw/block/nvme-ns.c | 4 hw/block/nvme.c| 15 --- hw/block/nvme.h| 1 - 3 files changed, 12

[RFC PATCH V2 01/11] hw/block/nvme: remove unused argument in nvme_ns_init_zoned

2021-01-17 Thread Minwoo Im
nvme_ns_init_zoned() has no use for given NvmeCtrl object. Signed-off-by: Minwoo Im --- hw/block/nvme-ns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c index 274eaf61b721..32662230130b 100644 --- a/hw/block/nvme-ns.c +++ b/hw

[RFC PATCH V2 06/11] hw/block/nvme: introduce nvme-subsys device

2021-01-17 Thread Minwoo Im
) -device nvme-subsys,id=subsys0: nqn.2019-08.org.qemu:subsys0 Signed-off-by: Minwoo Im --- hw/block/meson.build | 2 +- hw/block/nvme-subsys.c | 63 ++ hw/block/nvme-subsys.h | 25 + hw/block/nvme.c| 3 ++ 4 files changed, 92

[RFC PATCH V2 10/11] hw/block/nvme: add NMIC enum value for Identify Namespace

2021-01-17 Thread Minwoo Im
Added Namespace Multi-path I/O and Namespace Sharing Capabilities (NMIC) field to support shared namespace from controller(s). This field is in Identify Namespace data structure in [30]. Signed-off-by: Minwoo Im --- include/block/nvme.h | 4 1 file changed, 4 insertions(+) diff --git a

[RFC PATCH V2 03/11] hw/block/nvme: remove unused argument in nvme_ns_init_blk

2021-01-17 Thread Minwoo Im
Removed no longer used aregument NvmeCtrl object in nvme_ns_init_blk(). Signed-off-by: Minwoo Im --- hw/block/nvme-ns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c index c403cd36b6bd..fc42ae184e01 100644 --- a/hw/block/nvme

[RFC PATCH V2 04/11] hw/block/nvme: split setup and register for namespace

2021-01-17 Thread Minwoo Im
especially for multi-path. In that case, it should be split into two to make namespace independent from a controller. Signed-off-by: Minwoo Im --- hw/block/nvme-ns.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c index fc42ae184e01

[RFC PATCH V2 05/11] hw/block/nvme: remove unused argument in nvme_ns_setup

2021-01-17 Thread Minwoo Im
nvme_ns_setup() finally does not have nothing to do with NvmeCtrl instance. Signed-off-by: Minwoo Im --- hw/block/nvme-ns.c | 4 ++-- hw/block/nvme-ns.h | 2 +- hw/block/nvme.c| 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c

[RFC PATCH V2 11/11] hw/block/nvme: support for shared namespace in subsystem

2021-01-17 Thread Minwoo Im
ared -device nvme-ns,id=ns2,drive=,nsid=2,bus=nvme2 # Non-shared In the above example, 'ns1' will be shared to 'nvme0' and 'nvme1' in the same subsystem. On the other hand, 'ns2' will be attached to the 'nvme2' only as a private nam

[RFC PATCH V2 07/11] hw/block/nvme: support to map controller to a subsystem

2021-01-17 Thread Minwoo Im
' in above example). Signed-off-by: Minwoo Im --- hw/block/nvme.c | 30 ++ hw/block/nvme.h | 3 +++ 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index dde83aafc33d..af5b2162e2b5 100644 --- a/hw/block/nvm

[RFC PATCH V2 09/11] hw/block/nvme: support for multi-controller in subsystem

2021-01-17 Thread Minwoo Im
e attached controllers to the subsystem with a limit(32). This patch didn't take list for the controllers to make it seamless with nvme-ns device. Signed-off-by: Minwoo Im --- hw/block/nvme-subsys.c | 21 + hw/block/nvme-subsys.h | 4 +++

[RFC PATCH V2 08/11] hw/block/nvme: add CMIC enum value for Identify Controller

2021-01-17 Thread Minwoo Im
Added Controller Multi-path I/O and Namespace Sharing Capabilities (CMIC) field to support multi-controller in the following patches. This field is in Identify Controller data structure in [76]. Signed-off-by: Minwoo Im --- include/block/nvme.h | 4 1 file changed, 4 insertions(+) diff

Re: [PATCH v2 01/12] hw/block/nvme: add size to mmio read/write trace events

2021-01-18 Thread Minwoo Im
Reviewed-by: Minwoo Im

Re: [PATCH v2 02/12] hw/block/nvme: fix 64 bit register hi/lo split writes

2021-01-18 Thread Minwoo Im
On 21-01-18 10:46:55, Klaus Jensen wrote: > From: Klaus Jensen > > 64 bit registers like ASQ and ACQ should be writable by both a hi/lo 32 > bit write combination as well as a plain 64 bit write. The spec does not > define ordering on the hi/lo split, but the code currently assumes that > the low

Re: [PATCH v2 03/12] hw/block/nvme: indicate CMB support through controller capabilities register

2021-01-18 Thread Minwoo Im
Reviewed-by: Minwoo Im

Re: [PATCH v2 05/12] hw/block/nvme: allow cmb and pmr to coexist

2021-01-18 Thread Minwoo Im
Reviewed-by: Minwoo Im

Re: [PATCH v2 04/12] hw/block/nvme: move msix table and pba to BAR 0

2021-01-18 Thread Minwoo Im
On 21-01-18 10:46:57, Klaus Jensen wrote: > From: Klaus Jensen > > In the interest of supporting both CMB and PMR to be enabled on the same > device, move the MSI-X table and pending bit array out of BAR 4 and into > BAR 0. Nice! Reviewed-by: Minwoo Im Tested-by: Minwoo Im Thanks,

Re: [PATCH v2 06/12] hw/block/nvme: rename PMR/CMB shift/mask fields

2021-01-18 Thread Minwoo Im
val) (cap |= (uint64_t)(val & > CAP_CMBS_MASK) \ > + << CAP_CMBS_SHIFT) Oh, it would have been better folded into [3/12] patch, though. Changes are looking good to me to represent "Supported". Reviewed-by: Minwoo Im > > enum NvmeCapCss { > NVME_CAP_CSS_NVM= 1 << 0, > -- > 2.30.0 > >

Re: [PATCH v2 07/12] hw/block/nvme: remove redundant zeroing of PMR registers

2021-01-18 Thread Minwoo Im
On 21-01-18 10:47:00, Klaus Jensen wrote: > From: Klaus Jensen > > The controller registers are initially zero. Remove the redundant > zeroing. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 35 --- > 1 file changed, 35 deletions(-) > > diff --git a/

  1   2   3   >