[edk2] [Patch v5 21/21] MdeModulePkg/BdsDxe: Move display of test key usage into BDS module

Kinney, Michael D posted 21 patches 6 years, 9 months ago
There is a newer version of this series
[edk2] [Patch v5 21/21] MdeModulePkg/BdsDxe: Move display of test key usage into BDS module
Posted by Kinney, Michael D 6 years, 9 months ago
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 MdeModulePkg/Universal/BdsDxe/BdsDxe.inf |  1 +
 MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
index 7e644aa995..7030d67907 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
+++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
@@ -100,6 +100,7 @@ [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision                  ## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand              ## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable              ## SOMETIMES_CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed                       ## CONSUMES
 
 [Depex]
   TRUE
diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index a25663ea43..b9ca31741e 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -884,6 +884,18 @@ BdsEntry (
   PERF_INMODULE_BEGIN("PlatformBootManagerAfterConsole");
   PlatformBootManagerAfterConsole ();
   PERF_INMODULE_END("PlatformBootManagerAfterConsole");
+
+  //
+  // If any component set PcdTestKeyUsed to TRUE because use of a test key
+  // was detected, then display a warning message on the debug log and the console
+  //
+  if (PcdGetBool (PcdTestKeyUsed) == TRUE) {
+    DEBUG ((DEBUG_ERROR, "**********************************\n"));
+    DEBUG ((DEBUG_ERROR, "**  WARNING: Test Key is used.  **\n"));
+    DEBUG ((DEBUG_ERROR, "**********************************\n"));
+    Print (L"**  WARNING: Test Key is used.  **\n");
+  }
+
   //
   // Boot to Boot Manager Menu when EFI_OS_INDICATIONS_BOOT_TO_FW_UI is set. Skip HotkeyBoot
   //
-- 
2.14.2.windows.3

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch v5 21/21] MdeModulePkg/BdsDxe: Move display of test key usage into BDS module
Posted by Zeng, Star 6 years, 9 months ago
A very minor comment.

if (PcdGetBool (PcdTestKeyUsed))
can be used directly instead of
if (PcdGetBool (PcdTestKeyUsed) == TRUE)

With update, Reviewed-by: Star Zeng <star.zeng@intel.com>.


Thanks,
Star
-----Original Message-----
From: Kinney, Michael D 
Sent: Wednesday, August 1, 2018 2:55 PM
To: edk2-devel@lists.01.org
Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Zeng, Star <star.zeng@intel.com>; Dong, Eric <eric.dong@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: [Patch v5 21/21] MdeModulePkg/BdsDxe: Move display of test key usage into BDS module

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 MdeModulePkg/Universal/BdsDxe/BdsDxe.inf |  1 +
 MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
index 7e644aa995..7030d67907 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
+++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
@@ -100,6 +100,7 @@ [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision                  ## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand              ## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable              ## SOMETIMES_CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed                       ## CONSUMES
 
 [Depex]
   TRUE
diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index a25663ea43..b9ca31741e 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -884,6 +884,18 @@ BdsEntry (
   PERF_INMODULE_BEGIN("PlatformBootManagerAfterConsole");
   PlatformBootManagerAfterConsole ();
   PERF_INMODULE_END("PlatformBootManagerAfterConsole");
+
+  //
+  // If any component set PcdTestKeyUsed to TRUE because use of a test key
+  // was detected, then display a warning message on the debug log and the console
+  //
+  if (PcdGetBool (PcdTestKeyUsed) == TRUE) {
+    DEBUG ((DEBUG_ERROR, "**********************************\n"));
+    DEBUG ((DEBUG_ERROR, "**  WARNING: Test Key is used.  **\n"));
+    DEBUG ((DEBUG_ERROR, "**********************************\n"));
+    Print (L"**  WARNING: Test Key is used.  **\n");
+  }
+
   //
   // Boot to Boot Manager Menu when EFI_OS_INDICATIONS_BOOT_TO_FW_UI is set. Skip HotkeyBoot
   //
-- 
2.14.2.windows.3

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch v5 21/21] MdeModulePkg/BdsDxe: Move display of test key usage into BDS module
Posted by Kinney, Michael D 6 years, 9 months ago
Star,

I agree.  I will integrate into a V6 patch series.

Thanks,

Mike

> -----Original Message-----
> From: Zeng, Star
> Sent: Wednesday, August 1, 2018 12:53 AM
> To: Kinney, Michael D <michael.d.kinney@intel.com>;
> edk2-devel@lists.01.org
> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Dong, Eric
> <eric.dong@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: RE: [Patch v5 21/21] MdeModulePkg/BdsDxe: Move
> display of test key usage into BDS module
> 
> A very minor comment.
> 
> if (PcdGetBool (PcdTestKeyUsed))
> can be used directly instead of
> if (PcdGetBool (PcdTestKeyUsed) == TRUE)
> 
> With update, Reviewed-by: Star Zeng
> <star.zeng@intel.com>.
> 
> 
> Thanks,
> Star
> -----Original Message-----
> From: Kinney, Michael D
> Sent: Wednesday, August 1, 2018 2:55 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Zeng, Star
> <star.zeng@intel.com>; Dong, Eric
> <eric.dong@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>
> Subject: [Patch v5 21/21] MdeModulePkg/BdsDxe: Move
> display of test key usage into BDS module
> 
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Michael D Kinney
> <michael.d.kinney@intel.com>
> ---
>  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf |  1 +
>  MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 12
> ++++++++++++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> index 7e644aa995..7030d67907 100644
> --- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> +++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> @@ -100,6 +100,7 @@ [Pcd]
>    gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision
> ## CONSUMES
> 
> gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand
> ## CONSUMES
> 
> gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable
> ## SOMETIMES_CONSUMES
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed
> ## CONSUMES
> 
>  [Depex]
>    TRUE
> diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> index a25663ea43..b9ca31741e 100644
> --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> @@ -884,6 +884,18 @@ BdsEntry (
> 
> PERF_INMODULE_BEGIN("PlatformBootManagerAfterConsole");
>    PlatformBootManagerAfterConsole ();
> 
> PERF_INMODULE_END("PlatformBootManagerAfterConsole");
> +
> +  //
> +  // If any component set PcdTestKeyUsed to TRUE
> because use of a test key
> +  // was detected, then display a warning message on
> the debug log and the console
> +  //
> +  if (PcdGetBool (PcdTestKeyUsed) == TRUE) {
> +    DEBUG ((DEBUG_ERROR,
> "**********************************\n"));
> +    DEBUG ((DEBUG_ERROR, "**  WARNING: Test Key is
> used.  **\n"));
> +    DEBUG ((DEBUG_ERROR,
> "**********************************\n"));
> +    Print (L"**  WARNING: Test Key is used.  **\n");
> +  }
> +
>    //
>    // Boot to Boot Manager Menu when
> EFI_OS_INDICATIONS_BOOT_TO_FW_UI is set. Skip
> HotkeyBoot
>    //
> --
> 2.14.2.windows.3

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel