On Tue, Mar 07, 2023 at 01:20:37PM +0100, Gerd Hoffmann wrote: > In case the number of CPUs can in increase beyond 255 > due to CPU hotplug choose x2apic mode. > > Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
Ping. Any comments on this patch? thanks, Gerd > --- > UefiCpuPkg/Library/MpInitLib/MpLib.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c > b/UefiCpuPkg/Library/MpInitLib/MpLib.c > index e5dc852ed95f..d73b95001263 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c > @@ -526,7 +526,9 @@ CollectProcessorCount ( > // > // Enable x2APIC mode if > // 1. Number of CPU is greater than 255; or > - // 2. There are any logical processors reporting an Initial APIC ID of > 255 or greater. > + // 2. The platform exposed the exact *boot* CPU count to us in advance, > and > + // more than 255 logical processors are possible later, with hotplug; > or > + // 3. There are any logical processors reporting an Initial APIC ID of > 255 or greater. > // > X2Apic = FALSE; > if (CpuMpData->CpuCount > 255) { > @@ -534,6 +536,10 @@ CollectProcessorCount ( > // If there are more than 255 processor found, force to enable X2APIC > // > X2Apic = TRUE; > + } else if ((PcdGet32 (PcdCpuBootLogicalProcessorNumber) > 0) && > + (PcdGet32 (PcdCpuMaxLogicalProcessorNumber) > 255)) > + { > + X2Apic = TRUE; > } else { > CpuInfoInHob = (CPU_INFO_IN_HOB *)(UINTN)CpuMpData->CpuInfoInHob; > for (Index = 0; Index < CpuMpData->CpuCount; Index++) { > -- > 2.39.2 > -- -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#101423): https://edk2.groups.io/g/devel/message/101423 Mute This Topic: https://groups.io/mt/97447597/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-