public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Hao A" <hao.a.wu@intel.com>
To: "Zeng, Star" <star.zeng@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Ni, Ruiyu" <ruiyu.ni@intel.com>, "Tian, Feng" <feng.tian@intel.com>
Subject: Re: [PATCH] MdeModulePkg/NvmExpressDxe: Fix data buffer not mapped for Write cmd
Date: Tue, 23 Jan 2018 08:39:02 +0000	[thread overview]
Message-ID: <B80AF82E9BFB8E4FBD8C89DA810C6A0931D37E9A@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483103BA00EE3@shsmsx102.ccr.corp.intel.com>

Sure, I will perform the sct test and make sure there's no failure before
pushing this change.


Best Regards,
Hao Wu


> -----Original Message-----
> From: Zeng, Star
> Sent: Tuesday, January 23, 2018 3:50 PM
> To: Wu, Hao A; edk2-devel@lists.01.org
> Cc: Ni, Ruiyu; Tian, Feng; Zeng, Star
> Subject: RE: [PATCH] MdeModulePkg/NvmExpressDxe: Fix data buffer not
> mapped for Write cmd
> 
> Reviewed-by: Star Zeng <star.zeng@intel.com>
> 
> Is it ok to do more test, for example with SCT?
> 
> 
> Thanks,
> Star
> -----Original Message-----
> From: Wu, Hao A
> Sent: Tuesday, January 23, 2018 1:04 PM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Zeng, Star <star.zeng@intel.com>; Ni,
> Ruiyu <ruiyu.ni@intel.com>; Tian, Feng <feng.tian@intel.com>
> Subject: [PATCH] MdeModulePkg/NvmExpressDxe: Fix data buffer not mapped
> for Write cmd
> 
> Within function NvmExpressPassThru():
> 
> The data buffer for the below 2 Admin command:
> Create I/O Completion Queue command (Opcode 01h) Create I/O Submission
> Queue command (Opcode 05h)
> 
> are not mapped to the PCI controller specific addresses.
> 
> But the current code logic also prevents the below NVM command:
> Write (Opcode 01h)
> 
> from mapping its data buffer.
> 
> Hence, this commit refine the logics to resolve this issue.
> 
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Feng Tian <feng.tian@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Hao Wu <hao.a.wu@intel.com>
> ---
>  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
> b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
> index 7356c1d673..302cfdcd8d 100644
> --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
> +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
> @@ -3,7 +3,7 @@
>    NVM Express specification.
> 
>    (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
> -  Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2013 - 2018, Intel Corporation. All rights
> + reserved.<BR>
>    This program and the accompanying materials
>    are licensed and made available under the terms and conditions of the BSD
> License
>    which accompanies this distribution.  The full text of the license may be found
> at @@ -593,7 +593,8 @@ NvmExpressPassThru (
>    // these two cmds are special which requires their data buffer must support
> simultaneous access by both the
>    // processor and a PCI Bus Master. It's caller's responsbility to ensure this.
>    //
> -  if (((Sq->Opc & (BIT0 | BIT1)) != 0) && (Sq->Opc !=
> NVME_ADMIN_CRIOCQ_CMD) && (Sq->Opc != NVME_ADMIN_CRIOSQ_CMD))
> {
> +  if (((Sq->Opc & (BIT0 | BIT1)) != 0) &&
> +      !((Packet->QueueType == NVME_ADMIN_QUEUE) && ((Sq->Opc ==
> + NVME_ADMIN_CRIOCQ_CMD) || (Sq->Opc ==
> NVME_ADMIN_CRIOSQ_CMD)))) {
>      if ((Packet->TransferLength == 0) || (Packet->TransferBuffer == NULL)) {
>        return EFI_INVALID_PARAMETER;
>      }
> --
> 2.12.0.windows.1



      reply	other threads:[~2018-01-23  8:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23  5:03 [PATCH] MdeModulePkg/NvmExpressDxe: Fix data buffer not mapped for Write cmd Hao Wu
2018-01-23  7:50 ` Zeng, Star
2018-01-23  8:39   ` Wu, Hao A [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-list 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=B80AF82E9BFB8E4FBD8C89DA810C6A0931D37E9A@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /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