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>
This commit is contained in:
Ray Ni 2022-06-10 16:43:32 +08:00 committed by mergify[bot]
parent e2ae0bed29
commit 6676162f64
1 changed files with 8 additions and 0 deletions

View File

@ -256,6 +256,14 @@ DxeMain (
Status = InitializeCpuExceptionHandlers (VectorInfoList);
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
//