Hi Pawel,
I see the following union involved in the size of this structure.
typedef union {
IA32_HANDOFF_STATUS IA32HealthFlags;
X64_HANDOFF_STATUS x64HealthFlags;
ITANIUM_HANDOFF_STATUS ItaniumHealthFlags;
} EFI_SEC_PLATFORM_INFORMATION_RECORD;
IA32 is 4 bytes per CPU
X64 is 4 bytes per CPU
Itanium is 56 bytes per CPU
We have removed the Itanium content from edk2 repo and it look like we missed this
union.
If you comment out the following line from the union does it resolve the issue?
I know this only increases the total number of CPUs that can be handled by a single 64kb HOB, so we would run into
it again at a higher number of CPUs. However, I think this gets the overhead per CPU down to 8 bytes, which should
scale to about 8091 CPUs.
Thanks,
Mike
From: Pawel Polawski <ppolawsk@redhat.com>
Sent: Monday, November 7, 2022 3:52 AM
To: devel@edk2.groups.io
Cc: Dong, Eric <eric.dong@intel.com>; Laszlo Ersek <lersek@redhat.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: [edk2-devel] 1024 VCPU limitation
Hi All,
I am trying to run edk2 with more than 1024 VCPU. It looks like it is not possible
at the moment and results in an ASSERT trigger.
In the past the topic has been analyzed by Laszlo Ersek [1]. It turns out that the limit
is result of HOB default allocation being limited to ~64KB, quoting original email thread:
"""
If "NumberOfProcessors" is large enough, such as ~1024, then
"BistInformationSize" will exceed ~64KB, and PeiServicesAllocatePool()
will fail with EFI_OUT_OF_RESOURCES. The reason is that pool allocations
in PEI are implemented with memory alloaction HOBs, and HOBs can't be
larger than ~64KB. (See PeiAllocatePool() in
"MdeModulePkg/Core/Pei/Memory/MemoryServices.c".)"""
Even with HOB allocation being changed, I am afraid it may break some
compatibility on the DXE level. This is the reason I am looking for a more universal solution.
I believe the same limitation exists for the physical x86 platforms with more than 1024 CPU.
If someone has encountered the same issue or has knowledge that workaround / solution for
this already exists or is being developed?
Best regards,
Pawel
--