diff --git a/UefiTestingPkg/FunctionalSystemTests/MemoryProtectionTest/App/MemoryProtectionTestApp.c b/UefiTestingPkg/FunctionalSystemTests/MemoryProtectionTest/App/MemoryProtectionTestApp.c index 28cb9fa6c1..f96edd7e0b 100644 --- a/UefiTestingPkg/FunctionalSystemTests/MemoryProtectionTest/App/MemoryProtectionTestApp.c +++ b/UefiTestingPkg/FunctionalSystemTests/MemoryProtectionTest/App/MemoryProtectionTestApp.c @@ -117,6 +117,8 @@ GetDxeMemoryTypeSettingFromBitfield ( return HeapGuardMemoryType.Fields.EfiPalCode; case EfiPersistentMemory: return HeapGuardMemoryType.Fields.EfiPersistentMemory; + case EfiUnacceptedMemoryType: + return HeapGuardMemoryType.Fields.EfiUnacceptedMemoryType; default: return FALSE; } @@ -169,6 +171,8 @@ GetMmMemoryTypeSettingFromBitfield ( return HeapGuardMemoryType.Fields.EfiPalCode; case EfiPersistentMemory: return HeapGuardMemoryType.Fields.EfiPersistentMemory; + case EfiUnacceptedMemoryType: + return HeapGuardMemoryType.Fields.EfiUnacceptedMemoryType; default: return FALSE; } @@ -704,7 +708,8 @@ UefiNxProtectionPreReq ( // Skip memory types which cannot be allocated if ((MemoryProtectionContext.TargetMemoryType == EfiConventionalMemory) || - (MemoryProtectionContext.TargetMemoryType == EfiPersistentMemory)) + (MemoryProtectionContext.TargetMemoryType == EfiPersistentMemory) || + (MemoryProtectionContext.TargetMemoryType == EfiUnacceptedMemoryType)) { UT_LOG_WARNING ("Skipping test of memory type %a -- memory type cannot be allocated", MEMORY_TYPES[MemoryProtectionContext.TargetMemoryType]); return UNIT_TEST_SKIPPED; @@ -747,7 +752,8 @@ UefiPageGuardPreReq ( // Skip memory types which cannot be allocated if ((MemoryProtectionContext.TargetMemoryType == EfiConventionalMemory) || - (MemoryProtectionContext.TargetMemoryType == EfiPersistentMemory)) + (MemoryProtectionContext.TargetMemoryType == EfiPersistentMemory) || + (MemoryProtectionContext.TargetMemoryType == EfiUnacceptedMemoryType)) { UT_LOG_WARNING ("Skipping test of memory type %a -- memory type cannot be allocated", MEMORY_TYPES[MemoryProtectionContext.TargetMemoryType]); return UNIT_TEST_SKIPPED; @@ -784,7 +790,8 @@ UefiPoolGuardPreReq ( // Skip memory types which cannot be allocated if ((MemoryProtectionContext.TargetMemoryType == EfiConventionalMemory) || - (MemoryProtectionContext.TargetMemoryType == EfiPersistentMemory)) + (MemoryProtectionContext.TargetMemoryType == EfiPersistentMemory) || + (MemoryProtectionContext.TargetMemoryType == EfiUnacceptedMemoryType)) { UT_LOG_WARNING ("Skipping test of memory type %a -- memory type cannot be allocated", MEMORY_TYPES[MemoryProtectionContext.TargetMemoryType]); return UNIT_TEST_SKIPPED; @@ -865,7 +872,8 @@ SmmPageGuardPreReq ( // Skip memory types which cannot be allocated if ((MemoryProtectionContext.TargetMemoryType == EfiConventionalMemory) || - (MemoryProtectionContext.TargetMemoryType == EfiPersistentMemory)) + (MemoryProtectionContext.TargetMemoryType == EfiPersistentMemory) || + (MemoryProtectionContext.TargetMemoryType == EfiUnacceptedMemoryType)) { UT_LOG_WARNING ("Skipping test of memory type %a -- memory type cannot be allocated", MEMORY_TYPES[MemoryProtectionContext.TargetMemoryType]); return UNIT_TEST_SKIPPED; @@ -902,7 +910,8 @@ SmmPoolGuardPreReq ( // Skip memory types which cannot be allocated if ((MemoryProtectionContext.TargetMemoryType == EfiConventionalMemory) || - (MemoryProtectionContext.TargetMemoryType == EfiPersistentMemory)) + (MemoryProtectionContext.TargetMemoryType == EfiPersistentMemory) || + (MemoryProtectionContext.TargetMemoryType == EfiUnacceptedMemoryType)) { UT_LOG_WARNING ("Skipping test of memory type %a -- memory type cannot be allocated", MEMORY_TYPES[MemoryProtectionContext.TargetMemoryType]); return UNIT_TEST_SKIPPED; diff --git a/UefiTestingPkg/FunctionalSystemTests/MemoryProtectionTest/MemoryProtectionTestCommon.h b/UefiTestingPkg/FunctionalSystemTests/MemoryProtectionTest/MemoryProtectionTestCommon.h index e797b413df..d2249bb1fa 100644 --- a/UefiTestingPkg/FunctionalSystemTests/MemoryProtectionTest/MemoryProtectionTestCommon.h +++ b/UefiTestingPkg/FunctionalSystemTests/MemoryProtectionTest/MemoryProtectionTestCommon.h @@ -16,9 +16,11 @@ CHAR8 *MEMORY_TYPES[] = { "ReservedMemoryType", "LoaderCode", "LoaderData", "BootServicesCode", "BootServicesData", "RuntimeServicesCode", "RuntimeServicesData", "ConventionalMemory", "UnusableMemory", "ACPIReclaimMemory", "ACPIMemoryNVS", "MemoryMappedIO", - "MemoryMappedIOPortSpace", "PalCode", "PersistentMemory" + "MemoryMappedIOPortSpace", "PalCode", "PersistentMemory", "EfiUnacceptedMemoryType" }; +STATIC_ASSERT (EfiMaxMemoryType == ARRAY_SIZE (MEMORY_TYPES), "MEMORY_TYPES array size does not match EfiMaxMemoryType"); + //// // Reset: Test will be run by violating the memory protection policy with the expectation that the system // will reboot each time. The test will take roughly 45 minutes to run with a strict protection policy.