public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/dec: update the PcdCpuStackGuard property
@ 2022-04-08  3:52 Chen, Gang C
  2022-04-11  9:02 ` Wang, Jian J
  0 siblings, 1 reply; 2+ messages in thread
From: Chen, Gang C @ 2022-04-08  3:52 UTC (permalink / raw)
  To: devel
  Cc: guomin.jiang, dandan.bi, di.zhang, Jian J Wang, Liming Gao,
	Eric Dong, Ray Ni

Update the PcdCpuStackGuard from PcdsFixedAtBuild to PcdsDynamicEx.

Meanwhile, remove the duplicate check for PcdCpuStackGuard for
some limitation, which has been checked at the entry of
InitializeMpExceptionStackSwitchHandlers.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3897

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: devel@edk2.groups.io
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>

Signed-off-by: Gang Chen <gang.c.chen@intel.com>
---
 MdeModulePkg/MdeModulePkg.dec                      | 14 +++++++-------
 .../CpuExceptionHandlerLib/PeiCpuException.c       |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 463e889e9a..72e7e2eced 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -1070,13 +1070,6 @@
   # @Prompt The Heap Guard feature mask
   gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask|0x0|UINT8|0x30001054
 
-  ## Indicates if UEFI Stack Guard will be enabled.
-  #  If enabled, stack overflow in UEFI can be caught, preventing chaotic consequences.<BR><BR>
-  #   TRUE  - UEFI Stack Guard will be enabled.<BR>
-  #   FALSE - UEFI Stack Guard will be disabled.<BR>
-  # @Prompt Enable UEFI Stack Guard.
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0x30001055
-
 [PcdsFixedAtBuild, PcdsPatchableInModule]
   ## Dynamic type PCD can be registered callback function for Pcd setting action.
   #  PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of callback function
@@ -2079,6 +2072,13 @@
   # @Prompt Enable PCIe Resizable BAR Capability support.
   gEfiMdeModulePkgTokenSpaceGuid.PcdPcieResizableBarSupport|FALSE|BOOLEAN|0x10000024
 
+  ## Indicates if UEFI Stack Guard will be enabled.
+  #  If enabled, stack overflow in UEFI can be caught, preventing chaotic consequences.<BR><BR>
+  #   TRUE  - UEFI Stack Guard will be enabled.<BR>
+  #   FALSE - UEFI Stack Guard will be disabled.<BR>
+  # @Prompt Enable UEFI Stack Guard.
+  gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0x00010025
+
 [PcdsPatchableInModule]
   ## Specify memory size with page number for PEI code when
   #  Loading Module at Fixed Address feature is enabled.
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c
index 687fc4177f..bcd4175ffa 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c
@@ -254,7 +254,7 @@ InitializeCpuExceptionHandlersEx (
     //
     // Initializing stack switch is only necessary for Stack Guard functionality.
     //
-    if (PcdGetBool (PcdCpuStackGuard) && (InitData != NULL)) {
+    if (InitData != NULL) {
       Status = ArchSetupExceptionStack (InitData);
     }
   }
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] MdeModulePkg/dec: update the PcdCpuStackGuard property
  2022-04-08  3:52 [PATCH] MdeModulePkg/dec: update the PcdCpuStackGuard property Chen, Gang C
@ 2022-04-11  9:02 ` Wang, Jian J
  0 siblings, 0 replies; 2+ messages in thread
From: Wang, Jian J @ 2022-04-11  9:02 UTC (permalink / raw)
  To: Chen, Gang C, devel@edk2.groups.io
  Cc: Jiang, Guomin, Bi, Dandan, Zhang, Di, Gao, Liming, Dong, Eric,
	Ni, Ray

Reviewed-by: Jian J Wang <jian.j.wang@intel.com>

Regards,
Jian

> -----Original Message-----
> From: Chen, Gang C <gang.c.chen@intel.com>
> Sent: Friday, April 08, 2022 11:52 AM
> To: devel@edk2.groups.io
> Cc: Jiang, Guomin <guomin.jiang@intel.com>; Bi, Dandan
> <dandan.bi@intel.com>; Zhang, Di <di.zhang@intel.com>; Wang, Jian J
> <jian.j.wang@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Dong, Eric
> <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [PATCH] MdeModulePkg/dec: update the PcdCpuStackGuard property
> 
> Update the PcdCpuStackGuard from PcdsFixedAtBuild to PcdsDynamicEx.
> 
> Meanwhile, remove the duplicate check for PcdCpuStackGuard for
> some limitation, which has been checked at the entry of
> InitializeMpExceptionStackSwitchHandlers.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3897
> 
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: devel@edk2.groups.io
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> 
> Signed-off-by: Gang Chen <gang.c.chen@intel.com>
> ---
>  MdeModulePkg/MdeModulePkg.dec                      | 14 +++++++-------
>  .../CpuExceptionHandlerLib/PeiCpuException.c       |  2 +-
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/MdeModulePkg/MdeModulePkg.dec
> b/MdeModulePkg/MdeModulePkg.dec
> index 463e889e9a..72e7e2eced 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -1070,13 +1070,6 @@
>    # @Prompt The Heap Guard feature mask
> 
> gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask|0x0|UINT8|0
> x30001054
> 
> -  ## Indicates if UEFI Stack Guard will be enabled.
> -  #  If enabled, stack overflow in UEFI can be caught, preventing chaotic
> consequences.<BR><BR>
> -  #   TRUE  - UEFI Stack Guard will be enabled.<BR>
> -  #   FALSE - UEFI Stack Guard will be disabled.<BR>
> -  # @Prompt Enable UEFI Stack Guard.
> -
> gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0x30
> 001055
> -
>  [PcdsFixedAtBuild, PcdsPatchableInModule]
>    ## Dynamic type PCD can be registered callback function for Pcd setting action.
>    #  PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number
> of callback function
> @@ -2079,6 +2072,13 @@
>    # @Prompt Enable PCIe Resizable BAR Capability support.
> 
> gEfiMdeModulePkgTokenSpaceGuid.PcdPcieResizableBarSupport|FALSE|BOOLE
> AN|0x10000024
> 
> +  ## Indicates if UEFI Stack Guard will be enabled.
> +  #  If enabled, stack overflow in UEFI can be caught, preventing chaotic
> consequences.<BR><BR>
> +  #   TRUE  - UEFI Stack Guard will be enabled.<BR>
> +  #   FALSE - UEFI Stack Guard will be disabled.<BR>
> +  # @Prompt Enable UEFI Stack Guard.
> +
> gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0x00
> 010025
> +
>  [PcdsPatchableInModule]
>    ## Specify memory size with page number for PEI code when
>    #  Loading Module at Fixed Address feature is enabled.
> diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c
> index 687fc4177f..bcd4175ffa 100644
> --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c
> +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuException.c
> @@ -254,7 +254,7 @@ InitializeCpuExceptionHandlersEx (
>      //
>      // Initializing stack switch is only necessary for Stack Guard functionality.
>      //
> -    if (PcdGetBool (PcdCpuStackGuard) && (InitData != NULL)) {
> +    if (InitData != NULL) {
>        Status = ArchSetupExceptionStack (InitData);
>      }
>    }
> --
> 2.35.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-11  9:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-08  3:52 [PATCH] MdeModulePkg/dec: update the PcdCpuStackGuard property Chen, Gang C
2022-04-11  9:02 ` Wang, Jian J

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox