[edk2-devel] [PATCH v2] UefiPayloadPkg: Correct MAX_LOGICAL_PROCESSORS value

Xiaoqiang Zhang posted 1 patch 11 months, 2 weeks ago
Failed in applying to current master (apply log)
UefiPayloadPkg/UefiPayloadPkg.dsc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[edk2-devel] [PATCH v2] UefiPayloadPkg: Correct MAX_LOGICAL_PROCESSORS value
Posted by Xiaoqiang Zhang 11 months, 2 weeks ago
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4367

Issue:
For Server platforms, when FSP does not output mCpuInitMpLibHobGuid HOB,
the code will wakeup all APs and calculate the processor count in DXE
phase. But when processor thread number is above 256, will encounter
Startup IPI exception in DXE phase.

Root cause:
MAX_LOGICAL_PROCESSORS MARCO value in UefiPayloadPkg.dsc is 256,
when the actual processor thread number is above 256, will encounter
data overflow exception.

Solution:
Align MAX_LOGICAL_PROCESSORS value with Server platform side value 1024.

Signed-off-by: Xiaoqiang Zhang <xiaoqiang.zhang@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: James Lu <james.lu@intel.com>
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 35e3bfff35..bca5d3f335 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -59,7 +59,7 @@
   #
   # CPU options
   #
-  DEFINE MAX_LOGICAL_PROCESSORS       = 256
+  DEFINE MAX_LOGICAL_PROCESSORS       = 1024
 
   #
   # PCI options
-- 
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101147): https://edk2.groups.io/g/devel/message/101147
Mute This Topic: https://groups.io/mt/97587622/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2] UefiPayloadPkg: Correct MAX_LOGICAL_PROCESSORS value
Posted by Lu, James 11 months, 2 weeks ago
Reviewed-by: James Lu <james.lu@intel.com>


Thanks,
James

-----Original Message-----
From: Zhang, Xiaoqiang <xiaoqiang.zhang@intel.com> 
Sent: Monday, March 13, 2023 12:53 PM
To: devel@edk2.groups.io
Cc: Zhang, Xiaoqiang <xiaoqiang.zhang@intel.com>; Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Lu, James <james.lu@intel.com>
Subject: [PATCH v2] UefiPayloadPkg: Correct MAX_LOGICAL_PROCESSORS value

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4367

Issue:
For Server platforms, when FSP does not output mCpuInitMpLibHobGuid HOB, the code will wakeup all APs and calculate the processor count in DXE phase. But when processor thread number is above 256, will encounter Startup IPI exception in DXE phase.

Root cause:
MAX_LOGICAL_PROCESSORS MARCO value in UefiPayloadPkg.dsc is 256, when the actual processor thread number is above 256, will encounter data overflow exception.

Solution:
Align MAX_LOGICAL_PROCESSORS value with Server platform side value 1024.

Signed-off-by: Xiaoqiang Zhang <xiaoqiang.zhang@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: James Lu <james.lu@intel.com>
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 35e3bfff35..bca5d3f335 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -59,7 +59,7 @@
   #
   # CPU options
   #
-  DEFINE MAX_LOGICAL_PROCESSORS       = 256
+  DEFINE MAX_LOGICAL_PROCESSORS       = 1024
 
   #
   # PCI options
--
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101158): https://edk2.groups.io/g/devel/message/101158
Mute This Topic: https://groups.io/mt/97587622/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-