Re: [PATCH v3 09/11] hw/nvme: enable namespace rescap function

2024-05-24 Thread Klaus Jensen
On May 17 17:52, Changqi Lu wrote: > This commit enables the rescap function in the > namespace by detecting the supported reservation > function in the backend driver. > > Signed-off-by: Changqi Lu > Signed-off-by: zhenwei pi > --- > hw/nvme/ns.c | 8 > 1 file changed, 8 insertions(+)

Re: [PATCH v3 08/11] hw/nvme: enable ONCS reservations

2024-05-24 Thread Klaus Jensen
On May 17 17:52, Changqi Lu wrote: > This commit enables ONCS to support the reservation > function at the controller level. It also lays the > groundwork for detecting and enabling the reservation > function on a per-namespace basis in RESCAP. > > Signed-off-by: Changqi Lu > Signed-off-by: zhenw

Re: [PATCH v3 06/11] block/nvme: add reservation command protocol constants

2024-05-24 Thread Klaus Jensen
On May 17 17:52, Changqi Lu wrote: > Add constants for the NVMe persistent command protocol. > The constants include the reservation command opcode and > reservation type values defined in section 7 of the NVMe > 2.0 specification. > > Signed-off-by: Changqi Lu > Signed-off-by: zhenwei pi > ---

Re: [PATCH v3 09/11] hw/nvme: enable namespace rescap function

2024-05-24 Thread Klaus Jensen
On May 17 17:52, Changqi Lu wrote: > This commit enables the rescap function in the > namespace by detecting the supported reservation > function in the backend driver. > > Signed-off-by: Changqi Lu > Signed-off-by: zhenwei pi > --- > hw/nvme/ns.c | 8 > 1 file changed, 8 insertions(+)

Re: [PATCH v3 10/11] hw/nvme: add reservation protocal command

