Skip to content

Commit

Permalink
Change FF-A UUID manipulation method before sending to Hafnium (#343)
Browse files Browse the repository at this point in the history
## Description

There is a mismatch between the FF-A spec definition, UEFI definition
and the code implementation.

This UUID manipulation just changes the mangling method that matches the
FF-A UUID mangling method before ARM made it public. Because everybody
else is using this way...

For details on how to complete these options and their meaning refer to
[CONTRIBUTING.md](https://github.com/microsoft/mu/blob/HEAD/CONTRIBUTING.md).

- [x] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?
- [ ] Backport to release branch?

## How This Was Tested

This was tested on proprietary hardware and QEMU SBSA virtual platform.

## Integration Instructions

N/A

---------

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
  • Loading branch information
kuqin12 authored Feb 26, 2025
1 parent cf7b818 commit a544760
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ArmPkg/Library/ArmFfaLib/ArmFfaCommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,21 @@ ConvertEfiGuidToUuid (
UINT32 *Data32;
UINT16 *Data16;

// MU_CHANGE Starts: Update UUID mangling method
if ((Guid == NULL) || (Uuid == NULL)) {
return;
}
// MU_CHANGE Ends

CopyGuid ((EFI_GUID *)Uuid, Guid);
Data32 = (UINT32 *)Uuid;
Data32[0] = SwapBytes32 (Data32[0]);
Data32 = (UINT32 *)Uuid;
// Data32[0] = SwapBytes32 (Data32[0]); // MU_CHANGE Starts: Update UUID mangling method
Data16 = (UINT16 *)&Data32[1];
Data32[1] = SwapBytes32 (Data32[1]); // MU_CHANGE: Update UUID mangling method
Data16[0] = SwapBytes16 (Data16[0]);
Data16[1] = SwapBytes16 (Data16[1]);
Data32[2] = SwapBytes32 (Data32[2]); // MU_CHANGE: Update UUID mangling method
Data32[3] = SwapBytes32 (Data32[3]); // MU_CHANGE: Update UUID mangling method
}

/**
Expand Down

0 comments on commit a544760

Please sign in to comment.