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

2024-03-31 Thread Minwoo Im
From: Minwoo Im Secondary controller list for virtualization has been managed by Identify Secondary Controller List data structure with NvmeSecCtrlList where up to 127 secondary controller entries can be managed. The problem hasn't arisen so far because NVME_MAX_VFS has been 127. This patch

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

2024-03-31 Thread Minwoo Im
From: Minwoo Im Commit 73064edfb864 ("hw/nvme: flexible data placement emulation") intorudced NVMe FDP feature to nvme-subsys and nvme-ctrl with a single endurance group #1 supported. This means that controller should return proper identify data to host with Identify Endurance Group

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

2024-03-31 Thread Minwoo Im
From: Minwoo Im VI and VQ resources cover queue resources in each VFs in SR-IOV. Current maximum I/O queue pair size is 0x, we can expand them to cover the full number of I/O queue pairs. This patch also fixed Identify Secondary Controller List overflow due to expand of number of secondary

[PATCH v2 3/4] hw/nvme: Support SR-IOV VFs more than 127

2024-03-31 Thread Minwoo Im
From: Minwoo Im The number of virtual functions(VFs) supported in SR-IOV is 64k as per spec. To test a large number of MSI-X vectors mapping to CPU matrix in the QEMU system, we need much more than 127 VFs. This patch made support for 256 VFs per a physical function(PF). Signed-off-by: Minwoo

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

2024-03-31 Thread Minwoo Im
] commit to fix crash due to entry overflow Minwoo Im (4): hw/nvme: add Identify Endurance Group List hw/nvme: separate identify data for sec. ctrl list hw/nvme: Support SR-IOV VFs more than 127 hw/nvme: Expand VI/VQ resource to uint32 hw/nvme/ctrl.c | 53

Re: [PATCH] hw/nvme: fix invalid endian conversion

2024-02-24 Thread Minwoo Im
tialize capability structures for > primary/secondary controllers") > Reported-by: Kevin Wolf > Signed-off-by: Klaus Jensen Reviewed-by: Minwoo Im Thanks,

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

2024-02-14 Thread Minwoo Im
Hello, This patchset includes patches for adding Identify data for the recently added Endurance Group (endgrpid=1) used in FDP, and patches for increasing the maximum number of SR-IOV VF Resources to support more resources to enable testing as recent SSDs. Thanks, Minwoo Im (3): hw/nvme: add

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

2024-02-14 Thread Minwoo Im
From: Minwoo Im Commit 73064edfb864 ("hw/nvme: flexible data placement emulation") intorudced NVMe FDP feature to nvme-subsys and nvme-ctrl with a single endurance group #1 supported. This means that controller should return proper identify data to host with Identify Endurance Group

[PATCH 2/3] hw/nvme: Support SR-IOV VFs more than 127

2024-02-14 Thread Minwoo Im
From: Minwoo Im The number of virtual functions(VFs) supported in SR-IOV is 64k as per spec. To test a large number of MSI-X vectors mapping to CPU matrix in the QEMU system, we need much more than 127 VFs. This patch made support for 256 VFs per a physical function(PF). Signed-off-by: Minwoo

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

2024-02-14 Thread Minwoo Im
From: Minwoo Im VI and VQ resources cover queue resources in each VFs in SR-IOV. Current maximum I/O queue pair size is 0x, we can expand them to cover the full number of I/O queue pairs. This patch also fixed Identify Secondary Controller List overflow due to expand of number of secondary

RE: [PATCH v3 6/7] pcie_sriov: Reuse SR-IOV VF device instances

2024-02-13 Thread Minwoo Im
> -Original Message- > From: qemu-block-bounces+minwoo.im.dev=gmail@nongnu.org bounces+minwoo.im.dev=gmail@nongnu.org> On Behalf Of Akihiko Odaki > Sent: Monday, February 12, 2024 7:21 PM > To: Philippe Mathieu-Daudé ; Michael S. Tsirkin > ; Marcel Apfelbaum ; Alex > Williamson ;

Re: [PATCH] hw/nvme: fix invalid check on mcl

2024-02-08 Thread Minwoo Im
o fail in error. > > Fixes: 381ab99d8587 ("hw/nvme: check maximum copy length (MCL) for COPY") > Signed-off-by: Klaus Jensen Hi Klaus, Reviewed-by: Minwoo Im Thanks! > --- > hw/nvme/ctrl.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/

hw: nvme: Separate 'serial' property for VFs

