* [PATCH] hw/nvme: fix mo field in io mgnt send
@ 2024-05-06 8:06 Klaus Jensen
2024-05-07 14:05 ` Vincent Fu
0 siblings, 1 reply; 4+ messages in thread
From: Klaus Jensen @ 2024-05-06 8:06 UTC (permalink / raw)
To: Keith Busch, Klaus Jensen, Jesper Devantier
Cc: qemu-block, qemu-devel, Klaus Jensen
From: Klaus Jensen <k.jensen@samsung.com>
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 <k.jensen@samsung.com>
---
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 9e7bbebc8bb0..ede5f281dd7c 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -4387,7 +4387,7 @@ static uint16_t nvme_io_mgmt_send(NvmeCtrl *n, NvmeRequest *req)
{
NvmeCmd *cmd = &req->cmd;
uint32_t cdw10 = le32_to_cpu(cmd->cdw10);
- uint8_t mo = (cdw10 & 0xff);
+ uint8_t mo = cdw10 & 0xf;
switch (mo) {
case NVME_IOMS_MO_NOP:
---
base-commit: 84b0eb1826f690aa8d51984644318ee6c810f5bf
change-id: 20240506-fix-ioms-mo-97098c6c5396
Best regards,
--
Klaus Jensen <k.jensen@samsung.com>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/nvme: fix mo field in io mgnt send
2024-05-06 8:06 [PATCH] hw/nvme: fix mo field in io mgnt send Klaus Jensen
@ 2024-05-07 14:05 ` Vincent Fu
2024-05-08 13:36 ` Vincent Fu
0 siblings, 1 reply; 4+ messages in thread
From: Vincent Fu @ 2024-05-07 14:05 UTC (permalink / raw)
To: Klaus Jensen, Keith Busch, Klaus Jensen, Jesper Devantier
Cc: qemu-block, qemu-devel
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: flexible data placement emulation")
> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
> ---
> 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 9e7bbebc8bb0..ede5f281dd7c 100644
> --- a/hw/nvme/ctrl.c
> +++ b/hw/nvme/ctrl.c
> @@ -4387,7 +4387,7 @@ static uint16_t nvme_io_mgmt_send(NvmeCtrl *n, NvmeRequest *req)
> {
> NvmeCmd *cmd = &req->cmd;
> uint32_t cdw10 = le32_to_cpu(cmd->cdw10);
> - uint8_t mo = (cdw10 & 0xff);
> + uint8_t mo = cdw10 & 0xf;
>
> switch (mo) {
> case NVME_IOMS_MO_NOP:
>
> ---
> base-commit: 84b0eb1826f690aa8d51984644318ee6c810f5bf
> change-id: 20240506-fix-ioms-mo-97098c6c5396
>
> Best regards,
Reviewed-by: Vincent Fu <vincent.fu@samsung.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/nvme: fix mo field in io mgnt send
2024-05-07 14:05 ` Vincent Fu
@ 2024-05-08 13:36 ` Vincent Fu
2024-05-24 8:03 ` Klaus Jensen
0 siblings, 1 reply; 4+ messages in thread
From: Vincent Fu @ 2024-05-08 13:36 UTC (permalink / raw)
To: Klaus Jensen, Keith Busch, Klaus Jensen, Jesper Devantier
Cc: qemu-block, qemu-devel
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: flexible data placement emulation")
>> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
>> ---
>> 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 9e7bbebc8bb0..ede5f281dd7c 100644
>> --- a/hw/nvme/ctrl.c
>> +++ b/hw/nvme/ctrl.c
>> @@ -4387,7 +4387,7 @@ static uint16_t nvme_io_mgmt_send(NvmeCtrl *n,
>> NvmeRequest *req)
>> {
>> NvmeCmd *cmd = &req->cmd;
>> uint32_t cdw10 = le32_to_cpu(cmd->cdw10);
>> - uint8_t mo = (cdw10 & 0xff);
>> + uint8_t mo = cdw10 & 0xf;
>> switch (mo) {
>> case NVME_IOMS_MO_NOP:
>>
>> ---
>> base-commit: 84b0eb1826f690aa8d51984644318ee6c810f5bf
>> change-id: 20240506-fix-ioms-mo-97098c6c5396
>>
>> Best regards,
>
> Reviewed-by: Vincent Fu <vincent.fu@samsung.com>
Klaus, upon taking a second look, the original code is correct. The
proposed change would only keep the least significant 4 bits of the MO
field. The original code gives you the 8 bits needed.
Let me withdraw my Reviewed-by.
Vincent
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/nvme: fix mo field in io mgnt send
2024-05-08 13:36 ` Vincent Fu
@ 2024-05-24 8:03 ` Klaus Jensen
0 siblings, 0 replies; 4+ messages in thread
From: Klaus Jensen @ 2024-05-24 8:03 UTC (permalink / raw)
To: Vincent Fu
Cc: Klaus Jensen, Keith Busch, Jesper Devantier, qemu-block,
qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1527 bytes --]
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: flexible data placement emulation")
> > > Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
> > > ---
> > > 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 9e7bbebc8bb0..ede5f281dd7c 100644
> > > --- a/hw/nvme/ctrl.c
> > > +++ b/hw/nvme/ctrl.c
> > > @@ -4387,7 +4387,7 @@ static uint16_t nvme_io_mgmt_send(NvmeCtrl *n,
> > > NvmeRequest *req)
> > > {
> > > NvmeCmd *cmd = &req->cmd;
> > > uint32_t cdw10 = le32_to_cpu(cmd->cdw10);
> > > - uint8_t mo = (cdw10 & 0xff);
> > > + uint8_t mo = cdw10 & 0xf;
> > > switch (mo) {
> > > case NVME_IOMS_MO_NOP:
> > >
> > > ---
> > > base-commit: 84b0eb1826f690aa8d51984644318ee6c810f5bf
> > > change-id: 20240506-fix-ioms-mo-97098c6c5396
> > >
> > > Best regards,
> >
> > Reviewed-by: Vincent Fu <vincent.fu@samsung.com>
>
> Klaus, upon taking a second look, the original code is correct. The proposed
> change would only keep the least significant 4 bits of the MO field. The
> original code gives you the 8 bits needed.
>
> Let me withdraw my Reviewed-by.
>
> Vincent
That was embarrasing. Thanks for catching that Vincent :)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-05-24 8:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-06 8:06 [PATCH] hw/nvme: fix mo field in io mgnt send Klaus Jensen
2024-05-07 14:05 ` Vincent Fu
2024-05-08 13:36 ` Vincent Fu
2024-05-24 8:03 ` Klaus Jensen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).