summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/CpuDxe/CpuMp.c
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2015-10-19 19:08:47 +0000
committermdkinney <mdkinney@Edk2>2015-10-19 19:08:47 +0000
commit94941c8853448c1d2f72f90f7fedebd71035fe00 (patch)
tree881354ac4891fad30f579a0ab3da592b81c051b5 /UefiCpuPkg/CpuDxe/CpuMp.c
parent1aa6bf528926f8f012a0f2a77bdf53374551a9ec (diff)
downloadedk2-94941c8853448c1d2f72f90f7fedebd71035fe00.tar.gz
edk2-94941c8853448c1d2f72f90f7fedebd71035fe00.tar.bz2
edk2-94941c8853448c1d2f72f90f7fedebd71035fe00.zip
UefiCpuPkg: CpuDxe: broadcast MTRR changes to APs
The Quark_EDKII_v1.1.0/IA32FamilyCpuBasePkg/CpuArchDxe driver applies any MTRR changes to APs, if the EFI_MP_SERVICES_PROTOCOL is available. We should do the same. Additionally, the broadcast should occur at MP 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"). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18632 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UefiCpuPkg/CpuDxe/CpuMp.c')
-rw-r--r--UefiCpuPkg/CpuDxe/CpuMp.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c
index f3a5a24b0f..04c2f1f0ac 100644
--- a/UefiCpuPkg/CpuDxe/CpuMp.c
+++ b/UefiCpuPkg/CpuDxe/CpuMp.c
@@ -1667,6 +1667,22 @@ ExitBootServicesCallback (
}
/**
+ A minimal wrapper function that allows MtrrSetAllMtrrs() to be passed to
+ EFI_MP_SERVICES_PROTOCOL.StartupAllAPs() as Procedure.
+
+ @param[in] Buffer Pointer to an MTRR_SETTINGS object, to be passed to
+ MtrrSetAllMtrrs().
+**/
+VOID
+EFIAPI
+SetMtrrsFromBuffer (
+ IN VOID *Buffer
+ )
+{
+ MtrrSetAllMtrrs (Buffer);
+}
+
+/**
Initialize Multi-processor support.
**/
@@ -1676,6 +1692,7 @@ InitializeMpSupport (
)
{
EFI_STATUS Status;
+ MTRR_SETTINGS MtrrSettings;
UINTN Timeout;
gMaxLogicalProcessorNumber = (UINTN) PcdGet32 (PcdCpuMaxLogicalProcessorNumber);
@@ -1748,6 +1765,21 @@ InitializeMpSupport (
//
CollectBistDataFromHob ();
+ //
+ // Synchronize MTRR settings to APs.
+ //
+ MtrrGetAllMtrrs (&MtrrSettings);
+ Status = mMpServicesTemplate.StartupAllAPs (
+ &mMpServicesTemplate, // This
+ SetMtrrsFromBuffer, // Procedure
+ TRUE, // SingleThread
+ NULL, // WaitEvent
+ 0, // TimeoutInMicrosecsond
+ &MtrrSettings, // ProcedureArgument
+ NULL // FailedCpuList
+ );
+ ASSERT (Status == EFI_SUCCESS || Status == EFI_NOT_STARTED);
+
Status = gBS->InstallMultipleProtocolInterfaces (
&mMpServiceHandle,
&gEfiMpServiceProtocolGuid, &mMpServicesTemplate,