2024-01-08 Thread Minwoo Im
mu-sta...@nongnu.org Fixes: 44c2c09488db ("hw/nvme: Add support for SR-IOV") Signed-off-by: Minwoo Im --- hw/nvme/ctrl.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index f026245d1e..a0ba3529cd 100644 --- a/hw/nvme/ctrl

Re: [PATCH] nvme: remove constant argument to tracepoint

2023-04-17 Thread Minwoo Im
On 23-03-30 14:44:27, Paolo Bonzini wrote: > The last argument to -pci_nvme_err_startfail_virt_state is always "OFFLINE" > due to the enclosing "if" condition requiring !sctrl->scs. Reported by > Coverity. > > Signed-off-by: Paolo Bonzini Reviewed-by: Minwoo Im

[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, but i

[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 Jensen

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

RE: [PATCH] vfio/pci: add support for VF token

2023-03-24 Thread Minwoo Im
> -Original Message- > From: qemu-devel-bounces+minwoo.im=samsung@nongnu.org bounces+minwoo.im=samsung@nongnu.org> On Behalf Of Alex Williamson > Sent: Friday, March 24, 2023 3:46 AM > To: Minwoo Im > Cc: Cédric Le Goater ; qemu-devel@nongnu.org; SSDR

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

2023-03-24 Thread Minwoo Im
ten 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..fef5079a71 100

RE: [PATCH] vfio/pci: add support for VF token

2023-03-22 Thread Minwoo Im
> On Mon, 20 Mar 2023 11:03:40 +0100 > Cédric Le Goater wrote: > > > On 3/20/23 08:35, Minwoo Im wrote: > > > VF token was introduced [1] to kernel vfio-pci along with SR-IOV > > > support [2]. This patch adds support VF token among PF and VF(s). To > > &g

[PATCH] vfio/pci: add support for VF token

2023-03-20 Thread Minwoo Im
tps://lore.kernel.org/linux-pci/158396393244.5601.10297430724964025753.st...@gimli.home/ [2] https://lore.kernel.org/linux-pci/158396044753.5601.14804870681174789709.st...@gimli.home/ Cc: Alex Williamson Signed-off-by: Minwoo Im Reviewed-by: Klaus Jensen --- hw/vfio/pci.c | 13 - hw/vfio/pc

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

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 2/2] hw/block/nvme: drain namespaces on sq deletion

2021-04-09 Thread Minwoo Im
t; 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: Minwoo Im

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: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 for-6.0 v2 7/8] hw/block/nvme: fix handling of private namespaces

2021-04-06 Thread Minwoo Im
ttached" (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: e570768566b3 (&q

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 v5 09/13] hw/block/nvme: parameterize nvme_ns_nlbas

2021-03-16 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 08/13] hw/block/nvme: pull lba format initialization

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

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

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

[PATCH V4 8/8] hw/block/nvme: support Identify NS Attached Controller List

2021-03-02 Thread Minwoo Im
) indicating the number of the controller id entries. So, the data can hold up to 2047 entries for the controller ids. Signed-off-by: Minwoo Im Tested-by: Klaus Jensen Reviewed-by: Klaus Jensen --- hw/block/nvme.c | 42 ++ hw/block/trace-events

[PATCH V4 5/8] hw/block/nvme: refactor nvme_select_ns_iocs

2021-03-02 Thread Minwoo Im
This patch has no functional changes. This patch just refactored nvme_select_ns_iocs() to iterate the attached namespaces of the controlller and make it invoke __nvme_select_ns_iocs(). Signed-off-by: Minwoo Im Tested-by: Klaus Jensen Reviewed-by: Klaus Jensen --- hw/block/nvme.c | 36

[PATCH V4 7/8] hw/block/nvme: support changed namespace asyncrohous event

2021-03-02 Thread Minwoo Im
, this patch set OAES(Optional Asynchronous Events Supported) in Identify Controller data structure. Signed-off-by: Minwoo Im --- hw/block/nvme-ns.h | 1 + hw/block/nvme.c | 57 hw/block/nvme.h | 4 include/block/nvme.h | 7 ++ 4

[PATCH V4 4/8] hw/block/nvme: support allocated namespace type

2021-03-02 Thread Minwoo Im
e subsystem. Signed-off-by: Minwoo Im Tested-by: Klaus Jensen Reviewed-by: Klaus Jensen --- hw/block/nvme-subsys.h | 13 + hw/block/nvme.c| 63 +++--- 2 files changed, 60 insertions(+), 16 deletions(-) diff --git a/hw/block/nvme-subsys.h b/hw/b

