From: "Wu, Hao A" <hao.a.wu@intel.com>
To: "Ni, Ray" <ray.ni@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Wang, Jian J" <jian.j.wang@intel.com>,
"Zeng, Star" <star.zeng@intel.com>
Subject: Re: [PATCH v2 10/12] MdeModulePkg/SmmLockBox(PEI): Remove an ASSERT in RestoreLockBox()
Date: Thu, 31 Jan 2019 05:53:12 +0000 [thread overview]
Message-ID: <B80AF82E9BFB8E4FBD8C89DA810C6A093C892E23@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <3c7c8767-23c8-e8a1-ef35-a03e37968ddb@Intel.com>
> -----Original Message-----
> From: Ni, Ray
> Sent: Thursday, January 31, 2019 1:50 PM
> To: Wu, Hao A; edk2-devel@lists.01.org
> Cc: Wang, Jian J; Ni, Ray; Zeng, Star
> Subject: Re: [PATCH v2 10/12] MdeModulePkg/SmmLockBox(PEI): Remove an
> ASSERT in RestoreLockBox()
>
> On 1/31/2019 10:48 AM, Hao Wu wrote:
> > This commit is out of the scope for BZ-1409. It is a refinement for the
> > PEI library instance within SmmLockBoxLib.
> >
> > For the below ASSERT statement within function RestoreLockBox():
> > Status = SmmCommunicationPpi->Communicate (
> > SmmCommunicationPpi,
> > &CommBuffer[0],
> > &CommSize
> > );
> > if (Status == EFI_NOT_STARTED) {
> > //
> > // Pei SMM communication not ready yet, so we access SMRAM directly
> > //
> > DEBUG ((DEBUG_INFO, "SmmLockBoxPeiLib Communicate - (%r)\n",
> Status));
> > Status = InternalRestoreLockBoxFromSmram (Guid, Buffer, Length);
> > LockBoxParameterRestore->Header.ReturnStatus = (UINT64)Status;
> > if (Length != NULL) {
> > LockBoxParameterRestore->Length = (UINT64)*Length;
> > }
> > }
> > ASSERT_EFI_ERROR (Status);
> >
> > It is possible for previous codes to return an error status that is
> > possible for happen. One example is that, when the 'if' statement
> > 'if (Status == EFI_NOT_STARTED) {' is entered, function
> > InternalRestoreLockBoxFromSmram() is possible to return
> 'BUFFER_TOO_SMALL'
> > if the caller of RestoreLockBox() provides a buffer that is too small to
> > hold the content of LockBox.
> >
> > Thus, this commit will remove the ASSERT here.
> >
> > Please note that the current implementation of RestoreLockBox() is
> > handling the above-mentioned error case properly, so no additional error
> > handling codes are needed here.
> >
> > Cc: Jian J Wang <jian.j.wang@intel.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > Cc: Star Zeng <star.zeng@intel.com>
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Hao Wu <hao.a.wu@intel.com>
> > ---
> > MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c
> b/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c
> > index 9f73480070..9d7b4c3706 100644
> > --- a/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c
> > +++ b/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c
> > @@ -623,7 +623,7 @@ RestoreLockBox (
> > LockBoxParameterRestore->Length = (UINT64)*Length;
> > }
> > }
> > - ASSERT_EFI_ERROR (Status);
> > + //ASSERT_EFI_ERROR (Status);
It comes to me that the above line should be removed rather than being
commented. Will handle in the next series.
Best Regards,
Hao Wu
> >
> > if (Length != NULL) {
> > *Length = (UINTN)LockBoxParameterRestore->Length;
> >
> Reviewed-by: Ray Ni <ray.ni@intel.com>
>
> --
> Thanks,
> Ray
next prev parent reply other threads:[~2019-01-31 5:53 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-31 2:48 [PATCH v2 00/12] Split the S3 PEI phase HW init codes from Opal driver Hao Wu
2019-01-31 2:48 ` [PATCH v2 01/12] MdeModulePkg: Add definitions for ATA AHCI host controller PPI Hao Wu
2019-01-31 3:25 ` Ni, Ray
2019-01-31 2:48 ` [PATCH v2 02/12] MdeModulePkg: Add definitions for EDKII PEI ATA PassThru PPI Hao Wu
2019-01-31 3:22 ` Ni, Ray
2019-01-31 5:28 ` Wu, Hao A
2019-01-31 2:48 ` [PATCH v2 03/12] MdeModulePkg: Add definitions for Storage Security Command PPI Hao Wu
2019-01-31 3:26 ` Ni, Ray
2019-01-31 2:48 ` [PATCH v2 04/12] MdeModulePkg: Add GUID for LockBox to save storage dev to init in S3 Hao Wu
2019-01-31 3:27 ` Ni, Ray
2019-01-31 5:30 ` Wu, Hao A
2019-01-31 2:48 ` [PATCH v2 05/12] MdeModulePkg/NvmExpressPei: Avoid updating the module-level variable Hao Wu
2019-01-31 3:28 ` Ni, Ray
2019-01-31 2:48 ` [PATCH v2 06/12] MdeModulePkg/NvmExpressPei: Add logic to produce SSC PPI Hao Wu
2019-01-31 3:35 ` Ni, Ray
2019-01-31 5:40 ` Wu, Hao A
2019-01-31 2:48 ` [PATCH v2 07/12] MdeModulePkg/NvmExpressPei: Consume S3StorageDeviceInitList LockBox Hao Wu
2019-01-31 3:45 ` Ni, Ray
2019-01-31 5:45 ` Wu, Hao A
2019-01-31 2:48 ` [PATCH v2 08/12] MdeModulePkg/AhciPei: Add AHCI mode ATA device support in PEI Hao Wu
2019-01-31 5:49 ` Ni, Ruiyu
2019-01-31 2:48 ` [PATCH v2 09/12] MdeModulePkg/SmmLockBoxLib: Use 'DEBUG_' prefix instead of 'EFI_D_' Hao Wu
2019-01-31 5:49 ` Ni, Ruiyu
2019-01-31 2:48 ` [PATCH v2 10/12] MdeModulePkg/SmmLockBox(PEI): Remove an ASSERT in RestoreLockBox() Hao Wu
2019-01-31 5:50 ` Ni, Ruiyu
2019-01-31 5:53 ` Wu, Hao A [this message]
2019-01-31 2:48 ` [PATCH v2 11/12] MdeModulePkg/SmmLockBoxLib: Support LockBox enlarge in UpdateLockBox() Hao Wu
2019-01-31 6:00 ` Ni, Ruiyu
2019-01-31 2:48 ` [PATCH v2 12/12] SecurityPkg/OpalPassword: Remove HW init codes and consume SSC PPI Hao Wu
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=B80AF82E9BFB8E4FBD8C89DA810C6A093C892E23@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