]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/CpuMpPei/CpuMpPei.c
UefiCpuPkg/CpuMp: Fix hang when StackGuard is enabled in 16-core cpu
[mirror_edk2.git] / UefiCpuPkg / CpuMpPei / CpuMpPei.c
index d07540cf747126b6ae32e32a15021135ac1146c0..40729a09b9eec651c7ea2c2632ec9f0e34e4917a 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   CPU PEI Module installs CPU Multiple Processor PPI.\r
 \r
-  Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -532,13 +532,9 @@ InitializeMpExceptionStackSwitchHandlers (
   ExceptionNumber = FixedPcdGetSize (PcdCpuStackSwitchExceptionList);\r
   NewStackSize = FixedPcdGet32 (PcdCpuKnownGoodStackSize) * ExceptionNumber;\r
 \r
-  Status = PeiServicesAllocatePool (\r
-             NewStackSize * NumberOfProcessors,\r
-             (VOID **)&StackTop\r
-             );\r
+  StackTop = AllocatePages (EFI_SIZE_TO_PAGES (NewStackSize * NumberOfProcessors));\r
   ASSERT(StackTop != NULL);\r
-  if (EFI_ERROR (Status)) {\r
-    ASSERT_EFI_ERROR (Status);\r
+  if (StackTop == NULL) {\r
     return;\r
   }\r
   StackTop += NewStackSize  * NumberOfProcessors;\r