qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Klaus Jensen
Subject: Re: [PATCH] hw/nvme: Abort copy command when format is one while pif is zero
Date: Tue, 23 Aug 2022 18:47:11 +0200

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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]