2024-05-24 Thread Klaus Jensen
false, nvme_misc_cb, req); > +break; > +case NVME_RESV_ACQUIRE_ACTION_PREEMPT_AND_ABORT: > +req->aiocb = blk_aio_pr_preempt(ns->blkconf.blk, key_info.cr_key, > +key_info.nr_key, type, true, > +

Re: [PATCH] hw/nvme: fix mo field in io mgnt send

2024-05-24 Thread Klaus Jensen
On May 8 09:36, Vincent Fu wrote: > On 5/7/24 10:05, Vincent Fu wrote: > > On 5/6/24 04:06, Klaus Jensen wrote: > > > The Management Operation field of I/O Management Send is only 8 bits, > > > not 16. > > > > > > Fixes: 73064edfb864 ("hw/nvme

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

2024-06-05 Thread Klaus Jensen
exible=$nr_vq,sriov_vi_flexible=$nr_vi > \ > > To fix this issue, this patch modifies the calculation of BAR size in > the PF and VF initialization by using different elements: > > PF: `max_ioqpairs + 1` with `msix_qsize` > VF: VQFRSM with VIFRSM > > Signed

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

2024-06-11 Thread Klaus Jensen
nvme: separate identify data for sec. ctrl list > hw/nvme: Allocate sec-ctrl-list as a dynamic array > hw/nvme: Expand VI/VQ resource to uint32 > > hw/nvme/ctrl.c | 59 +++----- > hw/nvme/nvme.h | 19 +++--- > hw/nvme/subsys.c | 10 +--- > include/block/nvme.h | 1 + > 4 files changed, 54 insertions(+), 35 deletions(-) > > -- > 2.34.1 > Looks good Minwoo! Grabbing for nvme-next. Reviewed-by: Klaus Jensen signature.asc Description: PGP signature

Re: [PATCH v7 08/10] hw/nvme: enable ONCS and rescap function

2024-07-08 Thread Klaus Jensen
de/block/nvme.h > index 8b125f7769..9b9eaeb3a7 100644 > --- a/include/block/nvme.h > +++ b/include/block/nvme.h > @@ -1251,7 +1251,7 @@ enum NvmeIdCtrlOncs { > NVME_ONCS_DSM = 1 << 2, > NVME_ONCS_WRITE_ZEROES = 1 << 3, > NVME_ONCS_FEATURES = 1 <&l

Re: [PATCH v7 07/10] hw/nvme: add helper functions for converting reservation types

2024-07-08 Thread Klaus Jensen
AP_WR_EX_RO : 0; > +res |= (block_pr_cap & BLK_PR_CAP_EX_AC_RO) ? > + NVME_PR_CAP_EX_AC_RO : 0; > +res |= (block_pr_cap & BLK_PR_CAP_WR_EX_AR) ? > + NVME_PR_CAP_WR_EX_AR : 0; > +res |= (block_pr_cap & BLK_PR_CAP_EX_AC_AR) ? > + NVME_PR_CAP_EX_AC_AR : 0; > + > +return res; > +} > + > typedef struct NvmeSQueue { > struct NvmeCtrl *ctrl; > uint16_tsqid; > -- > 2.20.1 > Reviewed-by: Klaus Jensen -- One of us - No more doubt, silence or taboo about mental illness. signature.asc Description: PGP signature

Re: [PATCH] hw/nvme: Fix memory leak in nvme_dsm

2024-07-10 Thread Klaus Jensen
; @@ -2592,6 +2592,7 @@ next: > done: > iocb->aiocb = NULL; > iocb->common.cb(iocb->common.opaque, iocb->ret); > +g_free(iocb->range); > qemu_aio_unref(iocb); > } > > -- > 2.34.1 > Thanks! LGTM Reviewed-by: Klaus Jensen Fixes: d7d1474fd85d ("hw/nvme: reimplement dsm to allow cancellation") Cc: qemu-sta...@nongnu.org signature.asc Description: PGP signature

[PULL 2/7] hw/nvme: fix number of PIDs for FDP RUH update

2024-07-11 Thread Klaus Jensen
From: Vincent Fu The number of PIDs is in the upper 16 bits of cdw10. So we need to right-shift by 16 bits instead of only a single bit. Fixes: 73064edfb864 ("hw/nvme: flexible data placement emulation") Cc: qemu-sta...@nongnu.org Signed-off-by: Vincent Fu Reviewed-by: Klaus Jensen

[PULL 6/7] hw/nvme: Allocate sec-ctrl-list as a dynamic array

2024-07-11 Thread Klaus Jensen
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. Reviewed-by: Klaus Jensen Signed-off-by: Minwoo Im Signed-off-by: Klaus Jen

[PULL 5/7] hw/nvme: separate identify data for sec. ctrl list

2024-07-11 Thread Klaus Jensen
data structure when the command comes in. Reviewed-by: Klaus Jensen Signed-off-by: Minwoo Im Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 21 ++--- hw/nvme/nvme.h | 14 -- hw/nvme/subsys.c | 8 3 files changed, 22 insertions(+), 21 deletions(-) diff --

[PULL 7/7] hw/nvme: Expand VI/VQ resource to uint32

2024-07-11 Thread Klaus Jensen
controllers. Reviewed-by: Klaus Jensen Signed-off-by: Minwoo Im Signed-off-by: Klaus Jensen --- 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 1e50b57707ba..5b1b0cabcfc3 100644 --- a/hw

[PULL 0/7] hw/nvme patches

2024-07-11 Thread Klaus Jensen
From: Klaus Jensen Hi, The following changes since commit 59084feb256c617063e0dbe7e64821ae8852d7cf: Merge tag 'pull-aspeed-20240709' of https://github.com/legoater/qemu into staging (2024-07-09 07:13:55 -0700) are available in the Git repository at: https://gitlab.com/birkelun

[PULL 1/7] hw/nvme: Add support for setting the MQES for the NVMe emulation

2024-07-11 Thread Klaus Jensen
property is not provided then the default mqes will still be 0x7ff (the queue size is 2048 entries). Signed-off-by: John Berg Reviewed-by: Keith Busch Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 8 +++- hw/nvme/nvme.h | 1 + 2 files changed, 8 insertions

[PULL 4/7] hw/nvme: add Identify Endurance Group List

2024-07-11 Thread Klaus Jensen
List (CNS 19h). 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 Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c

[PULL 3/7] hw/nvme: fix BAR size mismatch of SR-IOV VF

2024-07-11 Thread Klaus Jensen
initialization by using different elements: PF: `max_ioqpairs + 1` with `msix_qsize` VF: VQFRSM with VIFRSM Signed-off-by: Minwoo Im Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff

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

2024-07-15 Thread Klaus Jensen
in a persistent manner. > Signed-off-by: Changqi Lu > Signed-off-by: zhenwei pi > Acked-by: Klaus Jensen > --- > hw/nvme/ctrl.c | 318 +++ > hw/nvme/nvme.h | 4 + > include/block/nvme.h | 37 + > 3 files changed

Re: [PATCH 2/2] nvme/ctrl: remove useless type cast

2024-07-22 Thread Klaus Jensen
eq) > { > -NvmeCmd *cmd = (NvmeCmd *)&req->cmd; > +NvmeCmd *cmd = &req->cmd; > NvmeNamespace *ns = req->ns; > /* cdw12 is zero-based number of dwords to return. Convert to bytes */ > uint32_t data_size = (le32_to_cpu(cmd->cdw12) + 1) <<

[PULL 4/4] hw/nvme: remove useless type cast

2024-07-22 Thread Klaus Jensen
From: Yao Xingtao The type of req->cmd is NvmeCmd, cast the pointer of this type to NvmeCmd* is useless. Signed-off-by: Yao Xingtao Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.

[PULL 2/4] hw/nvme: add cross namespace copy support

2024-07-22 Thread Klaus Jensen
From: Arun Kumar Extend copy command to copy user data across different namespaces via support for specifying a namespace for each source range Signed-off-by: Arun Kumar Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 369

[PULL 1/4] hw/nvme: fix memory leak in nvme_dsm

2024-07-22 Thread Klaus Jensen
to allow cancellation") Signed-off-by: Zheyu Ma Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 5b1b0cabcfc3..f7b4e4627dd2 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl

[PULL 3/4] hw/nvme: actually implement abort

2024-07-22 Thread Klaus Jensen
From: Ayush Mishra Abort was not implemented previously, but we can implement it for AERs and asynchrnously for I/O. Signed-off-by: Ayush Mishra Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 32 1 file changed, 32 insertions

[PULL 0/4] hw/nvme patches

2024-07-22 Thread Klaus Jensen
From: Klaus Jensen Hi, The following changes since commit a7ddb48bd1363c8bcdf42776d320289c42191f01: Merge tag 'pull-aspeed-20240721' of https://github.com/legoater/qemu into staging (2024-07-22 07:52:05 +1000) are available in the Git repository at: https://gitlab.com/birkelun

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

2024-07-25 Thread Klaus Jensen
On Jul 25 19:42, 卢长奇 wrote: > Hi, > > ``` > 2685 nvme_status->regctl_ds[i].cntlid = nvme_ctrl(req)->cntlid; > 2686 nvme_status->regctl_ds[i].rkey = keys_info->keys[i]; > 2687 nvme_status->regctl_ds[i].rcsts = keys_info->keys[i] == > 2688 reservation->key ? 1 : 0; > 2689 /* hostid is not supported

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

2024-08-18 Thread Klaus Jensen
> nvme resv-register /dev/nvme0n1 --crkey 3 --nrkey 5 --rrega 2 > > #release > > nvme resv-release /dev/nvme0n1 --crkey 5 --rtype 1 --rrela 0 > > #clear > > nvme resv-release /dev/nvme0n1 --crkey 5 --rtype 1 --rrela 1 > > #reserve > > nvme resv-acquire /dev/nvm

[PULL for-9.1 1/1] hw/nvme: fix leak of uninitialized memory in io_mgmt_recv

2024-08-19 Thread Klaus Jensen
From: Klaus Jensen Yutaro Shimizu from the Cyber Defense Institute discovered a bug in the NVMe emulation that leaks contents of an uninitialized heap buffer if subsystem and FDP emulation are enabled. Cc: qemu-sta...@nongnu.org Reported-by: Yutaro Shimizu Signed-off-by: Klaus Jensen --- hw

[PULL for-9.1 0/1] hw/nvme late fix

2024-08-19 Thread Klaus Jensen
From: Klaus Jensen Hi, The following changes since commit 48e4ba59a3756aad743982da16bf9b5120d91a0c: Merge tag 'pull-riscv-to-apply-20240819-1' of https://github.com/alistair23/qemu into staging (2024-08-19 14:55:23 +1000) are available in the Git repository at: https://

Re: [PULL for-9.1 1/1] hw/nvme: fix leak of uninitialized memory in io_mgmt_recv

2024-08-20 Thread Klaus Jensen
On Aug 20 12:30, Philippe Mathieu-Daudé wrote: > Hi Klaus, > > On 20/8/24 06:45, Klaus Jensen wrote: > > From: Klaus Jensen > > > > Yutaro Shimizu from the Cyber Defense Institute discovered a bug in the > > NVMe emulation that leaks contents of an uninitialized

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

2024-08-27 Thread Klaus Jensen
e0n1 --crkey 3 --nrkey 5 --rrega 2 > #release > nvme resv-release /dev/nvme0n1 --crkey 5 --rtype 1 --rrela 0 > #clear > nvme resv-release /dev/nvme0n1 --crkey 5 --rtype 1 --rrela 1 > #reserve > nvme resv-acquire /dev/nvme0n1 --crkey 3 --rtype 1 --racqa 0 > #premmpt > nvme r

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

2024-08-27 Thread Klaus Jensen
in a persistent manner. > Signed-off-by: Changqi Lu > Signed-off-by: zhenwei pi > Acked-by: Klaus Jensen > --- > hw/nvme/ctrl.c | 318 +++ > hw/nvme/nvme.h | 4 + > include/block/nvme.h | 37 + > 3 files change

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

2024-08-27 Thread Klaus Jensen
in a persistent manner. > Signed-off-by: Changqi Lu > Signed-off-by: zhenwei pi > Acked-by: Klaus Jensen > --- > hw/nvme/ctrl.c | 318 +++ > hw/nvme/nvme.h | 4 + > include/block/nvme.h | 37 + > 3 files chang

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

2024-08-28 Thread Klaus Jensen
On Aug 28 00:20, 卢长奇 wrote: > Hi, > > I want to know if I understand it correctly. > > ``` > static void nvme_aio_err(NvmeRequest *req, int ret) > { > uint16_t status = NVME_SUCCESS; > Error *local_err = NULL; > > switch (req->cmd.opcode) { > case NVME_CMD_READ: > case NVME_CMD_RESV_REPORT: > st

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

2024-09-05 Thread Klaus Jensen
in a persistent manner. > Signed-off-by: Changqi Lu > Signed-off-by: zhenwei pi > Acked-by: Klaus Jensen > --- > hw/nvme/ctrl.c | 330 +++ > hw/nvme/nvme.h | 4 + > include/block/nvme.h | 37 + > 3 files change

Re: [PATCH v2 18/48] hw/nvme: replace assert(false) with g_assert_not_reached()

2024-09-12 Thread Klaus Jensen
--- > hw/nvme/ctrl.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > Reviewed-by: Klaus Jensen

Re: [PATCH 1/1] hw/nvme: add atomic write support

2024-09-12 Thread Klaus Jensen
> set to the AWUN value. If Disable Normal is set, the maximum atomic write > size is set to AWUPF. > > Signed-off-by: Alan Adamson LGTM. I can fix up the few nits below. Keith, I'll let this linger a few days for you to comment :) Revi

Re: [PATCH 0/1] hw/nvme: add atomic write support

2024-09-17 Thread Klaus Jensen
On Aug 20 09:11, Alan Adamson wrote: > Since there is work in the Linux NVMe Driver community to add Atomic Write > support, it would be desirable to be able to test it with qemu nvme emulation. > > This patch will focus on supporting NVMe controller atomic write parameters > (AWUN and > AWUPF)

[PULL 09/15] hw/nvme: Add support for the Virtualization Management command

2022-06-23 Thread Klaus Jensen
From: Łukasz Gieryk With the new command one can: - assign flexible resources (queues, interrupts) to primary and secondary controllers, - toggle the online/offline state of given controller. Signed-off-by: Łukasz Gieryk Acked-by: Michael S. Tsirkin Reviewed-by: Klaus Jensen Signed-off

[PULL 10/15] docs: Add documentation for SR-IOV and Virtualization Enhancements

2022-06-23 Thread Klaus Jensen
enable SR-IOV support. Signed-off-by: Lukasz Maniak Acked-by: Michael S. Tsirkin Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- docs/system/devices/nvme.rst | 82 1 file changed, 82 insertions(+) diff --git a/docs/system/devices/nvme.rst b/docs

[PULL 11/15] hw/nvme: Update the initalization place for the AER queue

2022-06-23 Thread Klaus Jensen
uninitialized queue. While it’s an interesting question whether a VF should support AER in the first place, I don’t think it must be answered today. Signed-off-by: Łukasz Gieryk Reviewed-by: Klaus Jensen Acked-by: Michael S. Tsirkin Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 3 +-- 1 file changed

[PULL 12/15] hw/acpi: Make the PCI hot-plug aware of SR-IOV

2022-06-23 Thread Klaus Jensen
posed fix is to make the PCI ACPI code aware of SR/IOV. Signed-off-by: Łukasz Gieryk Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin Signed-off-by: Klaus Jensen --- hw/acpi/pcihp.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/acpi/pcihp.c b/hw/acpi/p

[PULL 14/15] Revert "hw/block/nvme: add support for sgl bit bucket descriptor"

2022-06-23 Thread Klaus Jensen
From: Klaus Jensen This reverts commit d97eee64fef35655bd06f5c44a07fdb83a6274ae. The emulated controller correctly accounts for not including bit buckets in the controller-to-host data transfer, however it doesn't correctly account for the holes for the on-disk data offsets. Reported-by:

[PULL 13/15] hw/nvme: clean up CC register write logic

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

Re: [PATCH] hw/nvme: fix example serial in documentation

2022-06-27 Thread Klaus Jensen
On Jun 27 14:39, Niklas Cassel wrote: > The serial prop on the controller is actually describing the nvme > subsystem serial, which has to be identical for all controllers within > the same nvme subsystem. > > This is enforced since commit a859eb9f8f64 ("hw/nvme: enforce common > serial per subsys

Re: [PATCH v2 4/4] hw/nvme: add new never_ready parameter to test the DNR bit

2022-06-28 Thread Klaus Jensen
On Jun 27 13:47, Niklas Cassel wrote: > Since we verify that "ready_delay" parameter has to be smaller than CRWMT, > we know that the namespace will always become ready. > Therefore the "Namespace Not Ready" status code will never have the DNR > bit set. > > Add a new parameter "never_ready" that

Re: [PATCH v2 1/4] hw/nvme: claim NVMe 2.0 compliance

2022-06-28 Thread Klaus Jensen
On Jun 27 10:59, Christoph Hellwig wrote: > On Mon, Jun 27, 2022 at 01:47:28PM +0200, Niklas Cassel via wrote: > > CRMS.CRWMS bit shall be set to 1 on controllers compliant with versions > > later than NVMe 1.4. > > > > The first version later than NVMe 1.4 is NVMe 2.0 > > > > Let's claim complia

Re: nvme shared namespaces without subsys

2022-06-28 Thread Klaus Jensen
On Jun 27 18:34, Niklas Cassel wrote: > Hello qemu-nvme maintainers, > > I noticed that since commit > 916b0f0b5264 ("hw/nvme: change nvme-ns 'shared' default") > > The default value of ns param 'shared' is true, regardless > if there is a nvme-subsys node or not. > > It probably doesn't matter

Re: [PATCH v2 2/4] hw/nvme: store a pointer to the NvmeSubsystem in the NvmeNamespace

2022-06-28 Thread Klaus Jensen
ams params; > +NvmeSubsystem *subsys; > > struct { > uint32_t err_rec; > -- > 2.36.1 > No problemo. Reviewed-by: Klaus Jensen signature.asc Description: PGP signature

Re: [PATCH v2 3/4] hw/nvme: add support for ratified TP4084

2022-06-28 Thread Klaus Jensen
On Jun 27 13:47, Niklas Cassel wrote: > TP4084 adds a new mode, CC.CRIME, that can be used to mark a namespace > as ready independently from the controller. > > When CC.CRIME is 0 (default), things behave as before, all namespaces > are ready when CSTS.RDY gets set to 1. > > When CC.CRIME is 1, t

Re: [PATCH] hw/nvme: fix example serial in documentation

2022-06-28 Thread Klaus Jensen
On Jun 28 13:26, Daniel P. Berrangé wrote: > On Mon, Jun 27, 2022 at 02:39:57PM +0200, Niklas Cassel via wrote: > > The serial prop on the controller is actually describing the nvme > > subsystem serial, which has to be identical for all controllers within > > the same nvme subsystem. > > Given th

Re: [PATCH] hw/nvme: force nvme-ns param 'shared' to false if no nvme-subsys node

2022-07-06 Thread Klaus Jensen
On Jun 28 14:22, Niklas Cassel wrote: > Since commit 916b0f0b5264 ("hw/nvme: change nvme-ns 'shared' default") > the default value of nvme-ns param 'shared' is set to true, regardless > if there is a nvme-subsys node or not. > > On a system without a nvme-subsys node, a namespace will never be abl

Re: [QEMU 1/1] nvme: Fix misleading macro when mixed with ternary operator

2022-07-12 Thread Klaus Jensen
tions(-) > > Klaus: ping > > Reviewed-by: Stefan Hajnoczi Sorry, Thanks Darren, applied to nvme-next! Reviewed-by: Klaus Jensen signature.asc Description: PGP signature

[PATCH] hw/nvme: add trace events for ioeventfd

2022-07-13 Thread Klaus Jensen
From: Klaus Jensen While testing Jinhaos ioeventfd patch I found it useful with a couple of additional trace events since we no longer see the mmio events. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 8 hw/nvme/trace-events | 4 2 files changed, 12 insertions(+) diff

Re: [PATCH 00/12] hw/nvme: misc fixes and updates

2022-07-13 Thread Klaus Jensen
On Jun 23 23:18, Klaus Jensen wrote: > From: Klaus Jensen > > This series includes a couple of misc fixes as well as some cleanup > pertaining to the aio handling in flush, dsm, copy and zone reset. As > Jinhao gets around to iothread stuff, it might come in handy to have > thi

[PULL 1/6] hw/nvme: Implement shadow doorbell buffer support

2022-07-15 Thread Klaus Jensen
bell buffer for the admin queue. Copying the doorbell register value to the shadow doorbell buffer allows us to support these hosts as well as spec-compliant hosts that use shadow doorbell buffer for the admin queue. Signed-off-by: Jinhao Fan Reviewed-by: Klaus Jensen Reviewed-by: Keith Busch [k.je

[PULL 0/6] hw/nvme updates

2022-07-15 Thread Klaus Jensen
From: Klaus Jensen Hi, The following changes since commit 8482ab545e52f50facacfe1118b22b97462724ab: Merge tag 'qga-win32-pull-2022-07-13' of github.com:kostyanf14/qemu into staging (2022-07-14 14:52:16 +0100) are available in the Git repository at: git://git.infradead.org/qem

[PULL 2/6] hw/nvme: Add trace events for shadow doorbell buffer

2022-07-15 Thread Klaus Jensen
Buffer Config command. Signed-off-by: Jinhao Fan Reviewed-by: Klaus Jensen Reviewed-by: Keith Busch [k.jensen: rebased] Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 5 + hw/nvme/trace-events | 5 + 2 files changed, 10 insertions(+) diff --git a/hw/nvme/ctrl.c b/hw/nvme

[PULL 3/6] hw/nvme: fix example serial in documentation

2022-07-15 Thread Klaus Jensen
. Fix the documentation, so that people copying the qemu command line example won't get an error on qemu start. Signed-off-by: Niklas Cassel Signed-off-by: Klaus Jensen --- docs/system/devices/nvme.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/system/devices/nvme.rs

[PULL 6/6] hw/nvme: Use ioeventfd to handle doorbell updates

2022-07-15 Thread Klaus Jensen
-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 113 - hw/nvme/nvme.h | 5 +++ 2 files changed, 117 insertions(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 55cb0ba1d591..533ad14e7a61 100644 --- a/hw/nvme/ct

[PULL 4/6] hw/nvme: force nvme-ns param 'shared' to false if no nvme-subsys node

2022-07-15 Thread Klaus Jensen
more than one controller anyway. Signed-off-by: Niklas Cassel Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ns.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/nvme/ns.c b/hw/nvme/ns.c index 870c3ca1a2f0..62a1f97be010 100644 --- a/hw/nvme/ns.c +++ b/hw/n

[PULL 5/6] nvme: Fix misleading macro when mixed with ternary operator

2022-07-15 Thread Klaus Jensen
& FLAG_TEST which will result in a different result to: (x ? a: b) & FLAG_TEST. The macros should wrap each of the parameters in brackets to ensure the correct result on expansion. Signed-off-by: Darren Kenny Reviewed-by: Stefan Hajnoczi Reviewed-by: Klaus Jensen Signed-off-by: Klau

Re: [PATCH] hw/nvme: add trace events for ioeventfd

2022-07-27 Thread Klaus Jensen
On Jul 20 10:47, Jinhao Fan wrote: > at 10:41 PM, Jinhao Fan wrote: > > > at 1:34 PM, Klaus Jensen wrote: > > > >> From: Klaus Jensen > >> > >> While testing Jinhaos ioeventfd patch I found it useful with a couple of > >> addition

[PATCH for-7.1 0/3] hw/nvme: misc ioeventfd fixes

2022-07-28 Thread Klaus Jensen
From: Klaus Jensen A set of fixes/changes to the ioeventfd support. Klaus Jensen (3): hw/nvme: skip queue processing if notifier is cleared hw/nvme: unregister the event notifier handler on the main loop hw/nvme: do not enable ioeventfd by default hw/nvme/ctrl.c | 12 +--- 1

[PATCH for-7.1 1/3] hw/nvme: skip queue processing if notifier is cleared

2022-07-28 Thread Klaus Jensen
From: Klaus Jensen While it is safe to process the queues when they are empty, skip it if the event notifier callback was invoked spuriously. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme

[PATCH for-7.1 2/3] hw/nvme: unregister the event notifier handler on the main loop

2022-07-28 Thread Klaus Jensen
From: Klaus Jensen Make sure the notifier handler is unregistered in the main loop prior to cleaning it up. Fixes: 2e53b0b45024 ("hw/nvme: Use ioeventfd to handle doorbell updates") Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH for-7.1 3/3] hw/nvme: do not enable ioeventfd by default

2022-07-28 Thread Klaus Jensen
From: Klaus Jensen Do not enable ioeventfd by default. Let the feature mature a bit before we consider enabling it by default. Fixes: 2e53b0b45024 ("hw/nvme: Use ioeventfd to handle doorbell updates") Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 inser

[PULL for-7.1 1/3] hw/nvme: skip queue processing if notifier is cleared

2022-08-01 Thread Klaus Jensen
From: Klaus Jensen While it is safe to process the queues when they are empty, skip it if the event notifier callback was invoked spuriously. Reviewed-by: Keith Busch Reviewed-by: Jinhao Fan Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 8 ++-- 1 file changed, 6 insertions(+), 2

[PULL for-7.1 2/3] hw/nvme: unregister the event notifier handler on the main loop

2022-08-01 Thread Klaus Jensen
From: Klaus Jensen Make sure the notifier handler is unregistered in the main loop prior to cleaning it up. Fixes: 2e53b0b45024 ("hw/nvme: Use ioeventfd to handle doorbell updates") Reviewed-by: Keith Busch Reviewed-by: Jinhao Fan Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c

[PULL for-7.1 0/3] hw/nvme fixes

2022-08-01 Thread Klaus Jensen
From: Klaus Jensen Hi, The following changes since commit 3916603e0c1d909e14e09d5ebcbdaa9c9e21adf3: Merge tag 'pull-la-20220729' of https://gitlab.com/rth7680/qemu into staging (2022-07-29 17:39:17 -0700) are available in the Git repository at: git://git.infradead.org/qemu-nvm

[PULL for-7.1 3/3] hw/nvme: do not enable ioeventfd by default

2022-08-01 Thread Klaus Jensen
From: Klaus Jensen Do not enable ioeventfd by default. Let the feature mature a bit before we consider enabling it by default. Fixes: 2e53b0b45024 ("hw/nvme: Use ioeventfd to handle doorbell updates") Reviewed-by: Keith Busch Reviewed-by: Jinhao Fan Signed-off-by: Klaus Jensen --

Re: [PATCH] hw/nvme: Add helper functions for qid-db conversion

2022-08-01 Thread Klaus Jensen
On Jul 28 16:07, Jinhao Fan wrote: > With the introduction of shadow doorbell and ioeventfd, we need to do > frequent conversion between qid and its doorbell offset. The original > hard-coded calculation is confusing and error-prone. Add several helper > functions to do this task. > > Signed-off-b

Re: Feature - Add delay to NVMe device model

2022-08-02 Thread Klaus Jensen
On Aug 1 19:22, Stephen Bates wrote: > Hi > > I am interested in exploring the impact of increased storage IO delay > on applications and was thinking of doing this by adding a delay > argument to the NVMe device model in QEMU. Is this something that > others would be interested in? If so I woul

Re: Feature - Add delay to NVMe device model

2022-08-02 Thread Klaus Jensen
On Aug 2 09:03, Klaus Jensen wrote: > In that case we would need to introduce a timer delay in > QEMU. I meant to type "[...] introduce a timer delay in the nvme device model", not "[...] in QEMU". Brain fart ;) signature.asc Description: PGP signature

Re: [PATCH] hw/nvme: Add helper functions for qid-db conversion

2022-08-02 Thread Klaus Jensen
On Aug 2 16:31, Jinhao Fan wrote: > at 2:02 PM, Klaus Jensen wrote: > > > On Jul 28 16:07, Jinhao Fan wrote: > >> With the introduction of shadow doorbell and ioeventfd, we need to do > >> frequent conversion between qid and its doorbell offset. The original

Re: [PATCH] hw/nvme: Add helper functions for qid-db conversion

2022-08-02 Thread Klaus Jensen
On Aug 2 10:54, Klaus Jensen wrote: > On Aug 2 16:31, Jinhao Fan wrote: > > at 2:02 PM, Klaus Jensen wrote: > > > > > On Jul 28 16:07, Jinhao Fan wrote: > > >> With the introduction of shadow doorbell and ioeventfd, we need to do > > >> frequen

Re: [PATCH v2] hw/nvme: Add helper functions for qid-db conversion

2022-08-04 Thread Klaus Jensen
; > Signed-off-by: Jinhao Fan Looks good, Reviewed-by: Klaus Jensen signature.asc Description: PGP signature

Re: [PATCH 4/4] hw/nvme: add MSI-x mask handlers for irqfd

2022-08-16 Thread Klaus Jensen
On Aug 11 23:37, Jinhao Fan wrote: > When irqfd is enabled, we bypass QEMU's irq emulation and let KVM to > directly assert the irq. However, KVM is not aware of the device's MSI-x > masking status. Add MSI-x mask bookkeeping in NVMe emulation and > detach the corresponding irqfd when the certain v

Re: [PATCH 2/4] hw/nvme: add option to (de)assert irq with eventfd

2022-08-16 Thread Klaus Jensen
On Aug 11 23:37, Jinhao Fan wrote: > When the new option 'irq-eventfd' is turned on, the IO emulation code > signals an eventfd when it want to (de)assert an irq. The main loop > eventfd handler does the actual irq (de)assertion. This paves the way > for iothread support since QEMU's interrupt emu

Re: [PATCH 2/4] hw/nvme: add option to (de)assert irq with eventfd

2022-08-23 Thread Klaus Jensen
On Aug 11 23:37, Jinhao Fan wrote: > When the new option 'irq-eventfd' is turned on, the IO emulation code > signals an eventfd when it want to (de)assert an irq. The main loop > eventfd handler does the actual irq (de)assertion. This paves the way > for iothread support since QEMU's interrupt emu

Re: [PATCH 4/4] hw/nvme: add MSI-x mask handlers for irqfd

2022-08-23 Thread Klaus Jensen
On Aug 11 23:37, Jinhao Fan wrote: > When irqfd is enabled, we bypass QEMU's irq emulation and let KVM to > directly assert the irq. However, KVM is not aware of the device's MSI-x > masking status. Add MSI-x mask bookkeeping in NVMe emulation and > detach the corresponding irqfd when the certain v

Re: [PATCH] hw/nvme: Abort copy command when format is one while pif is zero

2022-08-23 Thread Klaus Jensen
amp;& format != 0x1) { > +if ((ns->pif == 0x0 && format != 0x0) || (ns->pif && format != 0x1)) { > status = NVME_INVALID_FORMAT | NVME_DNR; > goto invalid; > } > -- > 2.25.1 > Thanks, looks good. Reviewed-by: Klaus Jensen signature.asc Description: PGP signature

Re: [PATCH v2] hw/nvme: Support for Namespaces Management from guest OS - create-ns

2022-08-23 Thread Klaus Jensen
Hi Michael, Thanks for your interest in contributing this! (CC: +Naveen, +Keith, -linux-nvme) Some observations and commets on your patch submission below. Firstly, your mail delivery is broken - this is not getting through to qemu-devel. Also, I don't think kernel developers have that much int

Re: [PATCH 4/4] hw/nvme: add MSI-x mask handlers for irqfd

2022-08-24 Thread Klaus Jensen
On Aug 23 22:43, Jinhao Fan wrote: > On 8/16/2022 6:46 PM, Klaus Jensen wrote: > > Did qtest work out for you for testing? If so, it would be nice to add a > > simple test case as well. > > Since MSI-x masking handlers are only implemented for IO queues, if we want >

[PATCH] hw/nvme: set DNR on compare failure

2022-08-24 Thread Klaus Jensen
From: Klaus Jensen Even if the host is somehow using compare to do compare-and-write, the host should be notified immediately about the compare failure and not have to wait for the driver to potentially retry the command. Reported-by: Jim Harris Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c

Re: [PATCH v2 1/3] hw/nvme: support irq(de)assertion with eventfd

2022-08-25 Thread Klaus Jensen
On Aug 25 15:47, Jinhao Fan wrote: > When the new option 'irq-eventfd' is turned on, the IO emulation code > signals an eventfd when it want to (de)assert an irq. The main loop > eventfd handler does the actual irq (de)assertion. This paves the way > for iothread support since QEMU's interrupt emu

Re: [PATCH v2 1/3] hw/nvme: support irq(de)assertion with eventfd

2022-08-25 Thread Klaus Jensen
On Aug 25 19:16, Jinhao Fan wrote: > On 8/25/2022 5:33 PM, Klaus Jensen wrote: > > I'm still a bit perplexed by this issue, so I just tried moving > > nvme_init_irq_notifier() to the end of nvme_init_cq() and removing this > > first_io_cqe thing. I did not obs

Re: [PATCH v2 1/3] hw/nvme: support irq(de)assertion with eventfd

2022-08-25 Thread Klaus Jensen
On Aug 25 13:56, Klaus Jensen wrote: > On Aug 25 19:16, Jinhao Fan wrote: > > On 8/25/2022 5:33 PM, Klaus Jensen wrote: > > > I'm still a bit perplexed by this issue, so I just tried moving > > > nvme_init_irq_notifier() to the end of nvme_init_cq() and removing

Re: [PATCH v2 1/3] hw/nvme: support irq(de)assertion with eventfd

2022-08-25 Thread Klaus Jensen
On Aug 25 21:09, Jinhao Fan wrote: > > > > > 在 2022年8月25日,20:39,Klaus Jensen 写道: > > > > On Aug 25 13:56, Klaus Jensen wrote: > >>> On Aug 25 19:16, Jinhao Fan wrote: > >>> On 8/25/2022 5:33 PM, Klaus Jensen wrote: > >>>&g

[PATCH v3 0/2] hw/nvme: add irqfd support

2022-08-25 Thread Klaus Jensen
From: Klaus Jensen This is a re-spin of Jinhao's irqfd support series that fixes msix vector masking/unmasking to work correctly. I kept being bugged out about that msi route not getting updated, so I hit the code into submission with a hammer. I finally noticed the core issue: 1

[PATCH v3 2/2] hw/nvme: use KVM irqfd when available

2022-08-25 Thread Klaus Jensen
o Fan Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 145 ++- hw/nvme/nvme.h | 3 + hw/nvme/trace-events | 3 + 3 files changed, 149 insertions(+), 2 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 51792f395597..396f3f0cddbd 1

[PATCH v3 1/2] hw/nvme: support irq(de)assertion with eventfd

2022-08-25 Thread Klaus Jensen
32 106 240 364 Signed-off-by: Jinhao Fan Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 120 ++--- hw/nvme/nvme.h | 3 ++ 2 files changed, 106 insertions(+), 17 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 87aeba056499..51792f3955

Re: [PATCH v3 0/2] hw/nvme: add irqfd support

2022-08-25 Thread Klaus Jensen
On Aug 26 10:03, Jinhao Fan wrote: > at 4:14 AM, Klaus Jensen wrote: > > > From: Klaus Jensen > > > > This is a re-spin of Jinhao's irqfd support series that fixes msix > > vector masking/unmasking to work correctly. > > > > I kept being bugged o

Re: [PATCH v2 2/3] hw/nvme: use KVM irqfd when available

2022-08-26 Thread Klaus Jensen
nt notifiers since handler callback are called > > in the same system call as irqfd write. > > > > Signed-off-by: Jinhao Fan > > Signed-off-by: Klaus Jensen > > No idea what's going on here... This one is causing the following assert > failure with --en

Re: [PATCH v2 2/3] hw/nvme: use KVM irqfd when available

2022-08-26 Thread Klaus Jensen
On Aug 26 09:54, Keith Busch wrote: > On Fri, Aug 26, 2022 at 05:45:21PM +0200, Klaus Jensen wrote: > > On Aug 26 09:34, Keith Busch wrote: > > > On Fri, Aug 26, 2022 at 11:12:04PM +0800, Jinhao Fan wrote: > > > > Use KVM's irqfd to send interrupts when possib

Re: [PATCH] hw/nvme: remove param zoned.auto_transition

2022-09-09 Thread Klaus Jensen
On Aug 12 13:01, Niklas Cassel wrote: > The intention of the Zoned Namespace Command Set Specification was > never to make an automatic zone transition optional. > > Excerpt from the nvmexpress.org zns mailing list: > """ > A question came up internally on the differences between ZNS and ZAC/ZBC >

Re: [PATCH v9 3/7] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-09-20 Thread Klaus Jensen
On Sep 10 13:27, Sam Li wrote: > Add a new zoned_host_device BlockDriver. The zoned_host_device option > accepts only zoned host block devices. By adding zone management > operations in this new BlockDriver, users can use the new block > layer APIs including Report Zone and four zone management ope

Re: [PATCH v9 3/7] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-09-21 Thread Klaus Jensen
On Sep 21 13:44, Damien Le Moal wrote: > On 9/20/22 17:51, Klaus Jensen wrote: > > On Sep 10 13:27, Sam Li wrote: > > > Add a new zoned_host_device BlockDriver. The zoned_host_device option > > > accepts only zoned host block devices. By adding zone management &

Re: [PATCH] hw/block/nvme: re-enable NVMe PCI hotplug

2022-10-10 Thread Klaus Jensen
On Okt 10 19:01, Daniel Wagner wrote: > On Tue, May 11, 2021 at 06:12:47PM +0200, Hannes Reinecke wrote: > > On 5/11/21 6:03 PM, Klaus Jensen wrote: > > > On May 11 16:54, Hannes Reinecke wrote: > > > > On 5/11/21 3:37 PM, Klaus Jensen wrote: > > > >

  1   2   3   4   5   6   7   8   9   10   >