mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
UefiCpuPkg: Gate AP exception stacks on PcdCpuStackGuard
Commit e67f405713 ("UefiCpuPkg/CpuDxe: Initialize stack switch for MP")
always runs InitializeMpExceptionStackSwitchHandlers(), which copies the
current GDT, appends a TSS, and reloads GDTR/TR via ArchSetupExceptionStack().
Platforms with PcdCpuStackGuard set to FALSE (including UefiPayloadPkg
defaults) do not enable stack guard and should not rewrite the GDT during
CpuDxe MP init. On payload platforms this unconditional path faults during
early CpuDxe and can cause repeated resets before DXE finishes loading.
Restore gating on PcdCpuStackGuard in CpuDxe and CpuMpPei, and consume
the PCD again from CpuDxe.inf.
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
This commit is contained in:
parent
d98a39d4ce
commit
2f11273007
3 changed files with 8 additions and 1 deletions
|
|
@ -89,6 +89,7 @@
|
|||
|
||||
[Pcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask ## CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard ## CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask ## CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask ## CONSUMES
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdTdxSharedBitMask ## CONSUMES
|
||||
|
|
|
|||
|
|
@ -763,7 +763,9 @@ InitializeMpExceptionHandlers (
|
|||
//
|
||||
// Setup stack switch for Stack Guard feature and separate AP GDTs.
|
||||
//
|
||||
InitializeMpExceptionStackSwitchHandlers ();
|
||||
if (PcdGetBool (PcdCpuStackGuard)) {
|
||||
InitializeMpExceptionStackSwitchHandlers ();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -89,6 +89,10 @@ InitializeMpExceptionStackSwitchHandlers (
|
|||
EFI_STATUS Status;
|
||||
UINT8 *Buffer;
|
||||
|
||||
if (!PcdGetBool (PcdCpuStackGuard)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Status = MpInitLibGetNumberOfProcessors (&NumberOfProcessors, NULL);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue