Update PI SMM Core to ignore memory ranges from SMRAM Descriptors that are already allocated or not tested or not ECC initialized yet
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10132 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -312,6 +312,16 @@ SmmAddMemoryRegion (
|
|||||||
{
|
{
|
||||||
UINTN AlignedMemBase;
|
UINTN AlignedMemBase;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Do not add memory regions that is already allocated, needs testing, or needs ECC initialization
|
||||||
|
//
|
||||||
|
if ((Attributes & (EFI_ALLOCATED | EFI_NEEDS_TESTING | EFI_NEEDS_ECC_INITIALIZATION)) != 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Align range on an EFI_PAGE_SIZE boundary
|
||||||
|
//
|
||||||
AlignedMemBase = (UINTN)(MemBase + EFI_PAGE_MASK) & ~EFI_PAGE_MASK;
|
AlignedMemBase = (UINTN)(MemBase + EFI_PAGE_MASK) & ~EFI_PAGE_MASK;
|
||||||
MemLength -= AlignedMemBase - MemBase;
|
MemLength -= AlignedMemBase - MemBase;
|
||||||
SmmFreePages (AlignedMemBase, TRUNCATE_TO_PAGES ((UINTN)MemLength));
|
SmmFreePages (AlignedMemBase, TRUNCATE_TO_PAGES ((UINTN)MemLength));
|
||||||
|
Reference in New Issue
Block a user