Skip to content

[CHERRY-PICK][REBASE & FF] Revert Mu Commit in Favor of edk2 Commit#1758

Merged
os-d merged 2 commits intomicrosoft:release/202511from
os-d:cp_mmu_lib
Apr 10, 2026
Merged

[CHERRY-PICK][REBASE & FF] Revert Mu Commit in Favor of edk2 Commit#1758
os-d merged 2 commits intomicrosoft:release/202511from
os-d:cp_mmu_lib

Conversation

@os-d
Copy link
Copy Markdown
Contributor

@os-d os-d commented Apr 10, 2026

Description

Revert a Mu commit in favor of the edk2 commit.

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

How This Was Tested

N/A.

Integration Instructions

N/A.

os-d added 2 commits April 10, 2026 09:01
…loc"

This reverts commit 919765a as it
has been upstreamed to edk2.
…age Alloc

Currently, there is a bug in UpdateRegionMappingRecursive() when
guard pages are enabled and a large page is being split.

The code checks whether the page table is a block or table and
seeing that it is a block, allocates a new page table for the next
level. However, when it does this, it will call an additional recursive
call into the page table updating logic to make sure the new page table
page is mapped. In addition, when guard pages are enabled, it will
mark the guard page as RP. If the guard page is in the same block as
we are already trying to split, the recursive call will split the
block and mark the guard page as RP.

When we return to the original call, it will fill out the now
orphaned page table but never install it into the page table
hierarchy (and if it did, it would lose the guard page). This
has been observed to cause a driver's code section to still have
NX set on it and so crash when trying to execute.

This commit resolves the issue by checking if the block has
already been split when we return from the new page table
allocation. If it has, we simply update the existing table mapping
instead of trying to split the block.

The allocated page table page cannot be immediately freed, because
this might trigger the block to get re-merged, so a reference to
it is held until the end of updating this level and subsequent
levels, when it can be safely freed. It is possible that the mapping
extends across two large pages and this issue could exist on both
sides, so in the worst case we may have two orphaned tables to
free.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
(cherry picked from commit b2a149cf97e4244e61930207c050075311996c2f)
@mu-automation
Copy link
Copy Markdown
Contributor

mu-automation Bot commented Apr 10, 2026

✅ QEMU Validation Passed

Source Dependencies

Repository Commit
mu_basecore 6084c9d
mu_tiano_platforms e7f5cec

Results

Platform Target Build Boot Overall Boot Time Build Logs Boot Logs
Q35 DEBUG ✅ success ✅ success 0m 16s Build Logs Boot Logs
SBSA DEBUG ✅ success ✅ success 0m 28s Build Logs Boot Logs

Workflow run: https://github.com/microsoft/mu_basecore/actions/runs/24252321472

This comment was automatically generated by the Mu QEMU PR Validation workflow.

@os-d os-d enabled auto-merge (rebase) April 10, 2026 16:04
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 0% with 22 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release/202511@4db4609). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...fiCpuPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c 0.00% 22 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##             release/202511   #1758   +/-   ##
================================================
  Coverage                  ?   4.78%           
================================================
  Files                     ?     146           
  Lines                     ?   27177           
  Branches                  ?     527           
================================================
  Hits                      ?    1301           
  Misses                    ?   25852           
  Partials                  ?      24           
Flag Coverage Δ
UefiCpuPkg 4.78% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@os-d os-d merged commit 872dc15 into microsoft:release/202511 Apr 10, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants