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 v3 10/11] hw/nvme: add reservation protocal command

2024-05-24 Thread Klaus Jensen
c_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, > +n

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

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

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

Re: [PATCH 8/9] hw/nvme: add reservation protocal command

2024-05-08 Thread Klaus Jensen
On May 8 17:36, 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 keys,

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

2024-05-08 Thread Klaus Jensen
> - Atomic Compare and Write Unit (ACWU) > > Alan Adamson (1): > nvme: add atomic write support > > hw/nvme/ctrl.c | 147 - > hw/nvme/nvme.h | 17 ++ > 2 files changed, 163 insertions(+), 1 deletion(-) > > -- > 2.39.3 > Hi Alan, I have no obvious qualms about this. It is clearly useful for driver testing and verification and does not negatively impact the performance when this "faked" feature is not enabled. Acked-by: Klaus Jensen signature.asc Description: PGP signature

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

2024-05-06 Thread Klaus Jensen
From: Klaus Jensen The Management Operation field of I/O Management Send is only 8 bits, not 16. Fixes: 73064edfb864 ("hw/nvme: flexible data placement emulation") Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/n

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

2024-05-01 Thread Klaus Jensen
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 QEMU system, we need much more than 127 VFs. This patch made > support for 256 VFs per a

Re: [PATCH] hw/nvme: Add support for setting the MQES for the NVMe emulation

2024-05-01 Thread Klaus Jensen
On May 1 12:27, Berg, John wrote: > On Thu, 2024-04-04 at 15:01 +0200, Klaus Jensen wrote: > > On Apr  4 13:04, John Berg wrote: > > > From: John Berg > > > > > > The MQES field in the CAP register describes the Maximum Queue > > > Entries > >

Re: [PATCH] hw/nvme: Add support for setting the MQES for the NVMe emulation

2024-04-04 Thread Klaus Jensen
On Apr 4 13:04, John Berg wrote: > From: John Berg > > The MQES field in the CAP register describes the Maximum Queue Entries > Supported for the IO queues of an NVMe controller. Adding a +1 to the > value in this field results in the total queue size. A full queue is > when a queue of size N

Re: [PATCH] hw/nvme: Add support for setting the MQES for the NVMe emulation

2024-04-04 Thread Klaus Jensen
e > emulation: > > -drive id=nvme0,if=none,file=nvme.img,format=raw > -device nvme,drive=nvme0,serial=foo,mqes=1 > > If the mqes property is not provided then the default mqes will still be > 0x7ff (the queue size is 2048 entries). > > Signed-off-by: John Berg LGTM, Reviewed-by: Klaus Jensen signature.asc Description: PGP signature

Re: [PATCH 17/19] hw/nvme: fix -Werror=maybe-uninitialized

2024-04-02 Thread Klaus Jensen
w11); > uint32_t nsid = le32_to_cpu(cmd->nsid); > -uint32_t result; > +uint32_t result = 0; > uint8_t fid = NVME_GETSETFEAT_FID(dw10); > NvmeGetFeatureSelect sel = NVME_GETFEAT_SELECT(dw10); > uint16_t iv; > -- > 2.44.0 > Thanks! Reviewed-by: Klaus Jensen signature.asc Description: PGP signature

[PULL v2 3/6] MAINTAINERS: add Jesper as reviewer on hw/nvme

2024-03-12 Thread Klaus Jensen
From: Klaus Jensen My colleague, Jesper, will be assiting with hw/nvme related reviews. Add him with R: so he gets automatically bugged going forward. Cc: Jesper Devantier Acked-by: Jesper Devantier Signed-off-by: Klaus Jensen --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff

[PULL v2 4/6] hw/nvme: Add NVMe NGUID property

2024-03-12 Thread Klaus Jensen
ll be part of the Namespace Identification Descriptor list and the Identify Namespace data. Signed-off-by: Roque Arcudia Hernandez Signed-off-by: Nabih Estefan Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- docs/system/devices/nvme.rst | 7 ++ hw/nvme/ctrl.c | 12 ++

[PULL v2 5/6] hw/nvme: generalize the mbar size helper

2024-03-12 Thread Klaus Jensen
From: Klaus Jensen Generalize the mbar size helper such that it can handle cases where the MSI-X table and PBA are expected to be in an exclusive bar. Cc: qemu-sta...@nongnu.org Reviewed-by: Jesper Wendel Devantier Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 28

[PULL v2 0/6] hw/nvme updates

2024-03-12 Thread Klaus Jensen
From: Klaus Jensen Hi, Sorry about the compilation error in v1. Did a full CI run for v2. https://gitlab.com/birkelund/qemu/-/pipelines/1210559370 The following changes since commit 8f3f329f5e0117bd1a23a79ab751f8a7d3471e4b: Merge tag 'migration-20240311-pull-request' of https

[PULL v2 6/6] hw/nvme: add machine compatibility parameter to enable msix exclusive bar

2024-03-12 Thread Klaus Jensen
From: Klaus Jensen Commit 1901b4967c3f ("hw/block/nvme: move msix table and pba to BAR 0") moved the MSI-X table and PBA to BAR 0 to make room for enabling CMR and PMR at the same time. As reported by Julien Grall in #2184, this breaks migration through system hibernation. Add

[PULL v2 1/6] hw/nvme: separate 'serial' property for VFs

2024-03-12 Thread Klaus Jensen
r_ctrl() function. Cc: qemu-sta...@nongnu.org Fixes: 44c2c09488db ("hw/nvme: Add support for SR-IOV") Signed-off-by: Minwoo Im Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c

[PULL v2 2/6] hw/nvme: fix invalid check on mcl

2024-03-12 Thread Klaus Jensen
From: Klaus Jensen The number of logical blocks within a source range is converted into a 1s based number at the time of parsing. However, when verifying the copy length we add one again, causing the check against MCL to fail in error. Cc: qemu-sta...@nongnu.org Fixes: 381ab99d8587 ("hw

Re: [PULL 0/6] hw/nvme updates

2024-03-12 Thread Klaus Jensen
On Mar 12 11:34, Peter Maydell wrote: > On Mon, 11 Mar 2024 at 19:11, Klaus Jensen wrote: > > > > From: Klaus Jensen > > > > Hi, > > > > The following changes since commit 7489f7f3f81dcb776df8c1b9a9db281fc21bf05f: > > > > Merge tag '

[PULL 2/6] hw/nvme: fix invalid check on mcl

2024-03-11 Thread Klaus Jensen
From: Klaus Jensen The number of logical blocks within a source range is converted into a 1s based number at the time of parsing. However, when verifying the copy length we add one again, causing the check against MCL to fail in error. Cc: qemu-sta...@nongnu.org Fixes: 381ab99d8587 ("hw

[PULL 6/6] hw/nvme: add machine compatibility parameter to enable msix exclusive bar

2024-03-11 Thread Klaus Jensen
From: Klaus Jensen Commit 1901b4967c3f ("hw/block/nvme: move msix table and pba to BAR 0") moved the MSI-X table and PBA to BAR 0 to make room for enabling CMR and PMR at the same time. As reported by Julien Grall in #2184, this breaks migration through system hibernation. Add

[PULL 5/6] hw/nvme: generalize the mbar size helper

2024-03-11 Thread Klaus Jensen
From: Klaus Jensen Generalize the mbar size helper such that it can handle cases where the MSI-X table and PBA are expected to be in an exclusive bar. Cc: qemu-sta...@nongnu.org Reviewed-by: Jesper Wendel Devantier Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 26

[PULL 3/6] MAINTAINERS: add Jesper as reviewer on hw/nvme

2024-03-11 Thread Klaus Jensen
From: Klaus Jensen My colleague, Jesper, will be assiting with hw/nvme related reviews. Add him with R: so he gets automatically bugged going forward. Cc: Jesper Devantier Acked-by: Jesper Devantier Signed-off-by: Klaus Jensen --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff

[PULL 4/6] hw/nvme: Add NVMe NGUID property

2024-03-11 Thread Klaus Jensen
ll be part of the Namespace Identification Descriptor list and the Identify Namespace data. Signed-off-by: Roque Arcudia Hernandez Signed-off-by: Nabih Estefan Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- docs/system/devices/nvme.rst | 7 ++ hw/nvme/ctrl.c | 12 ++

[PULL 0/6] hw/nvme updates

2024-03-11 Thread Klaus Jensen
From: Klaus Jensen Hi, The following changes since commit 7489f7f3f81dcb776df8c1b9a9db281fc21bf05f: Merge tag 'hw-misc-20240309' of https://github.com/philmd/qemu into staging (2024-03-09 20:12:21 +) are available in the Git repository at: https://gitlab.com/birkelund/qemu.git tags

[PULL 1/6] hw/nvme: separate 'serial' property for VFs

2024-03-11 Thread Klaus Jensen
r_ctrl() function. Cc: qemu-sta...@nongnu.org Fixes: 44c2c09488db ("hw/nvme: Add support for SR-IOV") Signed-off-by: Minwoo Im Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c

Re: [PATCH 0/2] hw/nvme: fix hibernation-based migration

2024-03-10 Thread Klaus Jensen
On Mar 10 12:07, Klaus Jensen wrote: > Julien Grall, in #2184, reported that hibernation-based migration with > hw/nvme is broken when suspending on a pre 6.0 QEMU and resuming on a > more recent one. This is because the BAR layout was changed in 6.0. > > Fix this by a

[PATCH 0/2] hw/nvme: fix hibernation-based migration

2024-03-10 Thread Klaus Jensen
. Signed-off-by: Klaus Jensen --- Klaus Jensen (2): hw/nvme: generalize the mbar size helper hw/nvme: add machine compatibility parameter to enable msix exclusive bar hw/core/machine.c | 1 + hw/nvme/ctrl.c| 73 --- hw/nvme/nvme.h

[PATCH 1/2] hw/nvme: generalize the mbar size helper

2024-03-10 Thread Klaus Jensen
From: Klaus Jensen Generalize the mbar size helper such that it can handle cases where the MSI-X table and PBA are expected to be in an exclusive bar. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git

[PATCH 2/2] hw/nvme: add machine compatibility parameter to enable msix exclusive bar

2024-03-10 Thread Klaus Jensen
From: Klaus Jensen Commit 1901b4967c3f ("hw/block/nvme: move msix table and pba to BAR 0") moved the MSI-X table and PBA to BAR 0 to make room for enabling CMR and PMR at the same time. As reported by Julien Grall in #2184, this breaks migration through system hibernation. Add

Re: [PATCH v2] hw/nvme/ns: Add NVMe NGUID property

2024-03-01 Thread Klaus Jensen
t; -device nvme-ns,nguid="e9accd3b83904e13167cf0593437f57d" > > If provided, the NGUID will be part of the Namespace Identification Descriptor > list and the Identify Namespace data. > > Signed-off-by: Roque Arcudia Hernandez > Signed-off-by: Nabih Estefan > Reviewed-by: Klaus

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

2024-02-26 Thread Klaus Jensen
On Feb 26 09:18, Philippe Mathieu-Daudé wrote: > On 22/2/24 10:29, Klaus Jensen wrote: > > From: Klaus Jensen > > > > numcntl is one byte and so is max_vfs. Using cpu_to_le16 on big endian > > hosts results in numcntl being set to 0. > > > > Fix by droppin

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

2024-02-22 Thread Klaus Jensen
On Feb 22 11:08, Philippe Mathieu-Daudé wrote: > Hi Klaus, > > On 22/2/24 10:29, Klaus Jensen wrote: > > From: Klaus Jensen > > > > numcntl is one byte and so is max_vfs. Using cpu_to_le16 on big endian > > hosts results in numcntl being set to 0. > > &g

[PATCH] hw/nvme: fix invalid endian conversion

2024-02-22 Thread Klaus Jensen
From: Klaus Jensen numcntl is one byte and so is max_vfs. Using cpu_to_le16 on big endian hosts results in numcntl being set to 0. Fix by dropping the endian conversion. Fixes: 746d42b13368 ("hw/nvme: Initialize capability structures for primary/secondary controllers") Reported-by:

Re: [PATCH] hw/nvme/ns: Add NVMe NGUID property

2024-02-22 Thread Klaus Jensen
t; -device nvme-ns,nguid="e9accd3b83904e13167cf0593437f57d" > > If provided, the NGUID will be part of the Namespace Identification Descriptor > list and the Identify Namespace data. > > Signed-off-by: Roque Arcudia Hernandez > Signed-off-by: Nabih Estefan Hi Thanks! Looks good, Reviewe

Re: [PATCH v6 01/15] hw/nvme: Use pcie_sriov_num_vfs()

2024-02-20 Thread Klaus Jensen
On Feb 21 00:33, Akihiko Odaki wrote: > On 2024/02/20 23:53, Kevin Wolf wrote: > > Am 20.02.2024 um 15:29 hat Kevin Wolf geschrieben: > > > Am 20.02.2024 um 13:24 hat Akihiko Odaki geschrieben: > > > > nvme_sriov_pre_write_ctrl() used to directly inspect SR-IOV > > > > configurations to know the

Re: [PATCH v6 01/15] hw/nvme: Use pcie_sriov_num_vfs()

2024-02-20 Thread Klaus Jensen
On Feb 20 15:29, Kevin Wolf wrote: > Am 20.02.2024 um 13:24 hat Akihiko Odaki geschrieben: > > nvme_sriov_pre_write_ctrl() used to directly inspect SR-IOV > > configurations to know the number of VFs being disabled due to SR-IOV > > configuration writes, but the logic was flawed and resulted in >

Re: [PATCH v5 01/11] hw/nvme: Use pcie_sriov_num_vfs()

2024-02-19 Thread Klaus Jensen
ites. > > Cc: qemu-sta...@nongnu.org > Fixes: 11871f53ef8e ("hw/nvme: Add support for the Virtualization Management > command") > Suggested-by: Michael S. Tsirkin > Signed-off-by: Akihiko Odaki Thanks Akihiko, I'll pick this up for hw/nvme nvme-next as-is. Reviewed-by: Kl

Re: [PATCH v4 0/3] Initial support for SPDM Responders

2024-02-16 Thread Klaus Jensen
On Feb 15 14:44, Jonathan Cameron wrote: > On Tue, 13 Feb 2024 12:44:00 +1000 > Alistair Francis wrote: > > Hi All, > > Just wanted to add that back in v2 Klaus Jensen stated: > > "I have no problem with picking this up for nvme, but I'd rather not take >

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

2024-02-08 Thread Klaus Jensen
On Feb 8 21:33, Minwoo Im wrote: > On 24-02-08 13:22:48, Klaus Jensen wrote: > > From: Klaus Jensen > > > > The number of logical blocks within a source range is converted into a > > 1s based number at the time of parsing. However, when verifying the copy > >

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

2024-02-08 Thread Klaus Jensen
From: Klaus Jensen The number of logical blocks within a source range is converted into a 1s based number at the time of parsing. However, when verifying the copy length we add one again, causing the check against MCL to fail in error. Fixes: 381ab99d8587 ("hw/nvme: check maximum copy l

Re: NVME hotplug support ?

2024-01-29 Thread Klaus Jensen
> When nvme was introduced 2 years ago, the feature was disabled. > > > > > > commit cc6fb6bc506e6c47ed604fcb7b7413dff0b7d845 > > > > > > Author: Klaus Jensen > > > > > > Date:   Tue Jul 6 10:48:40 2021 +0200 > > > > > > >

Re: NVME hotplug support ?

2024-01-23 Thread Klaus Jensen
eature was disabled. > > > commit cc6fb6bc506e6c47ed604fcb7b7413dff0b7d845 > > > Author: Klaus Jensen > > > Date: Tue Jul 6 10:48:40 2021 +0200 > > > > > > hw/nvme: mark nvme-subsys non-hotpluggable > > > We currently lack the infrastructure to handle

Re: NVME hotplug support ?

2024-01-23 Thread Klaus Jensen
On Jan 23 10:59, Damien Hedde wrote: > Hi all, > > We are currently looking into hotplugging nvme devices and it is currently > not possible: > When nvme was introduced 2 years ago, the feature was disabled. > > commit cc6fb6bc506e6c47ed604fcb7b7413dff0b7d845 > > Aut

Re: [RFC v2 0/7] Add persistence to NVMe ZNS emulation

2024-01-09 Thread Klaus Jensen
json |4 + > system/dma-helpers.c | 17 + > 13 files changed, 647 insertions(+), 1121 deletions(-) > > -- > 2.40.1 > Hi Sam, This is awesome. For the hw/nvme parts, Acked-by: Klaus Jensen I'll give it a proper R-b when you drop the RFC status. signature.asc Description: PGP signature

Re: [PATCH v2 3/3] hw/nvme: Add SPDM over DOE support

2023-11-15 Thread Klaus Jensen
On Oct 17 15:21, Alistair Francis wrote: > From: Wilfred Mallawa > > Setup Data Object Exchance (DOE) as an extended capability for the NVME > controller and connect SPDM to it (CMA) to it. > > Signed-off-by: Wilfred Mallawa > Signed-off-by: Alistair Francis Acked-by:

Re: [RFC PATCH v3 65/78] hw/nvme: add fallthrough pseudo-keyword

2023-11-15 Thread Klaus Jensen
fallthrough; > case NVME_ID_NS_DPS_TYPE_1: > case NVME_ID_NS_DPS_TYPE_2: > if (be16_to_cpu(dif->g16.apptag) != 0x) { > @@ -229,7 +229,7 @@ static uint16_t nvme_dif_prchk_crc64(NvmeNamespace *ns, > NvmeDifTuple *dif, > break; > } > > -/* fallthrough */ > +fallthrough; > case NVME_ID_NS_DPS_TYPE_1: > case NVME_ID_NS_DPS_TYPE_2: > if (be16_to_cpu(dif->g64.apptag) != 0x) { > -- > 2.39.2 > > Reviewed-by: Klaus Jensen signature.asc Description: PGP signature

Re: [PATCH 3/3] hw/nvme: Add SPDM over DOE support

2023-10-02 Thread Klaus Jensen
On Sep 15 21:27, Alistair Francis wrote: > From: Wilfred Mallawa > > Setup Data Object Exchance (DOE) as an extended capability for the NVME > controller and connect SPDM to it (CMA) to it. > > Signed-off-by: Wilfred Mallawa > Signed-off-by: Alistair Francis > --- > docs/specs/index.rst

[PATCH] hw/nvme: Clean up local variable shadowing in nvme_ns_init()

2023-09-25 Thread Klaus Jensen
From: Klaus Jensen Fix local variable shadowing in nvme_ns_init(). Reported-by: Markus Armbruster Signed-off-by: Klaus Jensen --- hw/nvme/ns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/nvme/ns.c b/hw/nvme/ns.c index 44aba8f4d9cf..0eabcf5cf500 100644 --- a/hw

Re: [PATCH v6 0/3] hw/{i2c,nvme}: mctp endpoint, nvme management interface model

2023-09-20 Thread Klaus Jensen
On Sep 20 07:54, Corey Minyard wrote: > On Wed, Sep 20, 2023 at 12:48:03PM +0100, Jonathan Cameron via wrote: > > On Thu, 14 Sep 2023 11:53:40 +0200 > > Klaus Jensen wrote: > > > > > This adds a generic MCTP endpoint model that other devices may derive > >

[PATCH v6 3/3] hw/nvme: add nvme management interface model

2023-09-14 Thread Klaus Jensen
From: Klaus Jensen Add the 'nmi-i2c' device that emulates an NVMe Management Interface controller. Initial support is very basic (Read NMI DS, Configuration Get). This is based on previously posted code by Padmakar Kalghatgi, Arun Kumar Agasar and Saurav Kumar. Reviewed-by: Jonathan Cameron

[PATCH v6 2/3] hw/i2c: add mctp core

2023-09-14 Thread Klaus Jensen
From: Klaus Jensen Add an abstract MCTP over I2C endpoint model. This implements MCTP control message handling as well as handling the actual I2C transport (packetization). Devices are intended to derive from this and implement the class methods. Parts of this implementation is inspired

[PATCH v6 0/3] hw/{i2c,nvme}: mctp endpoint, nvme management interface model

2023-09-14 Thread Klaus Jensen
ctp addr add 8 dev mctpi2c15 mctp link set mctpi2c15 up mctp route add 9 via mctpi2c15 mctp neigh add 9 dev mctpi2c15 lladdr 0x3a mi-mctp 1 9 info Comments are very welcome! [1]: https://github.com/birkelund/hwtests/tree/main/br2-external Signed-off-by: Klaus Jensen --- Changes in v6: -

[PATCH v6 1/3] hw/i2c: add smbus pec utility function

2023-09-14 Thread Klaus Jensen
From: Klaus Jensen Add i2c_smbus_pec() to calculate the SMBus Packet Error Code for a message. Reviewed-by: Jonathan Cameron Signed-off-by: Klaus Jensen --- hw/i2c/smbus_master.c | 26 ++ include/hw/i2c/smbus_master.h | 2 ++ 2 files changed, 28 insertions

Re: [PATCH v5 3/3] hw/nvme: add nvme management interface model

2023-09-14 Thread Klaus Jensen
On Sep 12 13:50, Andrew Jeffery wrote: > Hi Klaus, > > On Tue, 2023-09-05 at 10:38 +0200, Klaus Jensen wrote: > > > > > > +static void nmi_handle_mi_config_get(NMIDevice *nmi, NMIRequest > > > *request) > > > +{ > > > +    uint32_t dw0 = le

Re: [PATCH v3 1/5] block: remove AIOCBInfo->get_aio_context()

2023-09-14 Thread Klaus Jensen
nst AIOCBInfo nvme_format_aiocb_info = { > .aiocb_size = sizeof(NvmeFormatAIOCB), > .cancel_async = nvme_format_cancel, > -.get_aio_context = nvme_get_aio_context, > }; > > static void nvme_format_set(NvmeNamespace *ns, uint8_t lbaf, uint8_t mset, Reviewed-by: Klaus Jensen signature.asc Description: PGP signature

[PULL 0/2] hw/nvme: updates

2023-09-12 Thread Klaus Jensen
From: Klaus Jensen Hi, The following changes since commit 9ef497755afc252fb8e060c9ea6b0987abfd20b6: Merge tag 'pull-vfio-20230911' of https://github.com/legoater/qemu into staging (2023-09-11 09:13:08 -0400) are available in the Git repository at: https://gitlab.com/birkelund/qemu.git

[PULL 2/2] hw/nvme: Avoid dynamic stack allocation

2023-09-12 Thread Klaus Jensen
where an on-stack dynamic allocation isn't correctly size-checked (e.g. CVE-2021-3527). Signed-off-by: Peter Maydell Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index d99a6f5c9a2e

[PULL 1/2] hw/nvme: Use #define to avoid variable length array

2023-09-12 Thread Klaus Jensen
er Maydell Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 539d27355313..d99a6f5c9a2e 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -1045,7 +1045,7 @@ static uint16_t nvme_map_sgl(N

Re: [PATCH 0/2] nvme: avoid dynamic stack allocations

2023-09-12 Thread Klaus Jensen
On Sep 12 15:15, Peter Maydell wrote: > On Mon, 14 Aug 2023 at 08:09, Klaus Jensen wrote: > > > > On Aug 11 18:47, Peter Maydell wrote: > > > The QEMU codebase has very few C variable length arrays, and if we can > > > get rid of them all we can make th

[PATCH v5 2/3] hw/i2c: add mctp core

2023-09-05 Thread Klaus Jensen
From: Klaus Jensen Add an abstract MCTP over I2C endpoint model. This implements MCTP control message handling as well as handling the actual I2C transport (packetization). Devices are intended to derive from this and implement the class methods. Parts of this implementation is inspired

[PATCH v5 0/3] hw/{i2c,nvme}: mctp endpoint, nvme management interface model

2023-09-05 Thread Klaus Jensen
ctp addr add 8 dev mctpi2c15 mctp link set mctpi2c15 up mctp route add 9 via mctpi2c15 mctp neigh add 9 dev mctpi2c15 lladdr 0x3a mi-mctp 1 9 info Comments are very welcome! [1]: https://github.com/birkelund/hwtests/tree/main/br2-external Signed-off-by: Klaus Jensen --- Changes in v5: - Ad

[PATCH v5 1/3] hw/i2c: add smbus pec utility function

2023-09-05 Thread Klaus Jensen
From: Klaus Jensen Add i2c_smbus_pec() to calculate the SMBus Packet Error Code for a message. Reviewed-by: Jonathan Cameron Signed-off-by: Klaus Jensen --- hw/i2c/smbus_master.c | 26 ++ include/hw/i2c/smbus_master.h | 2 ++ 2 files changed, 28 insertions

[PATCH v5 3/3] hw/nvme: add nvme management interface model

2023-09-05 Thread Klaus Jensen
From: Klaus Jensen Add the 'nmi-i2c' device that emulates an NVMe Management Interface controller. Initial support is very basic (Read NMI DS, Configuration Get). This is based on previously posted code by Padmakar Kalghatgi, Arun Kumar Agasar and Saurav Kumar. Signed-off-by: Klaus Jensen

Re: [PATCH v4 2/3] hw/i2c: add mctp core

2023-09-04 Thread Klaus Jensen
On Aug 30 15:31, Jonathan Cameron wrote: > On Wed, 23 Aug 2023 11:21:59 +0200 > Klaus Jensen wrote: > > > From: Klaus Jensen > > > > Add an abstract MCTP over I2C endpoint model. This implements MCTP > > control message handling as well as handling the actual

Re: [PULL 1/2] hw/nvme: fix null pointer access in directive receive

2023-08-24 Thread Klaus Jensen
On Aug 24 14:44, Philippe Mathieu-Daudé wrote: > On 9/8/23 15:39, Klaus Jensen wrote: > > From: Klaus Jensen > > > > nvme_directive_receive() does not check if an endurance group has been > > configured (set) prior to testing if flexible data placement is enabl

[PATCH v4 3/3] hw/nvme: add nvme management interface model

2023-08-23 Thread Klaus Jensen
From: Klaus Jensen Add the 'nmi-i2c' device that emulates an NVMe Management Interface controller. Initial support is very basic (Read NMI DS, Configuration Get). This is based on previously posted code by Padmakar Kalghatgi, Arun Kumar Agasar and Saurav Kumar. Signed-off-by: Klaus Jensen

[PATCH v4 2/3] hw/i2c: add mctp core

2023-08-23 Thread Klaus Jensen
From: Klaus Jensen Add an abstract MCTP over I2C endpoint model. This implements MCTP control message handling as well as handling the actual I2C transport (packetization). Devices are intended to derive from this and implement the class methods. Parts of this implementation is inspired

[PATCH v4 0/3] hw/{i2c,nvme}: mctp endpoint, nvme management interface model

2023-08-23 Thread Klaus Jensen
rop short packets that could result in underflow (Corey) - Move i2c_smbus_pec() to smbus common code (Corey) - A couple of logic fixes (patch from Jeremy squashed in) - Added a patch to handle messages with dest eid 0 (Matt) Maybe squash this as well. Signed-off-by: Klaus Jensen --- Klaus Jen

[PATCH v4 1/3] hw/i2c: add smbus pec utility function

2023-08-23 Thread Klaus Jensen
From: Klaus Jensen Add i2c_smbus_pec() to calculate the SMBus Packet Error Code for a message. Signed-off-by: Klaus Jensen --- hw/i2c/smbus_master.c | 26 ++ include/hw/i2c/smbus_master.h | 2 ++ 2 files changed, 28 insertions(+) diff --git a/hw/i2c

Re: [PATCH v2 0/4] Add full zoned storage emulation to qcow2 driver

2023-08-16 Thread Klaus Jensen
On Aug 14 16:57, Sam Li wrote: > This patch series add a new extension - zoned format - to the > qcow2 driver thereby allowing full zoned storage emulation on > the qcow2 img file. Users can attach such a qcow2 file to the > guest as a zoned device. > > To create a qcow2 file with zoned format,

Re: [PATCH 0/2] nvme: avoid dynamic stack allocations

2023-08-14 Thread Klaus Jensen
On Aug 11 18:47, Peter Maydell wrote: > The QEMU codebase has very few C variable length arrays, and if we can > get rid of them all we can make the compiler error on new additions. > This is a defensive measure against security bugs where an on-stack > dynamic allocation isn't correctly

[PULL 2/2] hw/nvme: fix null pointer access in ruh update

2023-08-09 Thread Klaus Jensen
From: Klaus Jensen The Reclaim Unit Update operation in I/O Management Receive does not verify the presence of a configured endurance group prior to accessing it. Fix this. Cc: qemu-sta...@nongnu.org Fixes: 73064edfb864 ("hw/nvme: flexible data placement emulation") Reviewed-by: Jes

[PULL 1/2] hw/nvme: fix null pointer access in directive receive

2023-08-09 Thread Klaus Jensen
From: Klaus Jensen nvme_directive_receive() does not check if an endurance group has been configured (set) prior to testing if flexible data placement is enabled or not. Fix this. Cc: qemu-sta...@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1815 Fixes: 73064edfb864 (&qu

[PULL 0/2] hw/nvme: more fixes

2023-08-09 Thread Klaus Jensen
From: Klaus Jensen Hi, The following changes since commit a8fc5165aab02f328ccd148aafec1e59fd1426eb: Merge tag 'nvme-next-pull-request' of https://gitlab.com/birkelund/qemu into staging (2023-08-08 16:39:20 -0700) are available in the Git repository at: https://gitlab.com/birkelund

[PATCH 2/2] hw/nvme: fix null pointer access in ruh update

2023-08-08 Thread Klaus Jensen
From: Klaus Jensen The Reclaim Unit Update operation in I/O Management Receive does not verify the presence of a configured endurance group prior to accessing it. Fix this. Cc: qemu-sta...@nongnu.org Fixes: 73064edfb864 ("hw/nvme: flexible data placement emulation") Signed-off-by: Kl

[PATCH 0/2] hw/nvme: two fixes

2023-08-08 Thread Klaus Jensen
From: Klaus Jensen Fix two potential accesses to null pointers. Klaus Jensen (2): hw/nvme: fix null pointer access in directive receive hw/nvme: fix null pointer access in ruh update hw/nvme/ctrl.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.41.0

[PATCH 1/2] hw/nvme: fix null pointer access in directive receive

2023-08-08 Thread Klaus Jensen
From: Klaus Jensen nvme_directive_receive() does not check if an endurance group has been configured (set) prior to testing if flexible data placement is enabled or not. Fix this. Cc: qemu-sta...@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1815 Fixes: 73064edfb864 (&qu

[PULL v2] hw/nvme fixes

2023-08-08 Thread Klaus Jensen
From: Klaus Jensen Hi, There was a small typo in the last pull. This replaces it. The following changes since commit 0450cf08976f9036feaded438031b4cba94f6452: Merge tag 'fixes-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging (2023-08-07 13:55:00 -0700) are available

[PULL 1/2] hw/nvme: fix CRC64 for guard tag

2023-08-08 Thread Klaus Jensen
From: Ankit Kumar The nvme CRC64 generator expects the caller to pass inverted seed value. Pass inverted crc value for metadata buffer. Cc: qemu-sta...@nongnu.org Fixes: 44219b6029fc ("hw/nvme: 64-bit pi support") Signed-off-by: Ankit Kumar Signed-off-by: Klaus Jensen --- hw/nvme

[PULL 2/2] docs: update hw/nvme documentation for protection information

2023-08-08 Thread Klaus Jensen
From: Ankit Kumar Add missing entry for pif ("protection information format"). Protection information size can be 8 or 16 bytes, Update the pil entry as per the NVM command set specification. Signed-off-by: Ankit Kumar Signed-off-by: Klaus Jensen --- docs/system/devices/nvm

[PULL 0/2] hw/nvme late fix

2023-08-08 Thread Klaus Jensen
From: Klaus Jensen Hi, This is a fix for hw/nvme protection information discovered by Ankit late in the cycle. This is not a regression, but a long standing bug and not critical (obviously no users of this until now, no potential for crash or similar, just plain wrong). If this can make

Re: [PATCH] hw/nvme: fix oob memory read in fdp events log

2023-08-08 Thread Klaus Jensen
+CC qemu-stable On Aug 3 20:44, Klaus Jensen wrote: > From: Klaus Jensen > > As reported by Trend Micro's Zero Day Initiative, an oob memory read > vulnerability exists in nvme_fdp_events(). The host-provided offset is > not verified. > > Fix this. > > This is onl

[PULL 0/2] hw/nvme fixes

2023-08-07 Thread Klaus Jensen
From: Klaus Jensen Hi, The following changes since commit 9400601a689a128c25fa9c21e932562e0eeb7a26: Merge tag 'pull-tcg-20230806-3' of https://gitlab.com/rth7680/qemu into staging (2023-08-06 16:47:48 -0700) are available in the Git repository at: https://gitlab.com/birkelund/qemu.git

[PULL 1/2] hw/nvme: fix oob memory read in fdp events log

2023-08-07 Thread Klaus Jensen
From: Klaus Jensen As reported by Trend Micro's Zero Day Initiative, an oob memory read vulnerability exists in nvme_fdp_events(). The host-provided offset is not verified. Fix this. This is only exploitable when Flexible Data Placement mode (fdp=on) is enabled. Fixes: CVE-2023-4135 Fixes

[PULL 2/2] hw/nvme: fix compliance issue wrt. iosqes/iocqes

2023-08-07 Thread Klaus Jensen
From: Klaus Jensen As of prior to this patch, the controller checks the value of CC.IOCQES and CC.IOSQES prior to enabling the controller. As reported by Ben in GitLab issue #1691, this is not spec compliant. The controller should only check these values when queues are created. This patch

[PATCH] hw/nvme: fix oob memory read in fdp events log

2023-08-03 Thread Klaus Jensen
From: Klaus Jensen As reported by Trend Micro's Zero Day Initiative, an oob memory read vulnerability exists in nvme_fdp_events(). The host-provided offset is not verified. Fix this. This is only exploitable when Flexible Data Placement mode (fdp=on) is enabled. Fixes: CVE-2023-4135 Fixes

[PULL 1/1] hw/nvme: use stl/ldl pci dma api

2023-07-30 Thread Klaus Jensen
From: Klaus Jensen Use the stl/ldl pci dma api for writing/reading doorbells. This removes the explicit endian conversions. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Tested-by: Cédric Le Goater Reviewed-by: Thomas Huth Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c

[PULL 0/1] hw/nvme fixes

2023-07-30 Thread Klaus Jensen
From: Klaus Jensen Hi, This should also fix coverity cid 1518067 and 1518066. The following changes since commit ccb86f079a9e4d94918086a9df18c1844347aff8: Merge tag 'pull-nbd-2023-07-28' of https://repo.or.cz/qemu/ericb into staging (2023-07-28 09:56:57 -0700) are available in the Git

[PATCH] hw/nvme: use stl/ldl pci dma api

2023-07-20 Thread Klaus Jensen
From: Klaus Jensen Use the stl/ldl pci dma api for writing/reading doorbells. This removes the explicit endian conversions. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 42 +- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/hw/nvme

Re: [PULL 1/1] hw/nvme: fix endianness issue for shadow doorbells

2023-07-20 Thread Klaus Jensen
On Jul 20 09:51, Peter Maydell wrote: > On Thu, 20 Jul 2023 at 09:49, Klaus Jensen wrote: > > > > On Jul 20 09:43, Peter Maydell wrote: > > > On Wed, 19 Jul 2023 at 21:13, Michael Tokarev wrote: > > > > > > > > 19.07.2023 10:36, K

Re: [PULL 1/1] hw/nvme: fix endianness issue for shadow doorbells

2023-07-20 Thread Klaus Jensen
On Jul 20 09:43, Peter Maydell wrote: > On Wed, 19 Jul 2023 at 21:13, Michael Tokarev wrote: > > > > 19.07.2023 10:36, Klaus Jensen wrote: > > pu(req->cmd.dptr.prp2); > > > +uint32_t v; > > > > > if (s

[PATCH for-8.1] hw/nvme: fix compliance issue wrt. iosqes/iocqes

2023-07-19 Thread Klaus Jensen
From: Klaus Jensen As of prior to this patch, the controller checks the value of CC.IOCQES and CC.IOSQES prior to enabling the controller. As reported by Ben in GitLab issue #1691, this is not spec compliant. The controller should only check these values when queues are created. This patch

[PULL 1/1] hw/nvme: fix endianness issue for shadow doorbells

2023-07-19 Thread Klaus Jensen
From: Klaus Jensen In commit 2fda0726e514 ("hw/nvme: fix missing endian conversions for doorbell buffers"), we fixed shadow doorbells for big-endian guests running on little endian hosts. But I did not fix little-endian guests on big-endian hosts. Fix this. Resolves: https://gitla

[PULL 0/1] hw/nvme fixes

2023-07-19 Thread Klaus Jensen
From: Klaus Jensen Hi, The following changes since commit 361d5397355276e3007825cc17217c1e4d4320f7: Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2023-07-17 15:49:27 +0100) are available in the Git repository at: https://gitlab.com/birkelund/qemu.git

Re: [PATCH] hw/nvme: fix endianness issue for shadow doorbells

2023-07-18 Thread Klaus Jensen
On Jul 18 13:18, Philippe Mathieu-Daudé wrote: > On 18/7/23 12:35, Klaus Jensen wrote: > > From: Klaus Jensen > > > > In commit 2fda0726e514 ("hw/nvme: fix missing endian conversions for > > doorbell buffers"), we fixed shadow doorbells for big-endian gues

[PATCH] hw/nvme: fix endianness issue for shadow doorbells

2023-07-18 Thread Klaus Jensen
From: Klaus Jensen In commit 2fda0726e514 ("hw/nvme: fix missing endian conversions for doorbell buffers"), we fixed shadow doorbells for big-endian guests running on little endian hosts. But I did not fix little-endian guests on big-endian hosts. Fix this. Solves issue #17

  1   2   3   4   5   6   7   8   9   10   >