[REBASE & FF] Fix Memory Tests to Run on Patina#825
Open
os-d wants to merge 7 commits intomicrosoft:release/202502from
Open
[REBASE & FF] Fix Memory Tests to Run on Patina#825os-d wants to merge 7 commits intomicrosoft:release/202502from
os-d wants to merge 7 commits intomicrosoft:release/202502from
Conversation
df67dcc to
b33c49b
Compare
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>
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>
b33c49b to
9d41c37
Compare
berlin-with0ut-return
approved these changes
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
How This Was Tested
Tested on physical Intel, Q35, and SBSA.
Integration Instructions
Ensure the platform is producing the memory protection HOB with:
Until Patina enables those features, otherwise those tests will execute and will fail due to no guard pages enabled.