diff options
author | Star Zeng <star.zeng@intel.com> | 2016-04-20 17:27:40 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2016-04-22 13:39:56 +0800 |
commit | 74a88770337121b046ec5f055d4ae06abc37fa60 (patch) | |
tree | d6c2c1909a8a78c86534eb9a72ff639ee1fb06c9 /MdeModulePkg/Core/Dxe/Mem/Page.c | |
parent | 925f0d1ae144a0b57b70fe89a26d47660cf488c7 (diff) | |
download | edk2-platforms-74a88770337121b046ec5f055d4ae06abc37fa60.tar.xz |
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>
Diffstat (limited to 'MdeModulePkg/Core/Dxe/Mem/Page.c')
-rw-r--r-- | MdeModulePkg/Core/Dxe/Mem/Page.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/Page.c index fa71bd87df..dbdc71b59c 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Page.c +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c @@ -1336,6 +1336,7 @@ CoreAllocatePages ( Status = CoreInternalAllocatePages (Type, MemoryType, NumberOfPages, Memory);
if (!EFI_ERROR (Status)) {
CoreUpdateProfile ((EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0), MemoryProfileActionAllocatePages, MemoryType, EFI_PAGES_TO_SIZE (NumberOfPages), (VOID *) (UINTN) *Memory);
+ InstallMemoryAttributesTableOnMemoryAllocation (MemoryType);
}
return Status;
}
@@ -1444,6 +1445,7 @@ CoreFreePages ( Status = CoreInternalFreePages (Memory, NumberOfPages, &MemoryType);
if (!EFI_ERROR (Status)) {
CoreUpdateProfile ((EFI_PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS (0), MemoryProfileActionFreePages, (EFI_MEMORY_TYPE) 0, EFI_PAGES_TO_SIZE (NumberOfPages), (VOID *) (UINTN) Memory);
+ InstallMemoryAttributesTableOnMemoryAllocation (MemoryType);
}
return Status;
}
|