All of lore.kernel.org
 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: Wed, 2 Nov 2022 09:08:12 +0100	[thread overview]
Message-ID: <Y2IlbDXMouJy39xD@cormorant.local> (raw)
In-Reply-To: <20220826025359.124312-1-francis.michael@solidigm.com>

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

      parent reply	other threads:[~2022-11-02  8:09 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 ` [PATCH] hw/nvme: Abort copy command when format is one while pif is zero Klaus Jensen
2022-11-02  8:08 ` Klaus Jensen [this message]

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=Y2IlbDXMouJy39xD@cormorant.local \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.