mirror of https://github.com/acidanthera/audk.git
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:
parent
a8c4464502
commit
07d9dc83f4
|
@ -20,6 +20,7 @@
|
|||
#include <Protocol/SmmConfiguration.h>
|
||||
#include <Protocol/SmmControl2.h>
|
||||
#include <Protocol/DxeSmmReadyToLock.h>
|
||||
#include <Protocol/Cpu.h>
|
||||
|
||||
#include <Guid/EventGroup.h>
|
||||
#include <Guid/EventLegacyBios.h>
|
||||
|
@ -963,8 +964,9 @@ SmmIplEntry (
|
|||
EFI_SMM_RESERVED_SMRAM_REGION *SmramResRegion;
|
||||
UINT64 MaxSize;
|
||||
VOID *Registration;
|
||||
UINT64 SmmCodeSize;
|
||||
UINT64 SmmCodeSize;
|
||||
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
|
||||
|
@ -1063,16 +1065,21 @@ SmmIplEntry (
|
|||
|
||||
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(
|
||||
mSmramCacheBase,
|
||||
mSmramCacheSize,
|
||||
EFI_MEMORY_WB
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_WARN, "SMM IPL failed to set SMRAM window to EFI_MEMORY_WB\n"));
|
||||
}
|
||||
Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&CpuArch);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Status = gDS->SetMemorySpaceAttributes(
|
||||
mSmramCacheBase,
|
||||
mSmramCacheSize,
|
||||
EFI_MEMORY_WB
|
||||
);
|
||||
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
|
||||
// Modules At Fixed Address Configuration Table.
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
gEfiSmmConfigurationProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
gEfiSmmControl2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
gEfiDxeSmmReadyToLockProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
gEfiCpuArchProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
gEfiCpuArchProtocolGuid # PROTOCOL SIMETIMES_CONSUMED
|
||||
|
||||
[Guids]
|
||||
gEfiEventDxeDispatchGuid # ALWAYS_CONSUMED
|
||||
|
@ -71,4 +71,4 @@
|
|||
|
||||
|
||||
[Depex]
|
||||
gEfiSmmAccess2ProtocolGuid AND gEfiSmmControl2ProtocolGuid AND gEfiCpuArchProtocolGuid
|
||||
gEfiSmmAccess2ProtocolGuid AND gEfiSmmControl2ProtocolGuid
|
||||
|
|
Loading…
Reference in New Issue