qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Klaus Jensen <its@irrelevant.dk>
To: Francis Pravin Antony Michael Raj <francis.michael@solidigm.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, kbusch@kernel.org,
	Jonathan Derrick <jonathan.derrick@solidigm.com>
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	[thread overview]
Message-ID: <YwUEj3E9HInZx03T@apples> (raw)
In-Reply-To: <20220826025359.124312-1-francis.michael@solidigm.com>

[-- 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 --]

       reply	other threads:[~2022-08-23 16:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220826025359.124312-1-francis.michael@solidigm.com>
2022-08-23 16:47 ` Klaus Jensen [this message]
2022-11-02  8:08 ` [PATCH] hw/nvme: Abort copy command when format is one while pif is zero Klaus Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YwUEj3E9HInZx03T@apples \
    --to=its@irrelevant.dk \
    --cc=francis.michael@solidigm.com \
    --cc=jonathan.derrick@solidigm.com \
    --cc=kbusch@kernel.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).