* Re: [PATCH] hw/nvme: Abort copy command when format is one while pif is zero
[not found] <20220826025359.124312-1-francis.michael@solidigm.com>
@ 2022-08-23 16:47 ` Klaus Jensen
2022-11-02 8:08 ` Klaus Jensen
1 sibling, 0 replies; 2+ messages in thread
From: Klaus Jensen @ 2022-08-23 16:47 UTC (permalink / raw)
To: Francis Pravin Antony Michael Raj
Cc: qemu-block, qemu-devel, kbusch, Jonathan Derrick
[-- Attachment #1: Type: text/plain, Size: 1175 bytes --]
On Aug 25 22:53, Francis Pravin Antony Michael Raj wrote:
> As per the NVMe command set specification section-3.2.2,
> If:
> i) The namespace is formatted to use 16b Guard Protection Information (i.e., pif = 0) and
> ii) The Descriptor Format is not cleared to 0h
> Then the copy command should be aborted with the status code of Invalid Namespace or Format
>
> Signed-off-by: Francis Pravin Antony Michael Raj <francis.michael@solidigm.com>
> Signed-off-by: Jonathan Derrick <jonathan.derrick@solidigm.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 87aeba0564..cb4c0f80bc 100644
> --- a/hw/nvme/ctrl.c
> +++ b/hw/nvme/ctrl.c
> @@ -3040,7 +3040,7 @@ static uint16_t nvme_copy(NvmeCtrl *n, NvmeRequest *req)
> goto invalid;
> }
>
> - if (ns->pif && 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 <k.jensen@samsung.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] hw/nvme: Abort copy command when format is one while pif is zero
[not found] <20220826025359.124312-1-francis.michael@solidigm.com>
2022-08-23 16:47 ` [PATCH] hw/nvme: Abort copy command when format is one while pif is zero Klaus Jensen
@ 2022-11-02 8:08 ` Klaus Jensen
1 sibling, 0 replies; 2+ messages in thread
From: Klaus Jensen @ 2022-11-02 8:08 UTC (permalink / raw)
To: Francis Pravin Antony Michael Raj
Cc: qemu-block, qemu-devel, kbusch, Jonathan Derrick
[-- Attachment #1: Type: text/plain, Size: 1159 bytes --]
On Aug 25 22:53, Francis Pravin Antony Michael Raj wrote:
> As per the NVMe command set specification section-3.2.2,
> If:
> i) The namespace is formatted to use 16b Guard Protection Information (i.e., pif = 0) and
> ii) The Descriptor Format is not cleared to 0h
> Then the copy command should be aborted with the status code of Invalid Namespace or Format
>
> Signed-off-by: Francis Pravin Antony Michael Raj <francis.michael@solidigm.com>
> Signed-off-by: Jonathan Derrick <jonathan.derrick@solidigm.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 87aeba0564..cb4c0f80bc 100644
> --- a/hw/nvme/ctrl.c
> +++ b/hw/nvme/ctrl.c
> @@ -3040,7 +3040,7 @@ static uint16_t nvme_copy(NvmeCtrl *n, NvmeRequest *req)
> goto invalid;
> }
>
> - if (ns->pif && format != 0x1) {
> + if ((ns->pif == 0x0 && format != 0x0) || (ns->pif && format != 0x1)) {
> status = NVME_INVALID_FORMAT | NVME_DNR;
> goto invalid;
> }
> --
> 2.25.1
>
This got lost somehow.
Applied on nvme-next. Thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread