UEFI Testing Package

About

This package adds tests.

System Functional tests

Tests that invoke system functions and query system state for verification.

MemmapAndMatTestApp

This test compares the UEFI memory map and Memory Attributes Table against known requirements. The MAT has strict requirements to allow OS usage and page protections.

MorLockTestApp

This test verifies the UEFI variable store handling of MorLock v1 and v2 behavior.

SmmPagingProtections

This test verifies the SMM paging attributes by invoking operations that should cause cpu exceptions if the memory protections are in place. The SMM cpu exception handler needs to be configured to force reset on trap to allow automated testing.
See UefiCpuPkg/Include/Protocol/SmmExceptionTestProtocol.h, gUefiCpuPkgTokenSpaceGuid.PcdSmmExceptionRebootInsteadOfHaltDefault, and gUefiCpuPkgTokenSpaceGuid.PcdSmmExceptionTestModeSupport.

VarPolicyUnitTestApp

This test verifies functionality of the Variable Policy Protocol by registering various variable policies and exercising them, as well as tests locking the policy, disabling it, and dumping the policy entries.

System Audit tests

UEFI applications that collect data from the system and then that data can be used to compare against known good values.

UefiVarLockAudit

Audit collection tool that gathers information about UEFI variables. This allows auditing the variables within a system, checking attributes, and confirming read/write status. This information is put into an XML file that allows for easy comparison and programmatic auditing.

UEFI

UEFI shell application that gets the current variable information from the UEFI shell and creates an XML file.

Windows

Python script that can be run from the Windows OS. It takes the UEFI created XML file as input and then queries all listed variables and updates the XML with access and status codes. This gives additional verification for variables that may employ late locking or other protections from OS access.

TpmEventLogAudit

Audit tool to collect the TPM Event Log from the system in standard format. It can then be programmatically compared against a known event log for the given system. Easy this that can be tested are the number of events in some PCRs, confirm that all PCRs should be capped, etc.

SMMPagingAudit

Audit tool creates a human readable description of the SMM page tables and memory environment.

App

UEFI shell application collects information from SMM and writes it to files.

SMM

SMM Library linked into SMM driver used to collect information about SMM environment. Activated by the shell app collects IDT, GDT, page tables, and loaded images.

Windows

Python scripts that process the files generated by the UEFI app and output a report for verification and analysis.

Copyright (C) Microsoft Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent