summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
diff options
context:
space:
mode:
Diffstat (limited to 'StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c')
-rw-r--r--StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c69
1 files changed, 41 insertions, 28 deletions
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
index 96de10405a..70306be249 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
@@ -15,6 +15,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Guid/MmramMemoryReserve.h>
#include <Guid/MpInformation.h>
+#include <StandaloneMmCpu.h>
#include <Library/ArmSvcLib.h>
#include <Library/DebugLib.h>
#include <Library/HobLib.h>
@@ -41,7 +42,7 @@ STATIC CONST UINT32 mSpmMinorVerFfa = SPM_MINOR_VERSION_FFA;
#define BOOT_PAYLOAD_VERSION 1
-PI_MM_ARM_TF_CPU_DRIVER_ENTRYPOINT CpuDriverEntryPoint = NULL;
+PI_MM_CPU_DRIVER_ENTRYPOINT CpuDriverEntryPoint = NULL;
/**
Retrieve a pointer to and print the boot information passed by privileged
@@ -140,34 +141,46 @@ DelegatedEventLoop (
DEBUG ((DEBUG_INFO, "X6 : 0x%x\n", (UINT32)EventCompleteSvcArgs->Arg6));
DEBUG ((DEBUG_INFO, "X7 : 0x%x\n", (UINT32)EventCompleteSvcArgs->Arg7));
- FfaEnabled = FeaturePcdGet (PcdFfaEnable);
- if (FfaEnabled) {
- Status = CpuDriverEntryPoint (
- EventCompleteSvcArgs->Arg0,
- EventCompleteSvcArgs->Arg6,
- EventCompleteSvcArgs->Arg3
- );
- if (EFI_ERROR (Status)) {
- DEBUG ((
- DEBUG_ERROR,
- "Failed delegated event 0x%x, Status 0x%x\n",
- EventCompleteSvcArgs->Arg3,
- Status
- ));
- }
+ //
+ // ARM TF passes SMC FID of the MM_COMMUNICATE interface as the Event ID upon
+ // receipt of a synchronous MM request. Use the Event ID to distinguish
+ // between synchronous and asynchronous events.
+ //
+ if ((ARM_SMC_ID_MM_COMMUNICATE != (UINT32)EventCompleteSvcArgs->Arg0) &&
+ (ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ != (UINT32)EventCompleteSvcArgs->Arg0))
+ {
+ DEBUG ((DEBUG_ERROR, "UnRecognized Event - 0x%x\n", (UINT32)EventCompleteSvcArgs->Arg0));
+ Status = EFI_INVALID_PARAMETER;
} else {
- Status = CpuDriverEntryPoint (
- EventCompleteSvcArgs->Arg0,
- EventCompleteSvcArgs->Arg3,
- EventCompleteSvcArgs->Arg1
- );
- if (EFI_ERROR (Status)) {
- DEBUG ((
- DEBUG_ERROR,
- "Failed delegated event 0x%x, Status 0x%x\n",
- EventCompleteSvcArgs->Arg0,
- Status
- ));
+ FfaEnabled = FeaturePcdGet (PcdFfaEnable);
+ if (FfaEnabled) {
+ Status = CpuDriverEntryPoint (
+ EventCompleteSvcArgs->Arg0,
+ EventCompleteSvcArgs->Arg6,
+ EventCompleteSvcArgs->Arg3
+ );
+ if (EFI_ERROR (Status)) {
+ DEBUG ((
+ DEBUG_ERROR,
+ "Failed delegated event 0x%x, Status 0x%x\n",
+ EventCompleteSvcArgs->Arg3,
+ Status
+ ));
+ }
+ } else {
+ Status = CpuDriverEntryPoint (
+ EventCompleteSvcArgs->Arg0,
+ EventCompleteSvcArgs->Arg3,
+ EventCompleteSvcArgs->Arg1
+ );
+ if (EFI_ERROR (Status)) {
+ DEBUG ((
+ DEBUG_ERROR,
+ "Failed delegated event 0x%x, Status 0x%x\n",
+ EventCompleteSvcArgs->Arg0,
+ Status
+ ));
+ }
}
}