mu_plus/UefiTestingPkg
kuqin12 c5b1ea0ff0
Fix C3 resume error on certain platforms (#134)
# Preface

Please ensure you have read the [contribution
docs](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md) prior
to submitting the pull request. In particular,
[pull request
guidelines](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md#pull-request-best-practices).

## Description

The original implementation is missing a step of populating the
temporary stack pointer
during the C3 resumption process. This would impact the operations
involving stack
movements (local variables, calls and returns), until the long jump
occurs.

This change is adapted from the assembly `ApEntryPoint` routine from
`ArmPsciMpServicesDxe.inf` to mitigate such null-stack window during C3
resumption.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [x] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [x] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

The change was tested on Q35 and FVP virtual platforms as well as
proprietary physical
platforms.

## Integration Instructions

N/A
2023-01-12 04:01:15 +00:00
..
AuditTests Add Stack and NULL Page Data Collection to the DXE Paging Audit (#131) 2023-01-12 00:53:31 +00:00
FunctionalSystemTests Fix C3 resume error on certain platforms (#134) 2023-01-12 04:01:15 +00:00
Include Introducing MP management driver and unit test app (#123) 2022-12-14 11:27:40 -08:00
Library/PlatformSmmProtectionsTestLibNull Fix Line Endings in Repo (LF -> CRLF) (#67) (#68) 2022-10-12 22:11:28 -04:00
PerfTests/BlockIoPerfTest Fix Line Endings in Repo (LF -> CRLF) (#67) (#68) 2022-10-12 22:11:28 -04:00
Readme.md Fix Line Endings in Repo (LF -> CRLF) (#67) (#68) 2022-10-12 22:11:28 -04:00
UefiTestingPkg.ci.yaml Fix UnitTestingPkg misspells (#135) 2023-01-03 15:47:22 -08:00
UefiTestingPkg.dec Introducing MP management driver and unit test app (#123) 2022-12-14 11:27:40 -08:00
UefiTestingPkg.dsc Fix UnitTestingPkg misspells (#135) 2023-01-03 15:47:22 -08:00

Readme.md

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.

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 (UEFI)

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 (SMM)

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