Skip to content

Commit

Permalink
ArmPkg: ArmStandaloneMmCoreEntryPoint: Support 18 register DIRECT_REQ2
Browse files Browse the repository at this point in the history
This change added the support for using 18 registers when FF-A
DIRECT_REQ2 is used to communicate with MM core.

This change was tested on QEMU SBSA and booted to Windows.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
  • Loading branch information
kuqin12 committed Feb 26, 2025
1 parent 048c463 commit a6e25dd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,20 @@ SetEventCompleteSvcArgs (
EventCompleteSvcArgs->Arg5 = mMiscMmCommunicateBuffer->DirectMsgArgs.Arg1;
EventCompleteSvcArgs->Arg6 = mMiscMmCommunicateBuffer->DirectMsgArgs.Arg2;
EventCompleteSvcArgs->Arg7 = mMiscMmCommunicateBuffer->DirectMsgArgs.Arg3;
// MU_CHANGE Starts: Add 18 register support
if (FixedPcdGetBool (PcdSxcUse18Registers)) {
EventCompleteSvcArgs->Arg8 = mMiscMmCommunicateBuffer->DirectMsgArgs.Arg4;
EventCompleteSvcArgs->Arg9 = mMiscMmCommunicateBuffer->DirectMsgArgs.Arg5;
EventCompleteSvcArgs->Arg10 = mMiscMmCommunicateBuffer->DirectMsgArgs.Arg6;
EventCompleteSvcArgs->Arg11 = mMiscMmCommunicateBuffer->DirectMsgArgs.Arg7;
EventCompleteSvcArgs->Arg12 = mMiscMmCommunicateBuffer->DirectMsgArgs.Arg8;
EventCompleteSvcArgs->Arg13 = mMiscMmCommunicateBuffer->DirectMsgArgs.Arg9;
EventCompleteSvcArgs->Arg14 = mMiscMmCommunicateBuffer->DirectMsgArgs.Arg10;
EventCompleteSvcArgs->Arg15 = mMiscMmCommunicateBuffer->DirectMsgArgs.Arg11;
EventCompleteSvcArgs->Arg16 = mMiscMmCommunicateBuffer->DirectMsgArgs.Arg12;
EventCompleteSvcArgs->Arg17 = mMiscMmCommunicateBuffer->DirectMsgArgs.Arg13;
}
// MU_CHANGE Ends
}
}

Expand Down Expand Up @@ -772,6 +786,21 @@ InitializeMiscMmCommunicateBuffer (
Buffer->DirectMsgArgs.Arg1 = EventSvcArgs->Arg5;
Buffer->DirectMsgArgs.Arg2 = EventSvcArgs->Arg6;
Buffer->DirectMsgArgs.Arg3 = EventSvcArgs->Arg7;
// MU_CHANGE Starts: Add 18 register support
if (FixedPcdGetBool (PcdSxcUse18Registers)) {
Buffer->DirectMsgArgs.Arg4 = EventSvcArgs->Arg8;
Buffer->DirectMsgArgs.Arg5 = EventSvcArgs->Arg9;
Buffer->DirectMsgArgs.Arg6 = EventSvcArgs->Arg10;
Buffer->DirectMsgArgs.Arg7 = EventSvcArgs->Arg11;
Buffer->DirectMsgArgs.Arg8 = EventSvcArgs->Arg12;
Buffer->DirectMsgArgs.Arg9 = EventSvcArgs->Arg13;
Buffer->DirectMsgArgs.Arg10 = EventSvcArgs->Arg14;
Buffer->DirectMsgArgs.Arg11 = EventSvcArgs->Arg15;
Buffer->DirectMsgArgs.Arg12 = EventSvcArgs->Arg16;
Buffer->DirectMsgArgs.Arg13 = EventSvcArgs->Arg17;
}
// MU_CHANGE Ends

CopyGuid (&Buffer->HeaderGuid, ServiceGuid);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
[Pcd]
gArmTokenSpaceGuid.PcdStMmStackSize

[FixedPcd]
gArmTokenSpaceGuid.PcdSxcUse18Registers # MU_CHANGE: Add 18 registers support

#
# This configuration fails for CLANGPDB, which does not support PIE in the GCC
# sense. Such however is required for ARM family StandaloneMmCore
Expand Down

0 comments on commit a6e25dd

Please sign in to comment.