[PATCH V4 1/8] hw/block/nvme: support namespace detach

2021-03-02 Thread Minwoo Im
,id=ns1,drive=blknvme0,nsid=1,bus=nvme0,detached=true Signed-off-by: Minwoo Im Tested-by: Klaus Jensen Reviewed-by: Klaus Jensen --- hw/block/nvme-ns.c | 1 + hw/block/nvme-ns.h | 1 + hw/block/nvme-subsys.h | 1 + hw/block/nvme.c| 41

[PATCH V4 6/8] hw/block/nvme: support namespace attachment command

2021-03-02 Thread Minwoo Im
IOCTL. Signed-off-by: Minwoo Im --- hw/block/nvme-subsys.h | 10 +++ hw/block/nvme.c| 61 +- hw/block/nvme.h| 5 hw/block/trace-events | 2 ++ include/block/nvme.h | 6 + 5 files changed, 83 insertions(+), 1 deletion

[PATCH V4 3/8] hw/block/nvme: fix allocated namespace list to 256

2021-03-02 Thread Minwoo Im
spaces = NVME_MAX_NAMESPACES; The above line will set the NN field by id->nn so that the subsystem should also prepare at least this number of namespace list entries. Signed-off-by: Minwoo Im Tested-by: Klaus Jensen Reviewed-by: Klaus Jensen --- hw/block/nvme-subsys.h | 2 +- hw/block/nvme.h

[PATCH V4 0/8] hw/block/nvme: support namespace attachment

2021-03-02 Thread Minwoo Im
). Minwoo Im (8): hw/block/nvme: support namespace detach hw/block/nvme: fix namespaces array to 1-based hw/block/nvme: fix allocated namespace list to 256 hw/block/nvme: support allocated namespace type hw/block/nvme: refactor nvme_select_ns_iocs hw/block/nvme: support namespace attachment

[PATCH V4 2/8] hw/block/nvme: fix namespaces array to 1-based

2021-03-02 Thread Minwoo Im
subsys->namespaces array used to be sized to NVME_SUBSYS_MAX_NAMESPACES. But subsys->namespaces are being accessed with 1-based namespace id which means the very first array entry will always be empty(NULL). Signed-off-by: Minwoo Im Tested-by: Klaus Jensen Reviewed-by: Klaus Jensen -

Re: [PATCH V3 7/8] hw/block/nvme: support changed namespace asyncrohous event

2021-03-02 Thread Minwoo Im
On 21-03-01 06:56:02, Klaus Jensen wrote: > On Mar 1 01:10, Minwoo Im wrote: > > If namespace inventory is changed due to some reasons (e.g., namespace > > attachment/detachment), controller can send out event notifier to the > > host to manage namespaces. > > >

[PATCH V3 7/8] hw/block/nvme: support changed namespace asyncrohous event

2021-02-28 Thread Minwoo Im
, this patch set OAES(Optional Asynchronous Events Supported) in Identify Controller data structure. Signed-off-by: Minwoo Im --- hw/block/nvme.c | 44 hw/block/nvme.h | 7 +++ include/block/nvme.h | 7 +++ 3 files changed, 58

[PATCH V3 6/8] hw/block/nvme: support namespace attachment command

2021-02-28 Thread Minwoo Im
IOCTL. Signed-off-by: Minwoo Im --- hw/block/nvme-subsys.h | 10 +++ hw/block/nvme.c| 61 +- hw/block/nvme.h| 5 hw/block/trace-events | 2 ++ include/block/nvme.h | 6 + 5 files changed, 83 insertions(+), 1 deletion

[PATCH V3 2/8] hw/block/nvme: fix namespaces array to 1-based

2021-02-28 Thread Minwoo Im
subsys->namespaces array used to be sized to NVME_SUBSYS_MAX_NAMESPACES. But subsys->namespaces are being accessed with 1-based namespace id which means the very first array entry will always be empty(NULL). Signed-off-by: Minwoo Im Tested-by: Klaus Jensen Reviewed-by: Klaus Jensen -

[PATCH V3 1/8] hw/block/nvme: support namespace detach

2021-02-28 Thread Minwoo Im
,id=ns1,drive=blknvme0,nsid=1,bus=nvme0,detached=true Signed-off-by: Minwoo Im Tested-by: Klaus Jensen Reviewed-by: Klaus Jensen --- hw/block/nvme-ns.c | 1 + hw/block/nvme-ns.h | 1 + hw/block/nvme-subsys.h | 1 + hw/block/nvme.c| 41

