Remove PI SMM IPL's dependency on CPU AP so that PI SMM IPL can be dispatched before the CPU AP is installed.

If PI SMM IPL will be dispatched before the CPU AP is installed for a platform, the platform developer is expected to set cache-ability of SMRAM to WB earlier to improve performance of SMM initialization.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10998 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
rsun3 2010-11-03 01:14:51 +00:00
parent a8c4464502
commit 07d9dc83f4
2 changed files with 19 additions and 12 deletions

View File

@ -20,6 +20,7 @@
#include <Protocol/SmmConfiguration.h> #include <Protocol/SmmConfiguration.h>
#include <Protocol/SmmControl2.h> #include <Protocol/SmmControl2.h>
#include <Protocol/DxeSmmReadyToLock.h> #include <Protocol/DxeSmmReadyToLock.h>
#include <Protocol/Cpu.h>
#include <Guid/EventGroup.h> #include <Guid/EventGroup.h>
#include <Guid/EventLegacyBios.h> #include <Guid/EventLegacyBios.h>
@ -963,8 +964,9 @@ SmmIplEntry (
EFI_SMM_RESERVED_SMRAM_REGION *SmramResRegion; EFI_SMM_RESERVED_SMRAM_REGION *SmramResRegion;
UINT64 MaxSize; UINT64 MaxSize;
VOID *Registration; VOID *Registration;
UINT64 SmmCodeSize; UINT64 SmmCodeSize;
EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE *LMFAConfigurationTable; EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE *LMFAConfigurationTable;
EFI_CPU_ARCH_PROTOCOL *CpuArch;
// //
// Fill in the image handle of the SMM IPL so the SMM Core can use this as the // Fill in the image handle of the SMM IPL so the SMM Core can use this as the
@ -1063,15 +1065,20 @@ SmmIplEntry (
GetSmramCacheRange (mCurrentSmramRange, &mSmramCacheBase, &mSmramCacheSize); GetSmramCacheRange (mCurrentSmramRange, &mSmramCacheBase, &mSmramCacheSize);
// //
// Attempt to set SMRAM cacheability to WB // If CPU AP is present, attempt to set SMRAM cacheability to WB
// Note that it is expected that cacheability of SMRAM has been set to WB if CPU AP
// is not available here.
// //
Status = gDS->SetMemorySpaceAttributes( Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&CpuArch);
mSmramCacheBase, if (!EFI_ERROR (Status)) {
mSmramCacheSize, Status = gDS->SetMemorySpaceAttributes(
EFI_MEMORY_WB mSmramCacheBase,
); mSmramCacheSize,
if (EFI_ERROR (Status)) { EFI_MEMORY_WB
DEBUG ((DEBUG_WARN, "SMM IPL failed to set SMRAM window to EFI_MEMORY_WB\n")); );
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_WARN, "SMM IPL failed to set SMRAM window to EFI_MEMORY_WB\n"));
}
} }
// //
// if Loading module at Fixed Address feature is enabled, save the SMRAM base to Load // if Loading module at Fixed Address feature is enabled, save the SMRAM base to Load

View File

@ -56,7 +56,7 @@
gEfiSmmConfigurationProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiSmmConfigurationProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiSmmControl2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiSmmControl2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiDxeSmmReadyToLockProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiDxeSmmReadyToLockProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiCpuArchProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiCpuArchProtocolGuid # PROTOCOL SIMETIMES_CONSUMED
[Guids] [Guids]
gEfiEventDxeDispatchGuid # ALWAYS_CONSUMED gEfiEventDxeDispatchGuid # ALWAYS_CONSUMED
@ -71,4 +71,4 @@
[Depex] [Depex]
gEfiSmmAccess2ProtocolGuid AND gEfiSmmControl2ProtocolGuid AND gEfiCpuArchProtocolGuid gEfiSmmAccess2ProtocolGuid AND gEfiSmmControl2ProtocolGuid