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 ; C

[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

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

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,

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/

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

2024-03-31 Thread Minwoo Im
Added [2/4] 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

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

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

2024-05-07 Thread Minwoo Im
On 24-05-01 14:46:39, Klaus Jensen wrote: > On Apr 1 04:30, Minwoo Im wrote: > > 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 QE

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

2024-05-08 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 v3 0/4] hw/nvme: FDP and SR-IOV enhancements

2024-05-08 Thread Minwoo Im
done Thanks, v3: - Replace [3/4] patch with one allocating a dyanmic 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

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

2024-05-08 Thread Minwoo Im
From: 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

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

2024-05-08 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 v3 4/4] hw/nvme: Expand VI/VQ resource to uint32

2024-05-08 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 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

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

[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

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] 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] 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] hw/ufs: Fix potential bugs in MMIO read|write

2024-06-22 Thread Minwoo Im
we are accessing the MMIO registers by dword-sized only. [1] https://lore.kernel.org/qemu-devel/cafeaca82l-wznhmw0x+dr40bhm-evq2zh4dg4pdqop4xxdp...@mail.gmail.com/ Cc: Jeuk Kim Reported-by: Peter Maydell Signed-off-by: Minwoo Im --- hw/ufs/ufs.c | 31 --- 1 file

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

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

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

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

hw: nvme: Separate 'serial' property for VFs

2024-01-08 Thread Minwoo Im
nvme_subsys_register_ctrl() function. Cc: qemu-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 f02

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

2017-10-21 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-devel] [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-devel] [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] 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

Re: [PATCH v5 1/4] intel_iommu: fix FRCD construction macro

2024-07-08 Thread Minwoo Im
Signed-off-by: Clément Mathieu--Drif > Reviewed-by: Yi Liu > Reviewed-by: Zhenzhong Duan Reviewed-by: Minwoo Im

Re: [PATCH v5 3/4] intel_iommu: fix type of the mask field in VTDIOTLBPageInvInfo

2024-07-08 Thread Minwoo Im
oftware must use the > appropriate Address Mask value (0 for 4KByte page, 9 for 2-MByte page, > and 18 for 1-GByte page). Hardware implementations report the maximum > supported address mask value through the Capability register. > > Signed-off-by: Clément Mathieu--Drif Reviewed-by: Minwoo Im

Re: [PATCH v5 2/4] intel_iommu: move VTD_FRCD_PV and VTD_FRCD_PP declarations

2024-07-08 Thread Minwoo Im
On 24-07-08 11:39:54, CLEMENT MATHIEU--DRIF wrote: > From: Clément Mathieu--Drif > > These 2 macros are for high 64-bit of the FRCD registers. > Declarations have to be moved accordingly. > > Signed-off-by: Clément Mathieu--Drif Reviewed-by: Minwoo Im

Re: [PATCH ats_vtd v5 20/22] pci: add a pci-level API for ATS

2024-07-09 Thread Minwoo Im
On 24-07-02 05:52:45, CLEMENT MATHIEU--DRIF wrote: > From: Clément Mathieu--Drif > > Devices implementing ATS can send translation requests using > pci_ats_request_translation_pasid. > > The invalidation events are sent back to the device using the iommu > notifier managed with pci_register_iomm

Re: [PATCH ats_vtd v5 20/22] pci: add a pci-level API for ATS

2024-07-09 Thread Minwoo Im
On 24-07-09 11:58:53, CLEMENT MATHIEU--DRIF wrote: > > > On 09/07/2024 12:15, Minwoo Im wrote: > > Caution: External email. Do not open attachments or click links, unless > > this email comes from a known sender and you know the content is safe. > > > > > >

Re: [PATCH ats_vtd v5 20/22] pci: add a pci-level API for ATS

2024-07-11 Thread Minwoo Im
On 24-07-10 05:17:42, CLEMENT MATHIEU--DRIF wrote: > > > On 09/07/2024 23:17, Minwoo Im wrote: > > Caution: External email. Do not open attachments or click links, unless > > this email comes from a known sender and you know the content is safe. > > > > > >

Re: [PATCH ats_vtd v5 20/22] pci: add a pci-level API for ATS

2024-07-17 Thread Minwoo Im
On 24-07-11 19:00:58, CLEMENT MATHIEU--DRIF wrote: > > > On 11/07/2024 10:04, Minwoo Im wrote: > > Caution: External email. Do not open attachments or click links, unless > > this email comes from a known sender and you know the content is safe. > > > > > >

Re: [PATCH] hw/ufs: add basic info of query response upiu

2024-08-03 Thread Minwoo Im
On 08/02, Kyoungrul Kim wrote: > Modify to fill the opcode, idn, index, selector information of > all Query Response UPIU. because attr and flag operation of query > response upiu need these information too. > > Signed-off-by: KyoungrulKim 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 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 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 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 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 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 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 11/16] hw/block/nvme: be consistent about zeros vs zeroes

2020-07-29 Thread Minwoo Im
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 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-bl...@nongnu.org; Klaus Jensen > ; qemu-devel@nongnu.org; Max Reitz ; > Keith Busch > Subject: Re: [PATCH 0

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

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 1/3] hw/block/nvme: nvme_identify fixes

2021-02-22 Thread Minwoo Im
would 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/b

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 Je

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: G

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 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 please have

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

  1   2   3   >