From: "Wang, Jian J" <jian.j.wang@intel.com>
To: "Zeng, Star" <star.zeng@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Gao, Liming" <liming.gao@intel.com>,
"Yao, Jiewen" <jiewen.yao@intel.com>
Subject: Re: [PATCH] MdeModulePkg PcdDxe: ASSERT PcdSetNvStoreDefaultId set
Date: Mon, 15 Oct 2018 02:43:12 +0000 [thread overview]
Message-ID: <D827630B58408649ACB04F44C510003624E74F87@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1539339753-37404-1-git-send-email-star.zeng@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
> -----Original Message-----
> From: Zeng, Star
> Sent: Friday, October 12, 2018 6:23 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Gao, Liming <liming.gao@intel.com>;
> Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>
> Subject: [PATCH] MdeModulePkg PcdDxe: ASSERT PcdSetNvStoreDefaultId set
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1245
>
> In current implementation and according to the description in
> MdeModulePkg.dec, PcdSetNvStoreDefaultId should be set in PEI
> phase to take effect.
>
> This patch ASSERTs PcdSetNvStoreDefaultId set in PcdDxe to alert
> the invalid operation.
>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng <star.zeng@intel.com>
> ---
> MdeModulePkg/Universal/PCD/Dxe/Pcd.c | 5 +++++
> MdeModulePkg/Universal/PCD/Dxe/Pcd.inf | 4 +++-
> 2 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
> b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
> index bc308af1c5d8..f977c7f18e19 100644
> --- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
> +++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
> @@ -890,6 +890,11 @@ DxePcdSet16Ex (
> IN UINT16 Value
> )
> {
> + //
> + // PcdSetNvStoreDefaultId should be set in PEI phase to take effect.
> + //
> + ASSERT (!(CompareGuid (Guid, &gEfiMdeModulePkgTokenSpaceGuid) &&
> + (ExTokenNumber == PcdToken(PcdSetNvStoreDefaultId))));
> return ExSetValueWorker (ExTokenNumber, Guid, &Value, sizeof (Value));
> }
>
> diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
> b/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
> index 066b86aaa5f3..1f41a316bd89 100644
> --- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
> +++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
> @@ -331,6 +331,7 @@ [LibraryClasses]
> [Guids]
> gPcdDataBaseHobGuid ## SOMETIMES_CONSUMES ## HOB
> gPcdDataBaseSignatureGuid ## CONSUMES ## GUID # PCD
> database signature GUID.
> + gEfiMdeModulePkgTokenSpaceGuid ## SOMETIMES_CONSUMES ##
> GUID
>
> [Protocols]
> gPcdProtocolGuid ## PRODUCES
> @@ -342,7 +343,8 @@ [Protocols]
> gEdkiiVariableLockProtocolGuid
>
> [Pcd]
> - gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress ##
> SOMETIMES_CONSUMES
> + gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress ##
> SOMETIMES_CONSUMES
> + gEfiMdeModulePkgTokenSpaceGuid.PcdSetNvStoreDefaultId ##
> SOMETIMES_CONSUMES
>
> [Depex]
> TRUE
> --
> 2.7.0.windows.1
prev parent reply other threads:[~2018-10-15 2:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-12 10:22 [PATCH] MdeModulePkg PcdDxe: ASSERT PcdSetNvStoreDefaultId set Star Zeng
2018-10-15 2:16 ` Gao, Liming
2018-10-15 2:43 ` Wang, Jian J [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=D827630B58408649ACB04F44C510003624E74F87@SHSMSX103.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