The logic visible in the previous patch should be done at startup as well, not only when MTRR settings are changed. The inspiration is taken from
Quark_EDKII_v1.1.0/IA32FamilyCpuBasePkg/CpuMpDxe/ (see the EarlyMpInit() function and its call sites in "ProcessorConfig.c"). Cc: Jeff Fan <jeff....@intel.com> Cc: Chen Fan <chen.fan.f...@cn.fujitsu.com> Cc: Jordan Justen <jordan.l.jus...@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <ler...@redhat.com> --- UefiCpuPkg/CpuDxe/CpuMp.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index fa0ef37..ee6fd5c 100644 --- a/UefiCpuPkg/CpuDxe/CpuMp.c +++ b/UefiCpuPkg/CpuDxe/CpuMp.c @@ -14,6 +14,7 @@ #include "CpuDxe.h" #include "CpuMp.h" +#include "MtrrSync.h" UINTN gMaxLogicalProcessorNumber; UINTN gApStackSize; @@ -1551,7 +1552,8 @@ InitializeMpSupport ( VOID ) { - EFI_STATUS Status; + EFI_STATUS Status; + MTRR_SETTINGS MtrrSettings; gMaxLogicalProcessorNumber = (UINTN) PcdGet32 (PcdCpuMaxLogicalProcessorNumber); if (gMaxLogicalProcessorNumber < 1) { @@ -1597,6 +1599,21 @@ InitializeMpSupport ( mAPsAlreadyInitFinished = TRUE; + // + // Synchronize MTRR settings to APs. + // + MtrrGetAllMtrrs (&MtrrSettings); + Status = mMpServicesTemplate.StartupAllAPs ( + &mMpServicesTemplate, // This + LoadMtrrData, // Procedure + TRUE, // SingleThread + NULL, // WaitEvent + 0, // TimeoutInMicrosecsond + &MtrrSettings, // ProcedureArgument + NULL // FailedCpuList + ); + ASSERT_EFI_ERROR (Status); + Status = gBS->InstallMultipleProtocolInterfaces ( &mMpServiceHandle, &gEfiMpServiceProtocolGuid, &mMpServicesTemplate, -- 1.8.3.1 ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel