Skip to content

[2511] MdeModulePkg/Variable: Remove Mu RT cache buffer allocation changes [Rebase & FF]#1781

Open
makubacki wants to merge 4 commits intomicrosoft:release/202511from
makubacki:2511_remove_var_migration
Open

[2511] MdeModulePkg/Variable: Remove Mu RT cache buffer allocation changes [Rebase & FF]#1781
makubacki wants to merge 4 commits intomicrosoft:release/202511from
makubacki:2511_remove_var_migration

Conversation

@makubacki
Copy link
Copy Markdown
Member

Description

Project Mu had changes to move UEFI variable runtime cache allocation to DXE instead of PEI. The Project Mu MM model allows the runtime buffer allocations to be unblocked for MM access in DXE and allocating in DXE did not cause RT buffer fragmentation in the memory map to better accommodate hibernate resume.

With PEI memory buckets being added in #1759 to Project Mu beginning with the 2511 branch, the upstream flow to allocate the RT cache buffer in PEI can be restored

This PR reverts commits that added DXE runtime cache buffer allocation support individually, so it is clear exactly what is reverted and these changes can be skipped on future Mu release branches.


  1. Revert "[CHERRY-PICK] MdeModulePkg/VariableSmmRuntimeDxe: Fix EFI_UNSUPPORTED leak ([CHERRY-PICK] MdeModulePkg/VariableSmmRuntimeDxe: Fix EFI_UNSUPPORTED leak #1668)"
  2. Revert "MdeModulePkg/Variable: Add PCD to control RT cache allocation (MdeModulePkg/Variable: Add PCD to control RT cache allocation #1588)"
  3. Revert "MdeModulePkg/VariableSmmRuntimeDxe: Disable var RT cache on alloc failure"
  4. Revert "MdeModulePkg/Variable: Move RT cache buffer allocation to DXE"
  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

  • Boot on QEMU Q35 and a physical Intel platform with the change (and PEI memory buckets present)
  • Compared resulting files with edk2 variable code taking into account other unrelated Mu changes

Integration Instructions

  • gEfiMdeModulePkgTokenSpaceGuid.PcdMigrateVariableRuntimeCacheBufferAllocation is removed from MdeModulePkg.dec so delete any references in that in platform code.
  • It is recommended to ensure the PEI memory buckets PR referenced in this PR's description is included in the Mu Basecore code used by the platform so PEI memory buckets can be used to reduce runtime memory fragmentation.

…UPPORTED leak (microsoft#1668)"

This reverts commit 9994a20 to

---

Commit 1 of 4 for "Remove MU RT cache buffer allocation changes"

"Remove MU RT cache buffer allocation changes" series objective:

Project Mu had changes to move UEFI variable runtime cache allocation
to DXE instead of PEI. The Project Mu MM model allows the runtime
buffer allocations to be unblocked for MM access in DXE and allocating
in DXE did not cause RT buffer fragmentation in the memory map to
better accommodate hibernate resume.

With PEI memory buckets added to Project Mu beginning with the 2511
branch, the upstream flow to allocate the RT cache buffer in PEI can
be restored

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
…microsoft#1588)"

This reverts commit 9dd4ee3.

---

Commit 2 of 4 for "Remove MU RT cache buffer allocation changes"

"Remove MU RT cache buffer allocation changes" series objective:

Project Mu had changes to move UEFI variable runtime cache allocation
to DXE instead of PEI. The Project Mu MM model allows the runtime
buffer allocations to be unblocked for MM access in DXE and allocating
in DXE did not cause RT buffer fragmentation in the memory map to
better accommodate hibernate resume.

With PEI memory buckets added to Project Mu beginning with the 2511
branch, the upstream flow to allocate the RT cache buffer in PEI can
be restored

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
…lloc failure"

This reverts commit c8e592b.

---

Commit 3 of 4 for "Remove MU RT cache buffer allocation changes"

"Remove MU RT cache buffer allocation changes" series objective:

Project Mu had changes to move UEFI variable runtime cache allocation
to DXE instead of PEI. The Project Mu MM model allows the runtime
buffer allocations to be unblocked for MM access in DXE and allocating
in DXE did not cause RT buffer fragmentation in the memory map to
better accommodate hibernate resume.

With PEI memory buckets added to Project Mu beginning with the 2511
branch, the upstream flow to allocate the RT cache buffer in PEI can
be restored

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
This reverts commit db8ffad.

---

Commit 4 of 4 for "Remove MU RT cache buffer allocation changes"

"Remove MU RT cache buffer allocation changes" series objective:

Project Mu had changes to move UEFI variable runtime cache allocation
to DXE instead of PEI. The Project Mu MM model allows the runtime
buffer allocations to be unblocked for MM access in DXE and allocating
in DXE did not cause RT buffer fragmentation in the memory map to
better accommodate hibernate resume.

With PEI memory buckets added to Project Mu beginning with the 2511
branch, the upstream flow to allocate the RT cache buffer in PEI can
be restored

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
@makubacki makubacki requested review from kuqin12 and os-d April 29, 2026 17:57
@makubacki makubacki self-assigned this Apr 29, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (release/202511@3d43ac3). Learn more about missing BASE report.

Additional details and impacted files
@@                Coverage Diff                @@
##             release/202511    #1781   +/-   ##
=================================================
  Coverage                  ?    1.84%           
=================================================
  Files                     ?     1151           
  Lines                     ?   376517           
  Branches                  ?     3196           
=================================================
  Hits                      ?     6936           
  Misses                    ?   369525           
  Partials                  ?       56           
Flag Coverage Δ
FmpDevicePkg 9.53% <ø> (?)
MdeModulePkg 1.58% <ø> (?)
NetworkPkg 0.55% <ø> (?)
PolicyServicePkg 30.42% <ø> (?)
SecurityPkg 1.59% <ø> (?)
UefiCpuPkg 4.78% <ø> (?)
UnitTestFrameworkPkg 11.70% <ø> (?)

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.

@mu-automation
Copy link
Copy Markdown
Contributor

mu-automation Bot commented Apr 29, 2026

❌ QEMU Validation Failed

Source Dependencies

Repository Commit
mu_basecore 69c8699
mu_tiano_platforms a448318

Results

Platform Target Build Boot Overall Boot Time Build Logs Boot Logs
Q35 DEBUG ❌ failure ⏩ skipped N/A Build Logs N/A
SBSA DEBUG ✅ success ✅ success 0m 30s Build Logs Boot Logs

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

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

@makubacki makubacki added the impact:breaking-change Requires integration attention label Apr 29, 2026
@makubacki
Copy link
Copy Markdown
Member Author

Note: The Q35 build is expected to fail since this is a breaking change due to gEfiMdeModulePkgTokenSpaceGuid.PcdMigrateVariableRuntimeCacheBufferAllocation being removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:breaking-change Requires integration attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants