Skip to content

[CHERRY-PICK][Rebase & FF] Pick up FMMT related fixes from edk2 - #2002

Merged
kuqin12 merged 3 commits into
microsoft:release/202608from
kuqin12:cp_fmmt
Oct 28, 2026
Merged

kuqin12 merged 3 commits into
microsoft:release/202608from
kuqin12:cp_fmmt

Conversation

@kuqin12

@kuqin12 kuqin12 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

This change cherry-picks 3 FMMT related commits from edk2 to better unblock the image patching.

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

How This Was Tested

This change resolves the hang when patching supervisor binaries into the UEFI image.

Integration Instructions

N/A

…peated replacement

Current `ReplaceFfs` reuses the parsed replacement FFS tree for every
matching target. However, `FvHandler` mutates the tree while attaching it
to a target, causing later replacements inherit state from an earlier
replaced instance and hang the process.

This change uses deep-copy of the replacement tree for each target to
avoid the failure case.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
(cherry picked from commit 26d6e1f5f26a7456f63011a3107d0ca577eed489)
Current FV resize routine assumes that the final child is always a free-
space node. However, when no such node exists, these routines can remove
or overwrite valid trailing FFS nodes. One replacement path also inserts
the free-space byte count instead of the constructed tree node.

This change centralizes free-space node creation, resizing, and removal,
using the helper for direct replacements and recursive parent resizing.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
(cherry picked from commit 68360d273c9788e75b9aca13f839563a5a6cb498)
@mu-automation

mu-automation Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

✅ QEMU Validation Passed

Source Dependencies

Repository Commit
mu_basecore 8c0fb11
mu_tiano_platforms 9a5b7f8

Results

Platform Target Build Boot Overall Boot Time Build Logs Boot Logs
Q35 DEBUG ✅ success ✅ success 0m 20s Build Logs Boot Logs
ArmVirt DEBUG ✅ success ✅ success 0m 18s Build Logs Boot Logs

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

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

This change adds a few unit test cases to validate the FMMT tool.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
(cherry picked from commit ef03ae623f254e4914e99df21220cb7a00c68f08)
@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@                Coverage Diff                @@
##             release/202608    #2002   +/-   ##
=================================================
  Coverage                  ?    1.90%           
=================================================
  Files                     ?     1675           
  Lines                     ?   423789           
  Branches                  ?     5224           
=================================================
  Hits                      ?     8083           
  Misses                    ?   415604           
  Partials                  ?      102           
Flag Coverage Δ
FmpDevicePkg 9.63% <ø> (?)
MdeModulePkg 1.00% <ø> (?)
MdePkg 5.44% <ø> (?)
NetworkPkg 0.66% <ø> (?)
PolicyServicePkg 30.42% <ø> (?)
SecurityPkg 1.55% <ø> (?)
StandaloneMmPkg 0.50% <ø> (?)
UefiCpuPkg 4.70% <ø> (?)
UnitTestFrameworkPkg 11.70% <ø> (?)

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

☔ View full report in Codecov by Harness.
📢 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.

@kuqin12
kuqin12 enabled auto-merge (rebase) October 28, 2026 21:49
@kuqin12
kuqin12 merged commit 42d6d88 into microsoft:release/202608 Oct 28, 2026
106 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