Skip to content

MdeModulePkg, FmpDevicePkg: support runtime capsule update#12193

Open
LeviYeoReum wants to merge 6 commits intotianocore:masterfrom
LeviYeoReum:levi/2793_runtime_fmpdxe
Open

MdeModulePkg, FmpDevicePkg: support runtime capsule update#12193
LeviYeoReum wants to merge 6 commits intotianocore:masterfrom
LeviYeoReum:levi/2793_runtime_fmpdxe

Conversation

@LeviYeoReum
Copy link
Copy Markdown
Contributor

Description

This is runtime capsule update support with FmpDxeRuntime Driver.

Formerly, to update the firmware with capsule in FVP with fwupd, it follows below step:

Locate Capsule in specific location
reboot with DxeDriver to update firmware with capsule provided by fwupd.
Firmware Update Dxe driver calls ProcessFmpImage() and update firmware with Capsule
reboot to apply firmware.
These step requires 2 times of reboot -- first for update firmware and second to apply firmware.

With the runtime capsule update support, It could remove (2) and (3) steps.

  • Breaking change?
    • Breaking change - Does this PR cause a break in build or boot behavior?
    • Examples: Does it add a new library class or move a module to a different repo.
  • Impacts security?
    • Security - Does this PR have a direct security impact?
    • Examples: Crypto algorithm change or buffer overflow fix.
  • Includes tests?
    • Tests - Does this PR include any explicit test code?
    • Examples: Unit tests or integration tests.

How This Was Tested

In linux, tested with below command:

cat {CAPSULE} > /dev/efi_capsule_loader

Integration Instructions

N/A

Reference

Link: tianocore/edk2-platforms#944 [0]

@tianocore-assign-reviewers
Copy link
Copy Markdown

WARNING: Cannot add some reviewers: A user specified as a reviewer for this PR is not a collaborator of the repository. Please add them as a collaborator to the repository so they can be requested in the future.

Non-collaborators requested:

Attn Admins:


Admin Instructions:

  • Add the non-collaborators as collaborators to the appropriate team(s) listed in teams
  • If they are no longer needed as reviewers, remove them from Maintainers.txt

@mergify
Copy link
Copy Markdown

mergify Bot commented Feb 25, 2026

PR can not be merged due to conflict. Please rebase and resubmit

Comment thread SecurityPkg/Library/FmpAuthenticationLibPkcs7/FmpAuthenticationRuntimeLibPkcs7.c Dismissed
@LeviYeoReum LeviYeoReum force-pushed the levi/2793_runtime_fmpdxe branch from c0dba69 to 0999e35 Compare February 25, 2026 12:36
Not only BaseCryptoLib, FmpDxe needs dynamic memory allocation to
support runtime capsule update.

For this, make a RuntimeMemoryAllocationLib with
core implementation of
CryptoPkg/Library/BaseCryptLib/Syscall/RuntimeMemAllocation.c

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Former implementation of Runtime(Alloc/Free)Mem() is moved to
RuntimeMemoryAllocationLib in MdeModulePkg.

Apply RuntimeMemoryAllocationLib for RuntimeCryptLib.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
This patch supports FmpAuthenticationLibPkcs7 for
runtime capsule update with FmpDevicePkg.

For this, implements the wrapper function to allocate/free temporary buffer
used to verify pkcs7 signature and add FmpAuthenticationRuntimeLibPkcs7.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
To support runtime capsule update, add support FmpDxeRuntime.
For this, change dynamic allocation for get variable to use stack value
and add runtime supports.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
To support runtime capsule update, DxeCapsuleLibFmp should
manage the FmpDevice instance which updatable in runtime and
Need to another update function which doesn't use boot service memory.

This patch is modification to make DxeCapsuleLibFmp support
runtime capsule update.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
When runtime capsule update is supported, ESRT should be updated
at runtime and OS should observe changes of correspondant entry on ESRT
after it finishes to update.

For this, override the ESRT with runtime memory.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
@LeviYeoReum LeviYeoReum force-pushed the levi/2793_runtime_fmpdxe branch from 0999e35 to 5e56c88 Compare February 25, 2026 14:10
Copy link
Copy Markdown
Member

@spbrogan spbrogan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a massive change and adds a ton of complexity in really critical code. In many discussions across the industry, we have agreed that runtime capsules are not necessary and/or a bad idea.

  • The user experience is unacceptable bad from production scenarios.
  • Contention over hardware access is challenging (sharing between fw and os).
  • Runtime isn't an area of UEFI we want to see expanded and if anything, we would want to see reduced.
  • Runtime memory management and runtime crypto adds a lot of growth and bloat.
  • Runtime memory management is risky because FW is not in control of the system. "Heap management" may work but will likely add to ongoing issues around memory stability and hibernate/resume reliability.
  • Runtime crypto doesn't actually provide security value which is why isolation (secure world or smm) must be used.

Overall, I am opposed to this change and would either want to see a fully discussed RFC and/or edk2 community meetings to discuss this.

@makubacki
Copy link
Copy Markdown
Member

@LeviYeoReum, this is a large and impactful change. If you’d like to move forward with this change, please submit an RFC in accordance with the TianoCore RFC Process.

The RFC will allow you to clearly articulate the proposed feature, its rationale, and its potential impact, while giving stakeholders an opportunity to review and provide feedback. Once approved, the RFC can also serve as the reference documentation for your implementation PR and any related community discussions.

@github-actions
Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had activity in 60 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@github-actions github-actions Bot added the stale Due to lack of updates, this item is pending deletion. label Apr 26, 2026
@mergify
Copy link
Copy Markdown

mergify Bot commented Apr 26, 2026

PR can not be merged due to conflict. Please rebase and resubmit

@github-actions github-actions Bot removed the stale Due to lack of updates, this item is pending deletion. label Apr 27, 2026
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