Skip to content

Conversation

@os-d
Copy link
Contributor

@os-d os-d commented Feb 6, 2026

Description

See individual commit descriptions for full details. This changeset updates the paging audit simple test, full audit, and memory protections test app to run on Patina.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

Tested on physical Intel, Q35, and SBSA.

Integration Instructions

Ensure the platform is producing the memory protection HOB with:

DxeSettings.HeapGuardPolicy.Fields.UefiPageGuard = 0;
DxeSettings.HeapGuardPolicy.Fields.UefiPoolGuard = 0;

Until Patina enables those features, otherwise those tests will execute and will fail due to no guard pages enabled.

This is a breaking change because it depends on mu_basecore version >= v2025020003.0.2 as some header definitions are depended on in that release.

@mu-automation mu-automation bot added language:python Pull requests that update Python code impact:testing Affects testing impact:non-functional Does not have a functional impact labels Feb 6, 2026
@os-d os-d force-pushed the mem_tests_patina branch 2 times, most recently from b33c49b to 9d41c37 Compare February 6, 2026 21:53
@os-d os-d force-pushed the mem_tests_patina branch 2 times, most recently from 2d7efe8 to ff961f7 Compare February 9, 2026 21:29
@os-d os-d enabled auto-merge (rebase) February 9, 2026 21:30
@os-d os-d force-pushed the mem_tests_patina branch from ff961f7 to 2de7ef4 Compare February 9, 2026 21:44
@os-d os-d disabled auto-merge February 9, 2026 21:50
@os-d os-d force-pushed the mem_tests_patina branch from 2de7ef4 to 1848417 Compare February 9, 2026 23:29
@os-d os-d added the impact:breaking-change Requires integration attention label Feb 9, 2026
@os-d os-d enabled auto-merge (rebase) February 9, 2026 23:30
@mu-automation mu-automation bot added type:documentation Improvements or additions to documentation and removed impact:breaking-change Requires integration attention labels Feb 9, 2026
os-d added 4 commits February 9, 2026 19:37
The Paging Audit has a bad call pattern for GetMemoryMap():
it assumes that the unmerged memory map size is within 20%
larger than the merged memory map size (i.e. the first call
to GetMemoryMap() with size 0 and the subsequent call).

Instead, always use the unmerged size + 20% as the safe size
to use. Otherwise we can fail because we say we have too small
a buffer.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
This adds support for running the paging audit on X64
Patina systems. The only change required is adding
self map parsing instead of physical page table map
parsing.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
There was a flawed test in the paging audit that tried to confirm
that memory outside of the EFI_MEMORY_MAP was marked as RP, but it
did not have all the information needed to determine this. The test
was removed from the simplified tests in the test app in
microsoft@5beccf1
but it was not removed from the full paging audit. This
removes the test from the full audit.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
The Paging Audit Python script has a bad assumption
that the only RO Data should be the GDT/IDT. However,
this is incorrect for Patina, it marks any image section
that is not marked writeable as RO, so we will end up
with RO Data sections. This commit correctly reports
that instead of specifying an error.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
os-d added 3 commits February 9, 2026 19:37
The DxeMemoryProtectionTestApp relies on a Project Mu produced
protocol to search images. However, this is not required for
Patina and the debug image info table can be used instead.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
This adds self mapped page table walking to the AARCH64 paging audit
test app.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
This commit adds self map page table walking for X64 in the
simple paging audit test case. The logic was copied from
CpuPageTableLib and self map logic added.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
@os-d os-d merged commit 3496fc1 into microsoft:release/202502 Feb 10, 2026
28 checks passed
@os-d os-d deleted the mem_tests_patina branch February 10, 2026 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:non-functional Does not have a functional impact impact:testing Affects testing language:python Pull requests that update Python code type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants