From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.1240.1689086247507308090 for ; Tue, 11 Jul 2023 07:37:27 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: nishant.sharma@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6DECF2F4; Tue, 11 Jul 2023 07:38:09 -0700 (PDT) Received: from usa.arm.com (iss-desktop02.cambridge.arm.com [10.1.196.79]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5082E3F740; Tue, 11 Jul 2023 07:37:26 -0700 (PDT) From: "Nishant Sharma" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar , Thomas Abraham , Sayanta Pattanayak , Achin Gupta Subject: [edk2-platforms][PATCH V1 12/20] StandaloneMmPkg: Add global check for FF-A abis Date: Tue, 11 Jul 2023 15:36:50 +0100 Message-Id: <20230711143658.781597-13-nishant.sharma@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230711143658.781597-1-nishant.sharma@arm.com> References: <20230711143658.781597-1-nishant.sharma@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Achin Gupta This patch copies the value of the corresponding stack variable to a glob= al variable so that it can be used to determine whether FF-A v1.1 or earlier ABIs should be used for communication with the SPMC. Signed-off-by: Achin Gupta Signed-off-by: Nishant Sharma --- StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreE= ntryPoint.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/Stand= aloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPo= int/Arm/StandaloneMmCoreEntryPoint.c index 8131b1984969..a763bf8509b2 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMm= CoreEntryPoint.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMm= CoreEntryPoint.c @@ -42,6 +42,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define FFA_PAGE_16K 1 #define FFA_PAGE_64K 2 =20 +// Local variable to help Standalone MM Core decide whether FF-A ABIs ca= n be +// used for all communication. This variable is usable only after the St= MM image +// has been relocated and all image section permissions have been correc= tly +// updated. +STATIC BOOLEAN mUseOnlyFfaAbis =3D FALSE; + PI_MM_ARM_TF_CPU_DRIVER_ENTRYPOINT CpuDriverEntryPoint =3D NULL; =20 /** @@ -639,6 +645,13 @@ InitArmSvcArgs ( ) { if (FixedPcdGet32 (PcdFfaEnable) !=3D 0) { + + // With FF-A v1.1 invoke FFA_MSG_WAIT to signal completion of SP ini= t. + if (mUseOnlyFfaAbis) { + InitMmFoundationSvcArgs->Arg0 =3D ARM_SVC_ID_FFA_MSG_WAIT_AARCH32; + return; + } + InitMmFoundationSvcArgs->Arg0 =3D ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RES= P; InitMmFoundationSvcArgs->Arg1 =3D 0; InitMmFoundationSvcArgs->Arg2 =3D 0; @@ -820,6 +833,9 @@ ModuleEntryPoint ( ASSERT_EFI_ERROR (Status); } =20 + // Update the global copy now that the image has been relocated. + mUseOnlyFfaAbis =3D UseOnlyFfaAbis; + // // Create Hoblist based upon boot information passed by privileged sof= tware // --=20 2.34.1