Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,10 @@ CheckBMETeardown (
for (i = 0; i < (PreVarSize)/(sizeof (BOOLEAN)); i++) {
// BME Enabled before exit boot services
UT_LOG_INFO (PreBuffer[i] ? "Pre-EBS BME %d: True\n" : "Pre-EBS BME %d: False\n", i);
DEBUG ((DEBUG_INFO, PreBuffer[i] ? "%a: Pre-EBS BME %d: True\n" : "%a: Pre-EBS BME %d: False\n", __func__, i));
// BME Disabled after exit boot services
UT_LOG_INFO (PostBuffer[i] ? "Post-EBS BME %d: True\n" : "Post-EBS BME %d: False\n", i);
DEBUG ((DEBUG_INFO, PostBuffer[i] ? "%a: Post-EBS BME %d: True\n" : "%a: Post-EBS BME %d: False\n", __func__, i));
UT_ASSERT_FALSE (PostBuffer[i]);
}

Expand Down Expand Up @@ -348,6 +350,9 @@ CheckBMETeardown (
);
}

UT_LOG_INFO ("PASSED: BME test.\n");
DEBUG ((DEBUG_INFO, "PASSED: BME test.\n"));

return UNIT_TEST_PASSED;
} // CheckBMETeardown()

Expand Down Expand Up @@ -418,8 +423,8 @@ DMAProtectionUnitTestApp (
}

AddTestCase (IommuTests, "All Hardware Definition Units Have IOMMU Enabled", "IOMMU.StatusRegister", CheckIOMMUEnabled, NULL, NULL, NULL);
AddTestCase (IommuTests, "BME Teardown at ExitBootServices", "IOMMU.BMETeardown", CheckBMETeardown, NULL, NULL, BMEContext);
AddTestCase (IommuTests, "Verify excluded ranges are marked reserved", "IOMMU.ExcludedRangeTest", CheckExcludedRegions, NULL, NULL, NULL);
AddTestCase (IommuTests, "BME Teardown at ExitBootServices", "IOMMU.BMETeardown", CheckBMETeardown, NULL, NULL, BMEContext);

//
// Execute the tests.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
## @file DMASmmuProtectionUnitTestApp.inf
##
# DMA Protection Unit Test App for ARM SMMUv3 platforms.
# Tests SMMU translation enable status and RMR reserved memory regions.
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##


[Defines]
INF_VERSION = 0x00010006
BASE_NAME = DMASmmuProtectionUnitTestApp
FILE_GUID = 7A8C2E45-B9F3-4D12-A6E8-9C1B5F3D2E7A
MODULE_TYPE = UEFI_APPLICATION
VERSION_STRING = 1.0
ENTRY_POINT = DMAProtectionUnitTestApp

#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = AARCH64
#

[Sources]
Acpi.c
Acpi.h
DMAProtectionTest.h
DMAProtectionUnitTestApp.c
SMMU/DmaProtection.h
SMMU/DMAProtectionTestArch.c
SMMU/IortAcpiTable.c

[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
UefiTestingPkg/UefiTestingPkg.dec
UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
ShellPkg/ShellPkg.dec

[Protocols]
gEfiPciIoProtocolGuid ## CONSUMES

[LibraryClasses]
UefiApplicationEntryPoint
DebugLib
UnitTestLib
UnitTestBootLib
UnitTestPersistenceLib
IoLib
MemoryAllocationLib
ShellLib
PciLib

[Guids]
gDMAUnitTestVariableGuid
gEfiAcpi20TableGuid
gEfiAcpi10TableGuid
Loading
Loading