From: Michael Kinney <michael.d.kin...@intel.com>

When only 1 CPU is detected and the max CPUs is greater than 1,
an ASSERT() is generated because the pages associated with the
AP stack have already been freed.  Only do this FreePages() call
if there is more than 1 CPU detected.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kin...@intel.com>
---

Notes:
    v2:
    - New in v2, but this is just a fixup from Mike on top of his series
      "[edk2] [PATCH 0/7] UefiCpuPkg: Add CPU SMM and SecCore". I'm
      including it here for completeness; the next version of Mike's series
      will contain it squashed-in.

 UefiCpuPkg/CpuDxe/CpuMp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c
index 22a0d9d..da3686e 100644
--- a/UefiCpuPkg/CpuDxe/CpuMp.c
+++ b/UefiCpuPkg/CpuDxe/CpuMp.c
@@ -1697,7 +1697,7 @@ InitializeMpSupport (
                   );
   ASSERT_EFI_ERROR (Status);
 
-  if (mMpSystemData.NumberOfProcessors < gMaxLogicalProcessorNumber) {
+  if (mMpSystemData.NumberOfProcessors > 1 && mMpSystemData.NumberOfProcessors 
< gMaxLogicalProcessorNumber) {
     if (mApStackStart != NULL) {
       FreePages (mApStackStart, EFI_SIZE_TO_PAGES (
                                   (gMaxLogicalProcessorNumber - 
mMpSystemData.NumberOfProcessors) *
-- 
1.8.3.1


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to