diff options
| author | Mingjie Shen <shen497@purdue.edu> | 2026-05-06 23:15:46 +0000 |
|---|---|---|
| committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2026-07-08 09:17:17 +0000 |
| commit | 2cfd432ac92f58a14331fec2d2b885c795f684db (patch) | |
| tree | 50bb0fa242a6c0ca876f8e275227faf26ab8abe6 /OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.uni | |
| parent | b38d9eb7c6299d1bbb46773d261452a11427505b (diff) | |
| download | edk2-master.tar.gz edk2-master.zip | |
ArmFfaLibGetPartitionInfo() helper replaces the manual partition info
lookup sequence used by FF-A clients:
* ArmFfaLibPartitionIdGet()
* ArmFfaLibGetRxTxBuffers()
* ArmFfaLibPartitionInfoGet(..., FFA_PART_INFO_FLAG_TYPE_DESC, ...)
* copy EFI_FFA_PART_INFO_DESC from the RX buffer
* ArmFfaLibRxRelease()
The collateral evolutions in b80000847a and 96ad9bd397 use the
helper as the owner of that sequence. Their callers only consume the
copied partition descriptor and do not keep a local partition ID solely for
RX buffer release.
Commit 8955d8db32 converted MmCommunication to call
ArmFfaLibGetPartitionInfo(), but kept caller-side partition ID state
and, in PEI, still released the RX buffer after the helper returned.
That made the ArmPkg conversion inconsistent with b80000847a and
96ad9bd397, and inconsistent with the helper ownership model. In the
ArmFfaLibPartitionInfoGetRegs path, there is no RX buffer to release,
while in the RX/TX buffer path, the buffer is already released inside
ArmFfaLibGetPartitionInfo().
This patch removes the stale local mPartId state and the remaining
caller-side ArmFfaLibRxRelease() from the DXE and PEI MM communication
drivers. The callers now match the helper contract: get the descriptor,
validate DIRECT_MSG_REQ support, and store the StandaloneMM partition
ID.
The current version was generated by running the following Coccinelle
script on 8955d8db32^, then rebasing the resulting fixup to master.
``` smpl
@replace_old_sequence@
typedef EFI_STATUS;
identifier Fn;
identifier Info, Count, TxBuffer, TxBufferSize, RxBuffer, RxBufferSize;
identifier PartId, Status, Size;
expression Guid;
position p;
statement S1, S2;
type SizeArgT;
@@
EFI_STATUS Fn@p (...) {
...
- EFI_FFA_PART_INFO_DESC *Info;
+ EFI_FFA_PART_INFO_DESC Info;
...
- Status = ArmFfaLibPartitionIdGet (&PartId);
- if (EFI_ERROR (Status)) S1
...
- Status = ArmFfaLibGetRxTxBuffers (
- &TxBuffer,
- &TxBufferSize,
- &RxBuffer,
- &RxBufferSize
- );
- if (EFI_ERROR (Status)) S2
...
- Status = ArmFfaLibPartitionInfoGet (
- Guid,
- FFA_PART_INFO_FLAG_TYPE_DESC,
- &Count,
- (SizeArgT)&Size
- );
+ Status = ArmFfaLibGetPartitionInfo (Guid, &Info);
...
(
- if ((Count != 1) || (Size < sizeof (EFI_FFA_PART_INFO_DESC))) {
- ...
- } else {
- Info = (EFI_FFA_PART_INFO_DESC *)RxBuffer;
...
- }
|
- if ((Count != 1) || (Size < sizeof (EFI_FFA_PART_INFO_DESC))) {
- ...
- }
...
- Info = (EFI_FFA_PART_INFO_DESC *)RxBuffer;
)
...
- ArmFfaLibRxRelease (PartId);
...
}
@part_info_members depends on replace_old_sequence@
identifier replace_old_sequence.Info;
identifier Field =~ "^(PartitionId|PartitionProps)$";
@@
- Info->Field
+ Info.Field
@remove_old_variables depends on replace_old_sequence@
identifier replace_old_sequence.Count, replace_old_sequence.TxBuffer;
identifier replace_old_sequence.TxBufferSize, replace_old_sequence.RxBuffer, replace_old_sequence.RxBufferSize;
identifier replace_old_sequence.PartId;
identifier replace_old_sequence.Size;
type T;
@@
(
- T *TxBuffer;
|
- UINT64 TxBufferSize;
|
- T *RxBuffer;
|
- UINT64 RxBufferSize;
|
- UINT32 Count;
|
- UINT32 Size;
|
- UINT16 PartId;
|
- static UINT16 PartId;
)
```
Signed-off-by: Mingjie Shen <shen497@purdue.edu>
Diffstat (limited to 'OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.uni')
0 files changed, 0 insertions, 0 deletions
