EFI_MP_SERVICES_PROTOCOL can be provided even when the system has only one logical processor (the BSP); the behavior of EFI_MP_SERVICES_PROTOCOL member functions is well defined. Some drivers (will) depend on the presence of EFI_MP_SERVICES_PROTOCOL even if there's just a BSP, so let's install this protocol under such circumstances too.
After reviewing the implementation for the (mMpSystemData.NumberOfProcessors == 1) case, the above goal seems safely reachable by removing the explicit restrictions under that condition. Cc: Jeff Fan <[email protected]> Cc: Chen Fan <[email protected]> Cc: Jordan Justen <[email protected]> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <[email protected]> Reviewed-by: Jeff Fan <[email protected]> --- UefiCpuPkg/CpuDxe/CpuMp.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index 6eb5497..043641e 100644 --- a/UefiCpuPkg/CpuDxe/CpuMp.c +++ b/UefiCpuPkg/CpuDxe/CpuMp.c @@ -1644,10 +1644,6 @@ InitializeMpSupport ( return; } - if (gMaxLogicalProcessorNumber == 1) { - return; - } - gApStackSize = (UINTN) PcdGet32 (PcdCpuApStackSize); ASSERT ((gApStackSize & (SIZE_4KB - 1)) == 0); @@ -1669,11 +1665,6 @@ InitializeMpSupport ( StartApsStackless (); DEBUG ((DEBUG_INFO, "Detect CPU count: %d\n", mMpSystemData.NumberOfProcessors)); - if (mMpSystemData.NumberOfProcessors == 1) { - FreeApStartupCode (); - FreePages (mCommonStack, EFI_SIZE_TO_PAGES (gMaxLogicalProcessorNumber * gApStackSize)); - return; - } mMpSystemData.CpuDatas = ReallocatePool ( sizeof (CPU_DATA_BLOCK) * gMaxLogicalProcessorNumber, @@ -1700,7 +1691,7 @@ InitializeMpSupport ( &MtrrSettings, // ProcedureArgument NULL // FailedCpuList ); - ASSERT_EFI_ERROR (Status); + ASSERT (Status == EFI_SUCCESS || Status == EFI_NOT_STARTED); Status = gBS->InstallMultipleProtocolInterfaces ( &mMpServiceHandle, -- 1.8.3.1 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

