MdeModulePkg: Always Initialize Separate Exception Stacks

Following the APs now always initializing separate exception
stacks, this commit always initializes a separate exception
stack for the BSP as well. Previously, this was only enabled
when PcdCpuStackGuard was set.

However, even when a stack guard page is not present,
stack overflows can still occur and corrupt the stack; if an
exception is taken here, it is still valuable to have a separate
exception stack for sanity.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
This commit is contained in:
Oliver Smith-Denny
2025-10-19 20:18:54 -07:00
committed by mergify[bot]
parent 1d6f2f0d8d
commit cec2c6bbcc

View File

@ -259,12 +259,10 @@ DxeMain (
ASSERT_EFI_ERROR (Status);
//
// Setup Stack Guard
// Setup Exception Stack
//
if (PcdGetBool (PcdCpuStackGuard)) {
Status = InitializeSeparateExceptionStacks (NULL, NULL);
ASSERT_EFI_ERROR (Status);
}
Status = InitializeSeparateExceptionStacks (NULL, NULL);
ASSERT_EFI_ERROR (Status);
//
// Initialize Debug Agent to support source level debug in DXE phase