summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorRay Ni <ray.ni@intel.com>2022-06-10 16:43:32 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-06-14 02:59:22 +0000
commit6676162f64ad39949ed44f17ce40e5c49ab33e31 (patch)
treea1dc1091f9e176f49ac800b0e5c0660901b214a4 /MdeModulePkg
parente2ae0bed29ca0900bd359ec8c4c2998c591e6095 (diff)
downloadedk2-6676162f64ad39949ed44f17ce40e5c49ab33e31.tar.gz
edk2-6676162f64ad39949ed44f17ce40e5c49ab33e31.tar.bz2
edk2-6676162f64ad39949ed44f17ce40e5c49ab33e31.zip
DxeMain: Fix the bug that StackGuard is not enabled
Commit e7abb94d1 removed InitializeCpuExceptionHandlersEx and updated DxeMain to call InitializeCpuExceptionHandlers for exception setup. But the old behavior that calls *Ex() sets up the stack guard as well. To match the old behavior, the patch calls InitializeSeparateExceptionStacks. Signed-off-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
index 83f49d7c00..0a1f3d79e2 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
+++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
@@ -257,6 +257,14 @@ DxeMain (
ASSERT_EFI_ERROR (Status);
//
+ // Setup Stack Guard
+ //
+ if (PcdGetBool (PcdCpuStackGuard)) {
+ Status = InitializeSeparateExceptionStacks (NULL);
+ ASSERT_EFI_ERROR (Status);
+ }
+
+ //
// Initialize Debug Agent to support source level debug in DXE phase
//
InitializeDebugAgent (DEBUG_AGENT_INIT_DXE_CORE, HobStart, NULL);