[PATCH V3 8/8] hw/block/nvme: support Identify NS Attached Controller List

2021-02-28 Thread Minwoo Im
) indicating the number of the controller id entries. So, the data can hold up to 2047 entries for the controller ids. Signed-off-by: Minwoo Im Tested-by: Klaus Jensen Reviewed-by: Klaus Jensen --- hw/block/nvme.c | 42 ++ hw/block/trace-events

[PATCH V3 3/8] hw/block/nvme: fix allocated namespace list to 256

2021-02-28 Thread Minwoo Im
spaces = NVME_MAX_NAMESPACES; The above line will set the NN field by id->nn so that the subsystem should also prepare at least this number of namespace list entries. Signed-off-by: Minwoo Im Tested-by: Klaus Jensen Reviewed-by: Klaus Jensen --- hw/block/nvme-subsys.h | 2 +- hw/block/nvme.h

[PATCH V3 4/8] hw/block/nvme: support allocated namespace type

2021-02-28 Thread Minwoo Im
e subsystem. Signed-off-by: Minwoo Im Tested-by: Klaus Jensen Reviewed-by: Klaus Jensen --- hw/block/nvme-subsys.h | 13 + hw/block/nvme.c| 63 +++--- 2 files changed, 60 insertions(+), 16 deletions(-) diff --git a/hw/block/nvme-subsys.h b/hw/b

[PATCH V3 5/8] hw/block/nvme: refactor nvme_select_ns_iocs

2021-02-28 Thread Minwoo Im
This patch has no functional changes. This patch just refactored nvme_select_ns_iocs() to iterate the attached namespaces of the controlller and make it invoke __nvme_select_ns_iocs(). Signed-off-by: Minwoo Im Tested-by: Klaus Jensen Reviewed-by: Klaus Jensen --- hw/block/nvme.c | 36

[PATCH V3 0/8] hw/block/nvme: support namespace attachment

2021-02-28 Thread Minwoo Im
CNS 12h Identify command (Namespace Attached Controller list). Minwoo Im (8): hw/block/nvme: support namespace detach hw/block/nvme: fix namespaces array to 1-based hw/block/nvme: fix allocated namespace list to 256 hw/block/nvme: support allocated namespace type hw/block/nvme: refactor

Re: [PATCH V2 6/7] hw/block/nvme: support namespace attachment command

2021-02-26 Thread Minwoo Im
On 21-02-27 02:59:35, Keith Busch wrote: > On Thu, Feb 11, 2021 at 01:09:36AM +0900, Minwoo Im wrote: > > @@ -183,6 +183,7 @@ static const uint32_t nvme_cse_acs[256] = { > > [NVME_ADM_CMD_SET_FEATURES] = NVME_CMD_EFF_CSUPP, > > [NVME_ADM_CMD_GET_FEATURES]

Re: [PATCH 2/2] hw/block/nvme: add 'nvme_ana_inject_state' HMP command

2021-02-26 Thread Minwoo Im
On 21-02-14 20:24:00, Minwoo Im wrote: > Human Monitor Interface(HMP) is there for easy human debugging. This > patch added a HMP command 'nvme_ana_inject_state'. This can be executed > from the QEMU monitor. This command will have the following syntax: > > # nvme_a

Re: [PATCH V2 0/6] hw/block/nvme: support namespace attachment

2021-02-26 Thread Minwoo Im
On 21-02-11 01:09:30, Minwoo Im wrote: > Hello, > > This series supports namespace attachment: attach and detach. This is > the second version series with a fix a bug on choosing a controller to > attach for a namespace in the attach command handler. Keith, Could you ple

Re: [PATCH 2/2] hw/nvme: move device-scoped functions

2021-02-23 Thread Minwoo Im
On 21-02-09 12:08:26, Klaus Jensen wrote: > From: Klaus Jensen > > Move a bunch of functions that are internal to a device out of the > shared header. > > Signed-off-by: Klaus Jensen > --- > hw/nvme/nvme.h | 110 + > hw/nvme/ctrl.c | 90

Re: [PATCH 3/3] hw/block/nvme: report non-mdts command size limit for dsm

2021-02-22 Thread Minwoo Im
On 21-02-22 08:06:15, Klaus Jensen wrote: > From: Gollu Appalanaidu > > Dataset Management is not subject to MDTS, but exceeded a certain size > per range causes internal looping. Report this limit (DMRSL) in the NVM > command set specific identify controller data structure. > > Signed-off-by:

Re: [PATCH 2/3] hw/block/nvme: fix potential compilation error

2021-02-22 Thread Minwoo Im
On 21-02-22 08:06:14, Klaus Jensen wrote: > From: Gollu Appalanaidu > > assert may be compiled to a noop and we could end up returning an > uninitialized status. > > Fix this by always returning Internal Device Error as a fallback. > > Signed-off-by: Gollu Appalanaidu > Signed-off-by: Klaus

Re: [PATCH 1/3] hw/block/nvme: nvme_identify fixes

2021-02-22 Thread Minwoo Im
ld be great if it can be separated into two. Anyway, changes look good to me. Reviewed-by: Minwoo Im > + > +switch (c->cns) { > case NVME_ID_CNS_NS: > /* fall through */ > case NVME_ID_CNS_NS_PRESENT: > diff --git a/hw/block/trace-events b/hw/block/trace-

[PATCH V2 1/1] hw/block/nvme: support command retry delay

2021-02-14 Thread Minwoo Im
for the simplicity. This patch also introduced set/get feature command handler for Host Behavior feature (16h). In this feature, ACRE(Advanced Command Retry Enable) will be set by the host based on the Identify controller data structure, especially by CRDTs. Signed-off-by: Minwoo Im --- hw/block

[PATCH V2 0/1] hw/block/nvme: support command retry

2021-02-14 Thread Minwoo Im
/qemu-block/2021-02/msg00843.html Minwoo Im (1): hw/block/nvme: support command retry delay hw/block/nvme.c | 68 +++- hw/block/nvme.h | 2 ++ include/block/nvme.h | 13 - 3 files changed, 81 insertions(+), 2 deletions(-) -- 2.17.1

[PATCH 2/2] hw/block/nvme: add 'nvme_ana_inject_state' HMP command

2021-02-14 Thread Minwoo Im
interafce will make us not to build QEMU itself again to control things in device. This interface supports Persistent Loss state transition, but it's not going to be persistent: volatile of qemu perspective. Cc: Dr . David Alan Gilbert Signed-off-by: Minwoo Im --- hmp-commands.hx | 13

[PATCH 1/2] hw/block/nvme: support Asymmetric Namespace Access(ANA)

2021-02-14 Thread Minwoo Im
side. Signed-off-by: Minwoo Im --- hw/block/nvme-ns.c | 26 hw/block/nvme-ns.h | 3 + hw/block/nvme-subsys.c | 6 ++ hw/block/nvme-subsys.h | 6 ++ hw/block/nvme.c| 147 - hw/block/nvme.h| 25 +++ include/block

[PATCH 0/2] hw/block/nvme: support ANA

2021-02-14 Thread Minwoo Im
,nsid=2,subsys=subsys0,ana.grpid=2 \ ANA state transition (HMP command) (qemu) nvme_ana_inject_state nvme0 1 inaccessible nvme0: ANA state inaccessible(3) injected Thanks, Minwoo Im (2): hw/block/nvme: support Asymmetric Namespace Access(ANA) hw/block/nvme: add

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

2021-02-11 Thread Minwoo Im
On 21-02-11 13:07:08, Klaus Jensen wrote: > On Feb 11 11:49, Minwoo Im wrote: > > On 21-01-27 14:15:05, Klaus Jensen wrote: > > > From: Klaus Jensen > > > > > > For most commands, when issuing an AIO, the BlockAIOCB is stored in the > > > Nvm

Re: [PATCH] hw/block/nvme: fix error handling in nvme_ns_realize

2021-02-11 Thread Minwoo Im
Reviewed-by: Minwoo Im

Re: [PATCH] hw/block/nvme: fix legacy namespace registration

2021-02-11 Thread Minwoo Im
Thanks Klaus, Reviewed-by: Minwoo Im

Re: [RFC PATCH 3/3] hw/block/nvme: add nvme_inject_state HMP command

2021-02-10 Thread Minwoo Im
On 21-02-11 13:24:22, Keith Busch wrote: > On Thu, Feb 11, 2021 at 12:38:48PM +0900, Minwoo Im wrote: > > On 21-02-11 12:00:11, Keith Busch wrote: > > > But I would prefer to see advanced retry tied to real errors that can be > > > retried, like if we got an EBUSY or EAG

Re: [RFC PATCH 1/3] hw/block/nvme: set NVME_DNR in a single place

2021-02-10 Thread Minwoo Im
On 21-02-10 21:19:43, Klaus Jensen wrote: > On Feb 11 04:52, Minwoo Im wrote: > > @@ -945,6 +945,11 @@ static void nvme_post_cqes(void *opaque) > > static void nvme_enqueue_req_completion(NvmeCQueue *cq, NvmeRequest *req) > > { > > assert(cq->cqid == req->

Re: [RFC PATCH 3/3] hw/block/nvme: add nvme_inject_state HMP command

2021-02-10 Thread Minwoo Im
On 21-02-11 12:00:11, Keith Busch wrote: > On Thu, Feb 11, 2021 at 04:52:52AM +0900, Minwoo Im wrote: > > nvme_inject_state command is to give a controller state to be. > > Human Monitor Interface(HMP) supports users to make controller to a > > specified state of

Re: [RFC PATCH 3/3] hw/block/nvme: add nvme_inject_state HMP command

2021-02-10 Thread Minwoo Im
On 21-02-10 21:33:50, Klaus Jensen wrote: > On Feb 11 04:52, Minwoo Im wrote: > > nvme_inject_state command is to give a controller state to be. > > Human Monitor Interface(HMP) supports users to make controller to a > > specified state of: > > > > nor

Re: [PATCH 2/2] hw/nvme: move device-scoped functions

2021-02-10 Thread Minwoo Im
On 21-02-09 12:08:26, Klaus Jensen wrote: > From: Klaus Jensen > > Move a bunch of functions that are internal to a device out of the > shared header. May I ask why? I think some kind of these helpers can stick onto the header.

Re: [PATCH 1/2] hw/nvme: move nvme emulation out of hw/block

2021-02-10 Thread Minwoo Im
-by: Philippe Mathieu-Daudé > Signed-off-by: Klaus Jensen Please add description about consolidation of nvme-ns.h and nvme-subsys.h to the nvme.h for a unified header file when you apply this patch! :) Acked-by: Minwoo Im

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

2021-02-10 Thread Minwoo Im
On 21-01-27 14:15:05, Klaus Jensen wrote: > From: Klaus Jensen > > For most commands, when issuing an AIO, the BlockAIOCB is stored in the > NvmeRequest aiocb pointer when the AIO is issued. The purpose of storing > this is to allow the AIO to be cancelled when deleting submission > queues (it

[RFC PATCH 1/3] hw/block/nvme: set NVME_DNR in a single place

2021-02-10 Thread Minwoo Im
Set NVME_DNR in the CQ entry status field right before writing the CQ entry: in nvme_post_cqes(). We have put NVME_DNR for all CQ entry status for all error cases. This patch is a former patch to support command retry feature. Signed-off-by: Minwoo Im --- hw/block/nvme.c | 192

[RFC PATCH 3/3] hw/block/nvme: add nvme_inject_state HMP command

2021-02-10 Thread Minwoo Im
nvme0 cmd-interrupted (qemu) nvme_inject_state nvme0 normal This feature is required to test Linux kernel NVMe driver for the command retry feature. Signed-off-by: Minwoo Im --- hmp-commands.hx | 13 hw/block/nvme.c

[RFC PATCH 2/3] hw/block/nvme: support command retry delay

2021-02-10 Thread Minwoo Im
, the default value will be -1 which is CRDT will not be configured at all and ACRE will not be supported. In this case, we just set NVME_DNR to the error CQ entry just like we used to. If it's given to positive value, then ACRE will be supported by the device. Signed-off-by: Minwoo Im --- hw/block

[RFC PATCH 0/3] support command retry

2021-02-10 Thread Minwoo Im
. Then host # will retry based on the delay. Thanks, Minwoo Im (3): hw/block/nvme: set NVME_DNR in a single place hw/block/nvme: support command retry delay hw/block/nvme: add nvme_inject_state HMP command hmp-commands.hx | 13 ++ hw/block/nvme.c | 304

[PATCH V2 6/7] hw/block/nvme: support namespace attachment command

2021-02-10 Thread Minwoo Im
namespace in the NVMe subsystem. Signed-off-by: Minwoo Im --- hw/block/nvme-subsys.h | 10 +++ hw/block/nvme.c| 59 ++ hw/block/nvme.h| 5 hw/block/trace-events | 2 ++ include/block/nvme.h | 5 5 files changed, 81 insertions

[PATCH V2 3/7] hw/block/nvme: fix allocated namespace list to 256

2021-02-10 Thread Minwoo Im
spaces = NVME_MAX_NAMESPACES; The above line will set the NN field by id->nn so that the subsystem should also prepare at least this number of namespace list entries. Signed-off-by: Minwoo Im --- hw/block/nvme-subsys.h | 2 +- hw/block/nvme.h| 6 ++ 2 files changed, 7 insertions(+), 1

[PATCH V2 5/7] hw/block/nvme: refactor nvme_select_ns_iocs

2021-02-10 Thread Minwoo Im
This patch has no functional changes. This patch just refactored nvme_select_ns_iocs() to iterate the attached namespaces of the controlller and make it invoke __nvme_select_ns_iocs(). Signed-off-by: Minwoo Im --- hw/block/nvme.c | 36 +--- 1 file changed, 21

[PATCH V2 2/7] hw/block/nvme: fix namespaces array to 1-based

2021-02-10 Thread Minwoo Im
subsys->namespaces array used to be sized to NVME_SUBSYS_MAX_NAMESPACES. But subsys->namespaces are being accessed with 1-based namespace id which means the very first array entry will always be empty(NULL). Signed-off-by: Minwoo Im --- hw/block/nvme-subsys.h | 2 +- 1 file changed, 1 ins

[PATCH V2 7/7] hw/block/nvme: support Identify NS Attached Controller List

2021-02-10 Thread Minwoo Im
) indicating the number of the controller id entries. So, the data can hold up to 2047 entries for the controller ids. Signed-off-by: Minwoo Im --- hw/block/nvme.c | 42 ++ hw/block/trace-events | 1 + include/block/nvme.h | 1 + 3 files changed

[PATCH V2 4/7] hw/block/nvme: support allocated namespace type

2021-02-10 Thread Minwoo Im
e subsystem. Signed-off-by: Minwoo Im --- hw/block/nvme-subsys.h | 13 + hw/block/nvme.c| 63 +++--- 2 files changed, 60 insertions(+), 16 deletions(-) diff --git a/hw/block/nvme-subsys.h b/hw/block/nvme-subsys.h index 8a0732b22316..14627f9ccb41 10

[PATCH V2 1/7] hw/block/nvme: support namespace detach

2021-02-10 Thread Minwoo Im
,id=ns1,drive=blknvme0,nsid=1,bus=nvme0,detached=true Signed-off-by: Minwoo Im --- hw/block/nvme-ns.c | 1 + hw/block/nvme-ns.h | 1 + hw/block/nvme-subsys.h | 1 + hw/block/nvme.c| 41 +++-- hw/block/nvme.h| 22

[PATCH V2 0/6] hw/block/nvme: support namespace attachment

2021-02-10 Thread Minwoo Im
8.44 MB512 B + 0 B 1.0 Minwoo Im (7): hw/block/nvme: support namespace detach hw/block/nvme: fix namespaces array to 1-based hw/block/nvme: fix allocated namespace list to 256 hw/block/nvme: support allocated namespace type hw/block/nvme: refactor nvme_select_ns_iocs

Re: [PATCH 2/2] hw/block/nvme: add write uncorrectable command

2021-02-10 Thread Minwoo Im
> > It might be nitpick, 'nlb' would easily represent the value which is > > defined itself in the spec which is zero-based. Can we have this like: > > > > uint32_t nlb = le16_to_cpu(rw->nlb); > > > > bitmap_clear(ns->uncorrectable, slba, nlb + 1); > > > > > I do not disagree, but

Re: [PATCH 2/2] hw/block/nvme: add write uncorrectable command

2021-02-10 Thread Minwoo Im
t;cmd; > + uint64_t slba = le64_to_cpu(rw->slba); > +uint32_t nlb = le16_to_cpu(rw->nlb) + 1; > + > +bitmap_clear(ns->uncorrectable, slba, nlb); It might be nitpick, 'nlb' would easily represent the value which is defined itself in the spec which is zero-based. Can we have this like: uint32_t nlb = le16_to_cpu(rw->nlb); bitmap_clear(ns->uncorrectable, slba, nlb + 1); Otherwise, it looks good to me. Reviewed-by: Minwoo Im

Re: [PATCH 1/2] hw/block/nvme: add oncs device parameter

2021-02-10 Thread Minwoo Im
CS. > > Signed-off-by: Gollu Appalanaidu > Signed-off-by: Klaus Jensen Reviewed-by: Minwoo Im

Re: [PATCH v2] hw/block: nvme: Fix a build error in nvme_get_feature()

2021-02-10 Thread Minwoo Im
On 21-02-10 18:23:17, Bin Meng wrote: > From: Bin Meng > > Current QEMU HEAD nvme.c does not compile: > > hw/block/nvme.c:3242:9: error: ‘result’ may be used uninitialized in this > function [-Werror=maybe-uninitialized] > trace_pci_nvme_getfeat_vwcache(result ? "enabled" :

Re: [PATCH RFC v2 3/8] hw/block/nvme: fix strerror printing

2021-02-08 Thread Minwoo Im
On 21-02-07 22:49:35, Klaus Jensen wrote: > From: Klaus Jensen > > Fix missing sign inversion. > > Signed-off-by: Klaus Jensen Reviewed-by: Minwoo Im

Re: [PATCH RFC v2 2/8] hw/block/nvme: remove block accounting for write zeroes

2021-02-08 Thread Minwoo Im
On 21-02-07 22:49:34, Klaus Jensen wrote: > From: Klaus Jensen > > A Write Zeroes commands should not be counted in either the 'Data Units > Written' or in 'Host Write Commands' SMART/Health Information Log page. > > Signed-off-by: Klaus Jensen Reviewed-by: Minwoo Im

Re: [PATCH RFC v2 1/8] hw/block/nvme: remove redundant len member in compare context

2021-02-08 Thread Minwoo Im
On 21-02-07 22:49:33, Klaus Jensen wrote: > From: Klaus Jensen > > The 'len' member of the nvme_compare_ctx struct is redundant since the > same information is available in the 'iov' member. > > Signed-off-by: Klaus Jensen Reviewed-by: Minwoo Im

[PATCH 6/6] hw/block/nvme: support namespace attachment command

2021-02-05 Thread Minwoo Im
namespace in the NVMe subsystem. Signed-off-by: Minwoo Im --- hw/block/nvme-subsys.h | 10 +++ hw/block/nvme.c| 59 ++ hw/block/nvme.h| 5 hw/block/trace-events | 2 ++ include/block/nvme.h | 5 5 files changed, 81 insertions

[PATCH 5/6] hw/block/nvme: refactor nvme_select_ns_iocs

2021-02-05 Thread Minwoo Im
This patch has no functional changes. This patch just refactored nvme_select_ns_iocs() to iterate the attached namespaces of the controlller and make it invoke __nvme_select_ns_iocs(). Signed-off-by: Minwoo Im --- hw/block/nvme.c | 36 +--- 1 file changed, 21

[PATCH 4/6] hw/block/nvme: support allocated namespace type

2021-02-05 Thread Minwoo Im
e subsystem. Signed-off-by: Minwoo Im --- hw/block/nvme-subsys.h | 13 + hw/block/nvme.c| 63 +++--- 2 files changed, 60 insertions(+), 16 deletions(-) diff --git a/hw/block/nvme-subsys.h b/hw/block/nvme-subsys.h index 8a0732b22316..14627f9ccb41 10

[PATCH 3/6] hw/block/nvme: fix allocated namespace list to 256

2021-02-05 Thread Minwoo Im
spaces = NVME_MAX_NAMESPACES; The above line will set the NN field by id->nn so that the subsystem should also prepare at least this number of namespace list entries. Signed-off-by: Minwoo Im --- hw/block/nvme-subsys.h | 2 +- hw/block/nvme.h| 6 ++ 2 files changed, 7 insertions(+), 1

[PATCH 1/6] hw/block/nvme: support namespace detach

2021-02-05 Thread Minwoo Im
,id=ns1,drive=blknvme0,nsid=1,bus=nvme0,detached=true Signed-off-by: Minwoo Im --- hw/block/nvme-ns.c | 1 + hw/block/nvme-ns.h | 1 + hw/block/nvme-subsys.h | 1 + hw/block/nvme.c| 41 +++-- hw/block/nvme.h| 22

[PATCH 2/6] hw/block/nvme: fix namespaces array to 1-based

2021-02-05 Thread Minwoo Im
subsys->namespaces array used to be sized to NVME_SUBSYS_MAX_NAMESPACES. But subsys->namespaces are being accessed with 1-based namespace id which means the very first array entry will always be empty(NULL). Signed-off-by: Minwoo Im --- hw/block/nvme-subsys.h | 2 +- 1 file changed, 1 ins

  1   2   3   >