MdeModulePkg DxeCore: Enhance MemoryAttributesTable installation
Current MemoryAttributesTable will be installed on ReadyToBoot event at TPL_NOTIFY level, it maybe incorrect when PcdHiiOsRuntimeSupport = TRUE as HiiDatabaseDxe will have runtime memory allocation for HII OS runtime support on and after ReadyToBoot. The issue was exposed at http://article.gmane.org/gmane.comp.bios.edk2.devel/10125. To make sure the correctness of MemoryAttributesTable, this patch is to enhance MemoryAttributesTable installation to install MemoryAttributesTable on ReadyToBoot event at TPL_CALLBACK - 1 level to make sure it is at the last of ReadyToBoot event, and also hook runtime memory allocation after ReadyToBoot. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
@@ -276,6 +276,8 @@ extern EFI_RUNTIME_SERVICES *gDxeCoreRT;
|
||||
extern EFI_DXE_SERVICES *gDxeCoreDS;
|
||||
extern EFI_HANDLE gDxeCoreImageHandle;
|
||||
|
||||
extern BOOLEAN gMemoryMapTerminated;
|
||||
|
||||
extern EFI_DECOMPRESS_PROTOCOL gEfiDecompress;
|
||||
|
||||
extern EFI_RUNTIME_ARCH_PROTOCOL *gRuntime;
|
||||
@@ -2858,6 +2860,16 @@ CoreInitializeMemoryAttributesTable (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Install MemoryAttributesTable on memory allocation.
|
||||
|
||||
@param[in] MemoryType EFI memory type.
|
||||
**/
|
||||
VOID
|
||||
InstallMemoryAttributesTableOnMemoryAllocation (
|
||||
IN EFI_MEMORY_TYPE MemoryType
|
||||
);
|
||||
|
||||
/**
|
||||
Insert image record.
|
||||
|
||||
|
Reference in New Issue
Block a user