Skip to content

Conversation

@LeviYeoReum
Copy link
Contributor

@LeviYeoReum LeviYeoReum commented Aug 16, 2025

This patch adds ArmFfaLibPartitionInfoGetRegs() in ArmFfaLib
As ArmFfaLibPartitionInfoGetRegs() is added, Normal world ArmFfLib Rx/Tx buffer is not a madatory.
That's why return EFI_UNSUPPORTED while Rx/Tx buffer mapping in ArmFfaLib constructor
can be consider as valid return If ARM_FFA_PARTITION_INFO_GET_REGS is supported by SPMC.

Patch #1 adds ArmFfaLibPartitionInfoGetRegs()
Patch #2 considers EFI_UNSUPPORTED while Rx/Tx buffer mapping in constrcutor as valid return
Patch #3 add helper function named ArmFfaLibGetPartitionInfo().
Patch #4-#6 applies ArmFfaLibGetPartitionInfo() in each modules.

Signed-off-by: Yeoreum Yun [email protected]

@tianocore-assign-reviewers
Copy link

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

@LeviYeoReum LeviYeoReum requested a review from kuqin12 August 19, 2025 07:05
@LeviYeoReum LeviYeoReum force-pushed the ffa_gert_part_info_regs branch from 4493e1e to 9617e3a Compare September 1, 2025 10:55
@LeviYeoReum LeviYeoReum force-pushed the ffa_gert_part_info_regs branch 2 times, most recently from 78d68cb to 849508f Compare September 8, 2025 08:59
@LeviYeoReum LeviYeoReum requested a review from kuqin12 September 8, 2025 09:00
@LeviYeoReum LeviYeoReum force-pushed the ffa_gert_part_info_regs branch 2 times, most recently from eb86761 to 54e7417 Compare September 9, 2025 07:20
@LeviYeoReum LeviYeoReum force-pushed the ffa_gert_part_info_regs branch from 54e7417 to 5c0be4d Compare September 9, 2025 07:33
@kuqin12
Copy link
Contributor

kuqin12 commented Sep 16, 2025

Not entirely related to this PR, but I was thinking about the usage of this library earlier. And it seems that the main churn for this library class comes from the Rx/Tx buffer, i.e. whether is supported, whether we have it in the right environment, whether we can have the correct framework to support the memory allocation, whether we need to unregister it when handing off to the OS, etc..

I would think for a large collection of basic FFA functionalities, it is really monitor calls + interpretation. We probably can keep it simple, then we can use it anywhere, link to all modules. But for Tx/Rx, which is like a global, and will need memory usage, and pass on the information of those buffers, it might be better to be handled separately.

TL;DR
Would it make better sense to create a Rx/Tx buffer library to specifically support RXTX_ related function IDs? To take one step further, would it be necessary to control the framework related information (Rx/Tx location, discovered Partition Info, etc.) through protocol/PPI in a module (i.e. PEI, DXE, STMM, etc.)

@LeviYeoReum
Copy link
Contributor Author

Hmm. I'm not sure about "How to gather Rx/Tx related API". In case of GetPartitionInfo ABI, yes that's clear but What about direct message kind of API? Actaully these kind of API can be differ from the platform even the services whether it uses Rx/Tx buffer together or not. That's why at the first time, It seems too much to have separate library for Rx/Tx buffer I've separated it just with file.
Well. If there'll be addition of ABI in FF-A using Rx/Tx buffer (not related MEMORY management), it seems meaningful to have separation However, I don't think it's valuable to have it now.
Thanks.

Your response essentially means we can already do the separation :)

The implicit usage of Rx/Tx will still need to get Rx/Tx buffer information, which I think better fits into its own component. Whether that component is a set of modules (PEIM/DXE driver/Stmm) or a set of libraries for different phases, that is debatable.

I will not derail this PR further. But I might take a crack at it to see how much effort we will need to get that separated.

Well. I'll also take a time to think about it more (perhaps with Library? since for use in SEC phase too?)
Thanks to point this!

@LeviYeoReum LeviYeoReum requested a review from vishalo September 16, 2025 19:54
@LeviYeoReum LeviYeoReum force-pushed the ffa_gert_part_info_regs branch 2 times, most recently from d5a764c to 4ffbb66 Compare September 17, 2025 19:29
@LeviYeoReum
Copy link
Contributor Author

@samimujawar and @kuqin12.

If you don't have anymore comment, Could you review and merge this patch series?

Thanks

@LeviYeoReum LeviYeoReum force-pushed the ffa_gert_part_info_regs branch from 4ffbb66 to a16a11f Compare October 8, 2025 07:39
@LeviYeoReum LeviYeoReum force-pushed the ffa_gert_part_info_regs branch 5 times, most recently from e4fa3da to 208279d Compare October 14, 2025 19:24
@LeviYeoReum LeviYeoReum force-pushed the ffa_gert_part_info_regs branch from 208279d to 5616e5d Compare October 24, 2025 06:34
@LeviYeoReum LeviYeoReum force-pushed the ffa_gert_part_info_regs branch 2 times, most recently from 3e5ac7f to 8eabf00 Compare October 30, 2025 17:34
Starting from FF-A v1.2 [0], the FFA_PARTITION_INFO_GET_REGS
interface was added to retrieve partition information
through registers.

This ABI is useful in environments where the Rx/Tx buffer
does not need to be mapped, or where buffer mapping
is not supported for retrieving partition information.

To support this, two new APIs are introduced:
ArmFfaLibPartitionInfoGetRegs() and ArmFfaLibPartitionCountGetRegs().

Link: https://developer.arm.com/documentation/den0077/latest [0]
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Yeoreum Yun <[email protected]>
In the normal world, it is possible to communicate with
a secure partition using the ARM_FFA_PARTITION_INFO_GET_REGS ABI,
even when the Rx/Tx buffer ABI is not supported.

Therefore, treat the EFI_UNSUPPORTED error returned
during Rx/Tx buffer mapping as a valid result
when the ARM_FFA_PARTITION_INFO_GET_REGS ABI is supported.

Signed-off-by: Yeoreum Yun <[email protected]>
Most of platform doesn't have multi partitons realted with on
service guid that's why it's enough to use the first partition info.

Introduce ArmFfaGetPartitionInfo() which gets first partition info
related with service guid. so that let's remove some duplicate code
to get partition id.

Signed-off-by: Yeoreum Yun <[email protected]>
Continuous-integration-options: PatchCheck.ignore-multi-package
Use ArmFfaGetPartitionInfo() to get partition information.
This simplifies the code to get partition information.

Signed-off-by: Yeoreum Yun <[email protected]>
Use ArmFfaGetPartitionInfo() in Tpm2ServiceFfaLib.
This simplifies the code line to get partition information.

Signed-off-by: Yeoreum Yun <[email protected]>
…Peim

Use ArmFfaGetPartitionInfo() in Tcg2ConfigFfaPeim.
This simplifies the code line to get partition information.

Signed-off-by: Yeoreum Yun <[email protected]>
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.

6 participants