From b4cd9f78ba0b672b4db0f223c5d78e6541554672 Mon Sep 17 00:00:00 2001 From: Jeff Fan Date: Wed, 15 Jul 2015 03:39:24 +0000 Subject: [PATCH] UefiCpuPkg/CpuMpPei: Sync BPS's mtrr setting to APs Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan Reviewed-by: Feng Tian Reviewed-by: Jiewen Yao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17999 6f19259b-4bc3-4df7-8a09-765794883524 --- UefiCpuPkg/CpuMpPei/CpuMpPei.c | 8 ++++++++ UefiCpuPkg/CpuMpPei/CpuMpPei.h | 2 ++ UefiCpuPkg/CpuMpPei/CpuMpPei.inf | 1 + 3 files changed, 11 insertions(+) diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.c b/UefiCpuPkg/CpuMpPei/CpuMpPei.c index a2f25b9405..e39a813cdd 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.c +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.c @@ -118,6 +118,10 @@ ApCFunction ( BistData = *(UINTN *) (PeiCpuMpData->Buffer + NumApsExecuting * PeiCpuMpData->CpuApStackSize - sizeof (UINTN)); PeiCpuMpData->CpuData[NumApsExecuting].ApicId = GetInitialApicId (); PeiCpuMpData->CpuData[NumApsExecuting].Health.Uint32 = (UINT32) BistData; + // + // Sync BSP's Mtrr table to all wakeup APs + // + MtrrSetAllMtrrs (&PeiCpuMpData->MtrrTable); } // @@ -285,6 +289,10 @@ CountProcessorNumber ( ) { + // + // Store BSP's MTRR setting + // + MtrrGetAllMtrrs (&PeiCpuMpData->MtrrTable); // // Send broadcast IPI to APs to wakeup APs // diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.h b/UefiCpuPkg/CpuMpPei/CpuMpPei.h index 3194f1f0fa..466ddc0558 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.h +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -115,6 +116,7 @@ struct _PEI_CPU_MP_DATA { UINTN ApFunctionArgument; volatile UINT32 FinishedCount; BOOLEAN InitFlag; + MTRR_SETTINGS MtrrTable; PEI_CPU_DATA *CpuData; volatile MP_CPU_EXCHANGE_INFO *MpCpuExchangeInfo; }; diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.inf b/UefiCpuPkg/CpuMpPei/CpuMpPei.inf index 4d7ba3e128..e195f8c3d8 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.inf +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.inf @@ -53,6 +53,7 @@ DebugLib HobLib LocalApicLib + MtrrLib PcdLib PeimEntryPoint PeiServicesLib -- 2.39.2