From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.52]) by mx.groups.io with SMTP id smtpd.web09.34783.1606135131509269687 for ; Mon, 23 Nov 2020 04:38:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=MlNUX7fl; spf=pass (domain: arm.com, ip: 40.107.8.52, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A6fprqJqs8735R3F7UnunMb11oPaJMFEiucr9gzxjY8=; b=MlNUX7flOej9/AB/o5txzK5OwZWknxCCY9vn1+OAsdoOdFPn4nkGL5s9IaKWJqGJhUMqwgUPgo0IU++6BkB61TQu4Yjwb2kSpeXj0b6LnA/sM8kFjBC0akVyh9IYIKitcQuB+QsJHIPpFpPytNk53PT/I7kQsdXFKsbupX4KWU0= Received: from AM5PR1001CA0039.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:15::16) by AM0PR08MB4163.eurprd08.prod.outlook.com (2603:10a6:208:12e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.21; Mon, 23 Nov 2020 12:38:48 +0000 Received: from AM5EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:15:cafe::c0) by AM5PR1001CA0039.outlook.office365.com (2603:10a6:206:15::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Mon, 23 Nov 2020 12:38:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT055.mail.protection.outlook.com (10.152.17.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Mon, 23 Nov 2020 12:38:46 +0000 Received: ("Tessian outbound fcd5bc555ddc:v71"); Mon, 23 Nov 2020 12:38:46 +0000 X-CR-MTA-TID: 64aa7808 Received: from ab7a387fad76.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8A31C859-2702-4E75-9E1B-9F4992DC5FD1.1; Mon, 23 Nov 2020 12:38:41 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ab7a387fad76.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 23 Nov 2020 12:38:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fWK3CUJ9ZlhTjgNchofaTbklAoPXaVupZleQ94wYkOYm4Iz+0F+d2ZZ8CxIcoP0LpNBhiqgP8IoFrCdNr/KaorUZNjZsJFvXWu2+kkv5JKWeiKdTdg9wLkbfVygAR8HnztTGadDPmWGuYDHec6StrNj94v95odPwy6lrPfSZxcqP75c292Qy8aFpRkh3RIZo5X+W8jZvTzSNaCrnpe+8HCg8bt9Ubth9ToP/5LHv41vyQYiyIM+k5VBWFE6nfKHr8PueAzWXenH3uTTMT0dRZqgQAmrw+P6yvEdzEQKPeOPzV45QTCRCW5qFlSit0PNcu1sEUoN/0wQPlIj9k/iGbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A6fprqJqs8735R3F7UnunMb11oPaJMFEiucr9gzxjY8=; b=JAF5MwGK7HHYujiuG3GpCmzxVHcCKCA3DE1puFqt/NVYZ43qhwkqyehl08CJaKoWc+WUXFbb630+z3BmM6egX4vUG3N+pmeXCcYZp0yPUbY1OqJsZf05vT1C5iEPqrn4hwy0Oxfb3Va/weJk9FJ9cVjzqe/v0+qVkHv2cJNZNsY7OU8JXYRfygU8UeFJjIySWplte2vaG9H+VFcoHa17bcob9iI/X7eVBeJ3z96B5kFPMT0zAgyQUtJfj4MzH4D9hDig3wr3aaSqLHictDcCMrEjo/MXx9kpKH9jMaa33G7de4G+xyTQT1KG6bTkRJwYPQUeDYhr7iH5brC78718Ow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A6fprqJqs8735R3F7UnunMb11oPaJMFEiucr9gzxjY8=; b=MlNUX7flOej9/AB/o5txzK5OwZWknxCCY9vn1+OAsdoOdFPn4nkGL5s9IaKWJqGJhUMqwgUPgo0IU++6BkB61TQu4Yjwb2kSpeXj0b6LnA/sM8kFjBC0akVyh9IYIKitcQuB+QsJHIPpFpPytNk53PT/I7kQsdXFKsbupX4KWU0= Received: from DB7PR08MB3097.eurprd08.prod.outlook.com (2603:10a6:5:1d::27) by DB8PR08MB3979.eurprd08.prod.outlook.com (2603:10a6:10:a5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.28; Mon, 23 Nov 2020 12:38:40 +0000 Received: from DB7PR08MB3097.eurprd08.prod.outlook.com ([fe80::315c:f6c3:2600:bd39]) by DB7PR08MB3097.eurprd08.prod.outlook.com ([fe80::315c:f6c3:2600:bd39%6]) with mapi id 15.20.3589.030; Mon, 23 Nov 2020 12:38:40 +0000 From: "Sami Mujawar" To: Sughosh Ganu , "devel@edk2.groups.io" CC: Ard Biesheuvel , Jiewen Yao , Achin Gupta , nd Subject: Re: [PATCH v1 07/12] StandaloneMmPkg: Add option to use FF-A calls for communication with SPM Thread-Topic: [PATCH v1 07/12] StandaloneMmPkg: Add option to use FF-A calls for communication with SPM Thread-Index: AQHWp54SPbyQLp4saE+gwZySVDHzJqnBaOyw Date: Mon, 23 Nov 2020 12:38:40 +0000 Message-ID: References: <20201021113233.25548-1-sughosh.ganu@linaro.org> <20201021113233.25548-8-sughosh.ganu@linaro.org> In-Reply-To: <20201021113233.25548-8-sughosh.ganu@linaro.org> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 71802A906F8B3440B103F18FC70FD3C2.0 x-checkrecipientchecked: true Authentication-Results-Original: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=arm.com; x-originating-ip: [2a00:23c6:548a:4800:e1e2:5e02:5cb9:6f61] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2cda5009-fe79-4096-996a-08d88facb8c2 x-ms-traffictypediagnostic: DB8PR08MB3979:|AM0PR08MB4163: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:10000;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 7gGwNt4+lmv/1a6MSGaUIJ7EZIMzFCD0Rv79otEL17T6yAt15P5FviXf202sfBPFSLG+1xoIB8yR1iaqnARHnSKniYMJQjPz+o84KVgu47PgyxEnfSRw4xRiyvZ6Bzg9kvTgNDjumBvA85ENg93tAsdd3dt/aXmzBj7dEMs6IEDEr/3xVEhDM8mo0d/V+XQv2fn+pfPSg8xLpwhNWwNht0pm7tFI2xud69s+lKFonhIG9ygLOm1a7/d1E7z9daklqiRLeCZ/vD2bWB7bSS8J5obZ4flrg3ZNvTDavxX51cCQdDB91wuzNPvh3REgVrd9TmGO4KiH3sLQlCUh67PFwYPQS0fYYhYAKTfCW5tPmWQUUeS4JNMYaOAXV4Sz2lvznmQG/HeUnLXj+AuoqfMJNQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR08MB3097.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(4636009)(366004)(396003)(346002)(39860400002)(136003)(376002)(86362001)(110136005)(83380400001)(9686003)(55016002)(316002)(5660300002)(966005)(54906003)(33656002)(8676002)(66946007)(76116006)(4326008)(19627235002)(66556008)(8936002)(66476007)(52536014)(66446008)(2906002)(6506007)(478600001)(64756008)(7696005)(53546011)(71200400001)(186003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?x/j0GwiXW0rGS+kfvrKFRgTV7iPVxegkdWSQ66Am+h1AW0k/b350s6S721Cj?= =?us-ascii?Q?LNJxcozR/Ca4AytFqA4UTYpxQmRyGZlqe7JpIJiQwRmwvCEYXh35GQMdMvaj?= =?us-ascii?Q?fvuwIKlMZKKuJixcCVZFTfFBdOw8WQ5And6FNNM7M/FZvNbH3QLd88ZSaJgO?= =?us-ascii?Q?armWRUHE2dHlwYPWYh8gmmVcR4WmYu5FbL8M9aWRncRkMmQWUN1CMhXX7YXJ?= =?us-ascii?Q?vIi1vmBteXwtG+vqLsOeOrwFTyK2AYWN0VHDEHWSNDAPQZ81lNRGlNPmjy/J?= =?us-ascii?Q?yT5UW1gDBvn6/RKwesXSLKSv8aNkXjQurwEHbEgv3LvMgkeN9qidfnoTV9zZ?= =?us-ascii?Q?M4024wAAh4fcHPVKe8zOhW+olJQqLxbjPO8QzisFN3LqWU/sK56p7tvTUJAl?= =?us-ascii?Q?HW/TIlP6KiTBHdD20D6Wo7gbbu7MoEoqVDfeZuZPZbAZ3YCZEb6t3s5PNhN+?= =?us-ascii?Q?z1prgm19Z6KBCMrhF+GNDGYP45Ro4oD5kFxhceBj7rRO3do8rSrZazo5Htb0?= =?us-ascii?Q?M0aLQH6YPtPi5hZqEdk//hWVCVL14p+Ht0rm9+oT2XJEK/bAlaFbYlD/3eas?= =?us-ascii?Q?q2biGRn7a6R3u1hlYVkKSsaDgIxvf+y7IowBLNp6sR36X5CNcRhYmXwQ8Y0k?= =?us-ascii?Q?1jrYm8U/7yFRa/NqxfWvMY9J0PAkTybhIi5g6OWacAC8YzvDABKVNE7fxOrA?= =?us-ascii?Q?UrsvzSRf5IEwXhvdBeNGAy023C9D4iNI9TGtih7Qkmvc5mHNTSsNI6zE50xW?= =?us-ascii?Q?LcQ923QUsCwUYftZGKvxWRfhh90zVYAJExAcru/lkpZ4qNIEdj7jfTYUjdFo?= =?us-ascii?Q?gnVPCnWTrc3cvaomPJB/ka5CJPJRbW88aAwoEHrTC2H226p4nid8jPzt16cy?= =?us-ascii?Q?awlY/VDmmeKjSOPRDtr7Ml1NXAnccouRUEdkyhlv3mkeBSN1BJqqEbkK5/0j?= =?us-ascii?Q?gOreZsSIPybRDGy56Q38QA=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB3979 Original-Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: d47e1892-9830-4773-4fc2-08d88facb4e3 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5X8n46ZJ+5+4MIpP7tcB+LXlqEyaocoBgMnMfKnMuF5+0ae5dda6oXjLUmNz+NaqeQHOpJhWGV+oIZctKW6EB8nvCFm4XKqM1HqMvTckgF/flpq3vEBH6/p6521ADfgRLqrfeg1vXWGXJUovJcdDjngZBMcDgRYXuSWBeAMFxRxacLrarvr/woi0xykZAlgVnWgzeYLSrmwRYIIk5DR7Vbxl1lmHveqCWN5W8CLw7wR8Wl50nClxDMpgWRLXbyA/I81rt/Ss/HYWugR1cljt1APiWhxialAQSWpKYl40EJs/JsbV8kDQh7QOaIMsjLh+dZCj7vWzsfgDsf/hSIGlVW538aG8IIYV1uC5HObyXSSH8QUa1iF4/ByUb3nA3xtnOMOK6g+baR+FHDkd7XgEE/NcAF9gvSG57ATOxcfL8FsGtPU7bXRmSBm6IF8nEArCBcbcKtXwBYLq8IMrkRqNjOSfPfT7TJ+dFSzcVJZHZPw= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(6029001)(4636009)(346002)(39860400002)(136003)(376002)(396003)(46966005)(5660300002)(81166007)(8676002)(7696005)(6506007)(82740400003)(33656002)(36906005)(4326008)(478600001)(356005)(47076004)(966005)(86362001)(83380400001)(54906003)(82310400003)(110136005)(55016002)(186003)(9686003)(26005)(316002)(2906002)(70206006)(8936002)(70586007)(336012)(52536014)(19627235002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2020 12:38:46.9063 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2cda5009-fe79-4096-996a-08d88facb8c2 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4163 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Sughosh, Please find my response inline marked [SAMI]. Regards, Sami Mujawar -----Original Message----- From: Sughosh Ganu =20 Sent: 21 October 2020 12:32 PM To: mailto:devel@edk2.groups.io Cc: Ard Biesheuvel ; Sami Mujawar ; Jiewen Yao ; Achin Gupta = Subject: [PATCH v1 07/12] StandaloneMmPkg: Add option to use FF-A calls for= communication with SPM From: Achin Gupta Add support for reporting completion of a MM request using either the Firmware Framework(FF-A) ABI transport or through the earlier used SVC calls. Signed-off-by: Achin Gupta Co-developed-by: Sughosh Ganu --- StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCor= eEntryPoint.c | 68 ++++++++++++++++---- 1 file changed, 54 insertions(+), 14 deletions(-) diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Sta= ndaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPo= int/AArch64/StandaloneMmCoreEntryPoint.c index 7d1e3c4d7c..06a8f487f9 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Standalone= MmCoreEntryPoint.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Standalone= MmCoreEntryPoint.c @@ -112,6 +112,7 @@ DelegatedEventLoop ( IN ARM_SVC_ARGS *EventCompleteSvcArgs ) { + BOOLEAN FfaEnabled; EFI_STATUS Status; UINTN SvcStatus; =20 @@ -123,16 +124,32 @@ DelegatedEventLoop ( DEBUG ((DEBUG_INFO, "X1 : 0x%x\n", (UINT32) EventCompleteSvcArgs->Arg= 1)); DEBUG ((DEBUG_INFO, "X2 : 0x%x\n", (UINT32) EventCompleteSvcArgs->Arg= 2)); DEBUG ((DEBUG_INFO, "X3 : 0x%x\n", (UINT32) EventCompleteSvcArgs->Arg= 3)); - - Status =3D 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)); + DEBUG ((DEBUG_INFO, "X4 : 0x%x\n", (UINT32) EventCompleteSvcArgs->Arg= 4)); + DEBUG ((DEBUG_INFO, "X5 : 0x%x\n", (UINT32) EventCompleteSvcArgs->Arg= 5)); + DEBUG ((DEBUG_INFO, "X6 : 0x%x\n", (UINT32) EventCompleteSvcArgs->Arg= 6)); + DEBUG ((DEBUG_INFO, "X7 : 0x%x\n", (UINT32) EventCompleteSvcArgs->Arg= 7)); + + FfaEnabled =3D FeaturePcdGet (PcdFfaEnable); + if (FfaEnabled) { + Status =3D 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)); [SAMI] Please align as suggested in the coding guide,=20 see https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/5_= source_files/52_spacing#5-2-2-4-subsequent-lines-of-multi-line-function-cal= ls-should-line-up-two-spaces-from-the-beginning-of-the-function-name [/SAMI] + } + } else { + Status =3D 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)); [SAMI] Please align as suggested in the coding guide. [/SAMI] + } } =20 switch (Status) { @@ -156,8 +173,16 @@ DelegatedEventLoop ( break; } =20 - EventCompleteSvcArgs->Arg0 =3D ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; - EventCompleteSvcArgs->Arg1 =3D SvcStatus; + if (FfaEnabled) { + EventCompleteSvcArgs->Arg0 =3D ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_A= ARCH64; + EventCompleteSvcArgs->Arg1 =3D 0; + EventCompleteSvcArgs->Arg2 =3D 0; + EventCompleteSvcArgs->Arg3 =3D ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; + EventCompleteSvcArgs->Arg4 =3D SvcStatus; + } else { + EventCompleteSvcArgs->Arg0 =3D ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; + EventCompleteSvcArgs->Arg1 =3D SvcStatus; + } } } =20 @@ -216,6 +241,22 @@ GetSpmVersion (VOID) return Status; } =20 +STATIC +VOID +InitArmSvcArgs (ARM_SVC_ARGS *InitMmFoundationSvcArgs, EFI_STATUS *Status) [SAMI] Please follow coding guidelines for function definition and document= ation. Ref: https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/5= _source_files/57_c_programming#5-7-1-function-definition-layout=20 [/SAMI] +{ + if (FeaturePcdGet (PcdFfaEnable)) { + InitMmFoundationSvcArgs->Arg0 =3D ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_= AARCH64; + InitMmFoundationSvcArgs->Arg1 =3D 0; + InitMmFoundationSvcArgs->Arg2 =3D 0; + InitMmFoundationSvcArgs->Arg3 =3D ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64= ; + InitMmFoundationSvcArgs->Arg4 =3D *Status; + } else { + InitMmFoundationSvcArgs->Arg0 =3D ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64= ; + InitMmFoundationSvcArgs->Arg1 =3D *Status; [SAMI] The 'Event Status code' is a 32-bit value, see https://trustedfirmwa= re-a.readthedocs.io/en/latest/components/secure-partition-manager-mm.html#m= m-sp-event-complete-aarch64 When this code is compiled for AARCH64, EFI_STATUS is 64-Bit value. In case= of an error the status code will have the bit 63 set, see definition for m= acro ENCODE_ERROR().=20 This would mean a 32-bit positive value would be returned in an error condi= tion, right?=20 [/SAMI] + } +} + /** The entry point of Standalone MM Foundation. =20 @@ -329,7 +370,6 @@ _ModuleEntryPoint ( =20 finish: ZeroMem (&InitMmFoundationSvcArgs, sizeof(InitMmFoundationSvcArgs)); - InitMmFoundationSvcArgs.Arg0 =3D ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; - InitMmFoundationSvcArgs.Arg1 =3D Status; + InitArmSvcArgs(&InitMmFoundationSvcArgs, &Status); [SAMI] Space needed between function name and starting parentheses. Ref: https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/5= _source_files/52_spacing#5-2-2-6-always-put-space-before-an-open-parenthesi= s [/SAMI]=20 DelegatedEventLoop (&InitMmFoundationSvcArgs); } --=20 2.17.1