Skip to content

[CHERRY-PICK][REBASE & FF][FF-A]Remove Globals from ArmFfaCommon#1683

Merged
Raymond-MS merged 6 commits intomicrosoft:release/202502from
Raymond-MS:personal/rdiaz/GlobalRemovalCherryPick
Mar 7, 2026
Merged

[CHERRY-PICK][REBASE & FF][FF-A]Remove Globals from ArmFfaCommon#1683
Raymond-MS merged 6 commits intomicrosoft:release/202502from
Raymond-MS:personal/rdiaz/GlobalRemovalCherryPick

Conversation

@Raymond-MS
Copy link
Copy Markdown
Contributor

Description

Added ArmFfaLibIsFfaSupported to ArmFfaCommon to allow for queries of FF-A support outside of ArmFfaCommonInit. Removed global variables in ArmFfaCommon. Moved the globals to locals in each phase's ArmFfaLib implementation. SEC and PEI will query when necessary to avoid setting globals when memory is unavailable. Removed the global variables in ArmFfaSecRxTxMap. Rx/Tx buffer HOB is now created within the Map function rather than in the constructor of ArmFfaSecLib. This allows for the use of the HOB to find the Rx/Tx buffer information. Add Unmap callback for when PEI and SEC need to invalidate the Rx/Tx buffer HOB on a call to Unmap.

For details on how to complete these options and their meaning refer to CONTRIBUTING.md.

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

How This Was Tested

Built and ran QEMU SBSA with TPM enabled. Verified TPM communication and boot to shell.

Integration Instructions

N/A

@Raymond-MS Raymond-MS requested review from cfernald and kuqin12 March 6, 2026 23:17
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 6, 2026

Codecov Report

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

Files with missing lines Patch % Lines
MdeModulePkg/Library/ArmFfaLib/ArmFfaSecRxTxMap.c 0.00% 35 Missing ⚠️
MdeModulePkg/Library/ArmFfaLib/ArmFfaPeiLib.c 0.00% 31 Missing ⚠️
MdeModulePkg/Library/ArmFfaLib/ArmFfaSecLib.c 0.00% 9 Missing ⚠️
MdeModulePkg/Library/ArmFfaLib/ArmFfaDxeLib.c 0.00% 7 Missing ⚠️
...odulePkg/Library/ArmFfaLib/ArmFfaStandaloneMmLib.c 0.00% 3 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##             release/202502    #1683   +/-   ##
=================================================
  Coverage                  ?    1.55%           
=================================================
  Files                     ?      636           
  Lines                     ?   234519           
  Branches                  ?      370           
=================================================
  Hits                      ?     3649           
  Misses                    ?   230857           
  Partials                  ?       13           
Flag Coverage Δ
MdeModulePkg 1.55% <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.

@apop5
Copy link
Copy Markdown
Collaborator

apop5 commented Mar 6, 2026

can you add [Cherry-Pick] to each of the commits that you are going to merge? It will make it easier in the next rebase to be able to drop the commits that are already upstreamed.

Added ArmFfaLibIsFfaSupported to ArmFfaCommon to allow for
queries of FF-A support outside of ArmFfaCommonInit.

Signed-off-by: Raymond Diaz <raymonddiaz@microsoft.com>
Removed global variables in ArmFfaCommon. Moved the globals to
locals in each phase's ArmFfaLib implementation. SEC and PEI
will query when necessary to avoid setting globals when memory
is unavailable.

Signed-off-by: Raymond Diaz <raymonddiaz@microsoft.com>
Removed the global variables in ArmFfaSecRxTxMap. Rx/Tx
buffer HOB is now created within the Map function rather
than in the constructor of ArmFfaSecLib. This allows for
the use of the HOB to find the Rx/Tx buffer information.

Signed-off-by: Raymond Diaz <raymonddiaz@microsoft.com>
…TxMap

Replaced all instances of PcdGet64 (PcdFfaTxRxPageCount) *
EFI_PAGE_SIZE, with EFI_PAGES_TO_SIZE macro.

Signed-off-by: Raymond Diaz <raymonddiaz@microsoft.com>
Cleaned various comments and debug messages as well as
headers to either fix typos or for readability.

Signed-off-by: Raymond Diaz <raymonddiaz@microsoft.com>
Add Unmap callback for when PEI and SEC need to invalidate the
Rx/Tx buffer HOB on a call to Unmap.

Signed-off-by: Raymond Diaz <raymonddiaz@microsoft.com>
@Raymond-MS Raymond-MS force-pushed the personal/rdiaz/GlobalRemovalCherryPick branch from fe876a9 to 92c3a85 Compare March 7, 2026 00:01
@Raymond-MS Raymond-MS merged commit 3a1e8e1 into microsoft:release/202502 Mar 7, 2026
30 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.

5 participants