From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.92.19.25]) by mx.groups.io with SMTP id smtpd.web10.1879.1689266911214355444 for ; Thu, 13 Jul 2023 09:48:31 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=Lfm7myCG; spf=pass (domain: outlook.com, ip: 40.92.19.25, mailfrom: chris.fernald@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jvvM6rKLosmuT5Ogk4a4t2ZlsNwOju4VFOIX3ey+H0PJcEMQOLZdResXAt4eLfZvwh+vq5tr6Y251527n60BVwXIbFHfC9BFEv9HI4UcOAuL9vTY9aSYmCGmaSHoNraHtYEOQBRqUUi1gobAFcfNZfP8V5VuztJGmMun0IQtH+kQ/va2AK+6Ehn5ht3x9RHO2oHB+d+AdH4UYv0MPuR2Md50PWC4Awmm6d6iBO+ka1RdEdMSH2voQSwoO48spVydAfk7xUmvQTZDVQQufv9os3cFsmi/1pfbHVB3JF6doX9yW+z4O0EjIBh4F3UEPioPEJONwzAXTa84rZVXx9bcew== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PJU5Y4x2NUd1LuyK9z5E626F5Gu8RegMDBRqF/qGlCY=; b=gGucBzdWyfLqJvpGAiLsHGmI8FIvyulKRrOTphYxqjVgHDFBIPieNTfQVL65X+JoxgX3Prd5IsMRm0yTCLaeMDLBFIsEa063UrbZSnTu5LHwrqCwkPigHJhbo+Y0pvcMo6Anpy55TKGj+5+ecgsGeKcw6uyxXXfVpkYb6gBb+bO6r9EpR+CBFz34SG+7uDYKVWjTxIukxvmVrEsb1gc/DlbeeOGKV1zuRRMVWZq4zQDNGs2kqVFOg3MIT+0PvnD4+6lNG7ClKFz/w30L4G/N65q7WnR+KmiDZeu6WGcezTdFnutbUhSV1k+71QbATYZX/DYYbFrRKMzKUasZ0RlJhg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PJU5Y4x2NUd1LuyK9z5E626F5Gu8RegMDBRqF/qGlCY=; b=Lfm7myCGVSXB+D6oqXRCo+scgnRc6XzcyZQpdweHsvONrpRGN7Tswvd1M1uaKHD/UmzQ/Smi9rT8ATL+oCWwlHFK3fLS1h+4nyXVKweaLVmBlNE0AK2xBd0ZHSOY5tr5OVCa0pzG54dmPreyT9/ZDtFZv+aE64GsOmlbQqtb3/prWbnDiUDpoJ8cz7J6LYc/3hJjojMeBjnoD3rDTHd6l97up3DIU+8SbPdkLF9CJHKmQgIO3uz1cjgU+B8bWamyvMZF/oDBJvj9fZ7hBiDzxQnxCdruuG7B6BjxPpFaZI5KX+WifhENQ2aYBlhdd9a/dnercYkyRjQWHIVUOa7Otg== Received: from IA1PR19MB6275.namprd19.prod.outlook.com (2603:10b6:208:3e9::19) by MW3PR19MB4219.namprd19.prod.outlook.com (2603:10b6:303:51::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Thu, 13 Jul 2023 16:48:28 +0000 Received: from IA1PR19MB6275.namprd19.prod.outlook.com ([fe80::f8b:7745:ff38:8b5c]) by IA1PR19MB6275.namprd19.prod.outlook.com ([fe80::f8b:7745:ff38:8b5c%7]) with mapi id 15.20.6588.025; Thu, 13 Jul 2023 16:48:28 +0000 Message-ID: Date: Thu, 13 Jul 2023 09:48:24 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [edk2-devel] [edk2-platforms][PATCH V1 09/20] StandaloneMmPkg: parse SP manifest and populate new boot information To: devel@edk2.groups.io, gmahadevan@nvidia.com, nishant.sharma@arm.com CC: Ard Biesheuvel , Sami Mujawar , Thomas Abraham , Sayanta Pattanayak , Achin Gupta References: <20230711143658.781597-1-nishant.sharma@arm.com> <20230711143658.781597-10-nishant.sharma@arm.com> <92ce5fad-2b6d-ede2-98e8-117d974000ef@nvidia.com> From: "Chris Fernald" In-Reply-To: <92ce5fad-2b6d-ede2-98e8-117d974000ef@nvidia.com> X-TMN: [6pSdAVTlWtF+5toQVz41TXYWjXY8pvOa3Uc8ub0Fqo+GackppjeQMIja54mSjcRt] X-ClientProxiedBy: CY5PR04CA0016.namprd04.prod.outlook.com (2603:10b6:930:1e::13) To IA1PR19MB6275.namprd19.prod.outlook.com (2603:10b6:208:3e9::19) Return-Path: chris.fernald@outlook.com X-Microsoft-Original-Message-ID: <71bd7d4a-1173-cc47-9d40-fd5623ede0a9@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR19MB6275:EE_|MW3PR19MB4219:EE_ X-MS-Office365-Filtering-Correlation-Id: eff4dcac-530a-48ad-1855-08db83c0fb58 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nM68PrVL6/d1wpC9YMxncNK5uxR/1UF2VBqSQo1mIBM+mK7G7zCidgS7URSGUogGU/pjXexXapdXTD7uX3xEwsNr7W4/TOAVgiWJUkJOHUUHYftpFqizOET0JtAB0Tyy1sOMKTLmWtWCNBqx41vIHqZUohrkTfIt8sO8D4tResPkJ9Pt9HX5SPtu9g6elQgri1/m6s+SNhuXzNo/wPRipYnDJYENvQSaxFmAxaT6ULgTQf63oKdjdOwqbMI9pu/qaT22JGlbIDOt85dRh0G+ndY1jBE50toLDoOlX4oagiQPUXJP2KtVIok7SCtv78lJjPv2/1SD8UXEqvzuQa99AWtqWYEKNC57qvzE6PRzgzK8bMxtDj6Qhh7dV4clubkUS6agzK113g5wDKJis75rpwFm4pKK/pONff/djeR0HNXdlrQAmyru0dY5UNnypFYtw4wKmPMY+g9w7oSTq0t6CoXIYqXmUNoXtVnJRJ+toY1f1dKQz739gXnCwXxckLApxZiQG7bvHoDfepNFyo1PQVpKgDkxwmyCvRNbKs/LpaRP3HPs4c3YgJWNa2ME8eLt X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?HzKPB805qFGlTd9wxUL2WzMziDoJZkHZ7NexldX4ybJm6AbwmAIV7+leVW96?= =?us-ascii?Q?5b0rxhZIBRa3xX/Z6NEErQmCLFPo8K3yeU2bxr+SIozzJb7iYRAEEa3nuwl9?= =?us-ascii?Q?5N3tpaLDg/gBK9+Nc/DaXNS7ELuuXzWFCJkrBtBtGRJqjX9L6xA6+3guvG9T?= =?us-ascii?Q?VRGEpBWPs5incehkaenMLywMoluxCjIGfxNqom9xm3kL9rqnsQAqnjywCFqL?= =?us-ascii?Q?oEphMrZcyHmSavRN73I1R70gn1X7gO5Q0qk5mJOZE0N5wsK+Qs1agC+aD7Jg?= =?us-ascii?Q?f4m0KSd6NgIJVwbfEVEI8WW3hWBbZiO3DZ2tAQjeZZl44CpRpf9m95+3EIbg?= =?us-ascii?Q?KiLxGblvyGO0dMEyLSYxfC/NA5g24MFsmJrnlbfvSIqCdAgZMtaxW8xUmEVc?= =?us-ascii?Q?+h6dVB9+eC4Ms0WM8m0qCLa7YV1oTKAN9k5n87W+fFhkZh76+I+95/24yfvL?= =?us-ascii?Q?Jz27CyuxCLD0evD2pR2GABidFC5ZOlqGeSUKKFckrM5R8xoIJj9prJYiariN?= =?us-ascii?Q?574PW5mkWhFQU4EVXqmJxzmKGpKa8PKIsLaeDWNF6cHyuNrJn1F+r6q251lF?= =?us-ascii?Q?cQ9JWqIS88jKFwigx0BoC1dRzW7v/r5cPW/gb/Vf6CC1EACQAlxDyOHehMxA?= =?us-ascii?Q?1ii0/s/Um98EhnolvLizHpc1Ay8u07dV77S1lwIFIsGVmyiax2Z525pOFOcA?= =?us-ascii?Q?TayYVsqAlZrrQFJKx7pUamG+U2xb2DlGxCtTlQznxR0qxlThWN0BX0kB2mVa?= =?us-ascii?Q?/yUso9ZNfvusxYafNVXCewULrrQzgb40nHjxAO9OdJsglsc8QPsKvNvplEjq?= =?us-ascii?Q?CsA+QssZq4BSpOyVGcm0D2C2QF8xNv/TxVbqU7Kq3HsCaf0wPhg3UydOJpZY?= =?us-ascii?Q?a4uu2hXsqLNmm7SH1661VceEIyyATUj7c52IgRftWlsskwIyDtx9htr7jtNP?= =?us-ascii?Q?GYcrTdLiQpwmRaA40ecEWz4f+TF0lBYgA8CR6/yhU2OnW9yHUqF0iUgpxy5n?= =?us-ascii?Q?DTHzl56+KihenvJsoHtLwk16RNjxaaJmf59qyoTb5EuX8vjafUM0uZN6gM+p?= =?us-ascii?Q?eQ7gHiOyZI1AtaR+vkeqlRAKHdoREHuBKENkirtD6dksmb3Rc4ZS0sPbtvyY?= =?us-ascii?Q?pMBSBeIdEKy0nk/UgoyEglXgeee6z03RcCIJfJiG5yQTVNReVJiMoKqpRCwN?= =?us-ascii?Q?j1Zy3f6gcR175/kuY3wmHDYd2+1zyPAisFvngIIZ7SuVQUm2LzktC3NFXjMQ?= =?us-ascii?Q?T/BHvWLoyGm5d9un/RjfNh9Mlqtirh2wbxgGLm+tFo3VeWj+vtJL0KF+ImWM?= =?us-ascii?Q?MEQ=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: eff4dcac-530a-48ad-1855-08db83c0fb58 X-MS-Exchange-CrossTenant-AuthSource: IA1PR19MB6275.namprd19.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 16:48:28.1407 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR19MB4219 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Achin/Nishant, could you explain the motivation behind falling back to=20 device tree for some of the secure partition information? It seems like=20 we have this large abstraction framework using FF-A and it seems a bit=20 odd to have the secure partition have to directly read device tree for=20 some of this information when everything else is query-able from the=20 framework itself. Thanks, Chris Fernald On 7/13/2023 8:24 AM, Girish Mahadevan via groups.io wrote: > I had one comment , in-line. > > Thanks > Girish > > On 7/11/2023 8:36 AM, Nishant Sharma via groups.io wrote: >> External email: Use caution opening links or attachments >> >> >> From: Achin Gupta >> >> This patch discovers the SP manifest in DT format passed by the SPMC. It >> then parses it to obtain the boot information required to initialise the >> SP. >> >> Signed-off-by: Achin Gupta >> Signed-off-by: Sayanta Pattanayak >> Signed-off-by: Nishant Sharma >> --- >> StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h |=C2=A0= =C2=A0=20 >> 2 +- >> StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreE= ntryPoint.c=20 >> | 389 +++++++++++++++++++- >> =C2=A0 2 files changed, 381 insertions(+), 10 deletions(-) >> >> diff --git=20 >> a/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h=20 >> b/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h >> index c965192c702e..90d67a2f25b5 100644 >> --- a/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h >> +++ b/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h >> @@ -2,7 +2,7 @@ >> =C2=A0=C2=A0=C2=A0 Entry point to the Standalone MM Foundation when init= ialized=20 >> during the SEC >> =C2=A0=C2=A0=C2=A0 phase on ARM platforms >> >> -Copyright (c) 2017 - 2021, Arm Ltd. All rights reserved.
>> +Copyright (c) 2017 - 2023, Arm Ltd. All rights reserved.
>> =C2=A0 SPDX-License-Identifier: BSD-2-Clause-Patent >> >> =C2=A0 **/ >> diff --git=20 >> a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCor= eEntryPoint.c=20 >> b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCor= eEntryPoint.c=20 >> >> index 9f6af55c86c4..505786aff07c 100644 >> ---=20 >> a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCor= eEntryPoint.c >> +++=20 >> b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCor= eEntryPoint.c >> @@ -38,6 +38,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent >> >> =C2=A0 #define BOOT_PAYLOAD_VERSION=C2=A0 1 >> >> +#define FFA_PAGE_4K 0 >> +#define FFA_PAGE_16K 1 >> +#define FFA_PAGE_64K 2 >> + >> =C2=A0 PI_MM_ARM_TF_CPU_DRIVER_ENTRYPOINT=C2=A0 CpuDriverEntryPoint =3D = NULL; >> >> =C2=A0 /** >> @@ -106,6 +110,7 @@ GetAndPrintBootinformation ( >> =C2=A0=C2=A0=C2=A0 } >> >> =C2=A0=C2=A0=C2=A0 return PayloadBootInfo; >> +} >> >> =C2=A0 /** >> =C2=A0=C2=A0=C2=A0 An StMM SP implements partial support for FF-A v1.0. = The FF-A=20 >> ABIs are used to >> @@ -266,6 +271,308 @@ DelegatedEventLoop ( >> =C2=A0=C2=A0=C2=A0 } >> =C2=A0 } >> >> +STATIC >> +BOOLEAN >> +CheckDescription ( >> +=C2=A0=C2=A0=C2=A0 IN VOID=C2=A0=C2=A0 * DtbAddress, >> +=C2=A0=C2=A0=C2=A0 IN INT32=C2=A0=C2=A0=C2=A0 Offset, >> +=C2=A0=C2=A0=C2=A0 OUT CHAR8 * Description, >> +=C2=A0=C2=A0=C2=A0 OUT UINT32=C2=A0 Size >> +=C2=A0=C2=A0=C2=A0 ) >> +{ >> +=C2=A0 CONST CHAR8 * Property; >> +=C2=A0 INT32 LenP; >> + >> +=C2=A0 Property =3D fdt_getprop (DtbAddress, Offset, "description", &Le= nP); >> +=C2=A0 if (Property =3D=3D NULL) { >> +=C2=A0=C2=A0=C2=A0 return FALSE; >> +=C2=A0 } >> + >> + return CompareMem (Description, Property, MIN(Size, (UINT32)LenP))=20 >> =3D=3D 0; >> + >> +} >> + >> +STATIC >> +EFI_STATUS >> +ReadProperty32 ( >> +=C2=A0=C2=A0=C2=A0 IN=C2=A0 VOID=C2=A0=C2=A0 * DtbAddress, >> +=C2=A0=C2=A0=C2=A0 IN=C2=A0 INT32=C2=A0=C2=A0=C2=A0 Offset, >> +=C2=A0=C2=A0=C2=A0 IN=C2=A0 CHAR8=C2=A0 * Property, >> +=C2=A0=C2=A0=C2=A0 OUT UINT32 * Value >> +=C2=A0=C2=A0=C2=A0 ) >> +{ >> +=C2=A0 CONST UINT32 * Property32; >> + >> +=C2=A0 Property32 =3D=C2=A0 fdt_getprop (DtbAddress, Offset, Property, = NULL); >> +=C2=A0 if (Property32 =3D=3D NULL) { >> +=C2=A0=C2=A0=C2=A0 DEBUG (( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG_ERROR, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "%s: Missing in = FF-A boot information manifest\n", >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Property >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 )); >> +=C2=A0=C2=A0=C2=A0 return EFI_INVALID_PARAMETER; >> +=C2=A0 } >> + >> +=C2=A0 *Value =3D fdt32_to_cpu (*Property32); >> + >> +=C2=A0 return EFI_SUCCESS; >> +} >> + >> +STATIC >> +EFI_STATUS >> +ReadProperty64 ( >> +=C2=A0=C2=A0=C2=A0 IN=C2=A0 VOID=C2=A0=C2=A0 * DtbAddress, >> +=C2=A0=C2=A0=C2=A0 IN=C2=A0 INT32=C2=A0=C2=A0=C2=A0 Offset, >> +=C2=A0=C2=A0=C2=A0 IN=C2=A0 CHAR8=C2=A0 * Property, >> +=C2=A0=C2=A0=C2=A0 OUT UINT64 * Value >> +=C2=A0=C2=A0=C2=A0 ) >> +{ >> +=C2=A0 CONST UINT64 * Property64; >> + >> +=C2=A0 Property64 =3D=C2=A0 fdt_getprop (DtbAddress, Offset, Property, = NULL); >> +=C2=A0 if (Property64 =3D=3D NULL) { >> +=C2=A0=C2=A0=C2=A0 DEBUG (( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG_ERROR, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "%s: Missing in = FF-A boot information manifest\n", >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Property >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 )); >> +=C2=A0=C2=A0=C2=A0 return EFI_INVALID_PARAMETER; >> +=C2=A0 } >> + >> +=C2=A0 *Value =3D fdt64_to_cpu (*Property64); >> + >> +=C2=A0 return EFI_SUCCESS; >> +} >> + >> +STATIC >> +BOOLEAN >> +ReadRegionInfo ( >> +=C2=A0=C2=A0=C2=A0 IN VOID=C2=A0 *DtbAddress, >> +=C2=A0=C2=A0=C2=A0 IN INT32=C2=A0 Node, >> +=C2=A0=C2=A0=C2=A0 IN CHAR8 *Region, >> +=C2=A0=C2=A0=C2=A0 IN UINTN=C2=A0 RegionStrSize, >> +=C2=A0=C2=A0=C2=A0 IN UINT32 PageSize, >> +=C2=A0=C2=A0=C2=A0 OUT UINT64 *Address, >> +=C2=A0=C2=A0=C2=A0 OUT UINT64 *Size >> +=C2=A0=C2=A0=C2=A0 ) >> +{ >> +=C2=A0 BOOLEAN FoundBuffer; >> +=C2=A0 INTN Status =3D 0; >> + >> +=C2=A0 FoundBuffer =3D CheckDescription ( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DtbAddress, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Node, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Region, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 RegionStrSize >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >> +=C2=A0 if (!FoundBuffer) { >> +=C2=A0=C2=A0=C2=A0 return FALSE; >> +=C2=A0 } >> + >> +=C2=A0 DEBUG ((DEBUG_INFO, "Found Node: %a\n", Region)); >> +=C2=A0 Status =3D ReadProperty64 ( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DtbAddress, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Node, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "base-address", >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Address >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >> +=C2=A0 if (Status !=3D EFI_SUCCESS) { >> +=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_ERROR, "base-address missing in DTB"))= ; >> +=C2=A0=C2=A0=C2=A0 return FALSE; >> +=C2=A0 } >> +=C2=A0 DEBUG (( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG_INFO, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "base =3D 0x%llx\n", >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *Address >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 )); >> + >> +=C2=A0 Status =3D ReadProperty32 ( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DtbAddress, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Node, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "pages-count", >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (UINT32*)Size >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >> +=C2=A0 if (Status !=3D EFI_SUCCESS) { >> +=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_ERROR, "pages-count missing in DTB")); >> +=C2=A0=C2=A0=C2=A0 return FALSE; >> +=C2=A0 } >> + >> +=C2=A0 DEBUG ((DEBUG_ERROR, "pages-count: 0x%lx\n", *Size)); >> + >> +=C2=A0 *Size =3D *Size * PageSize; >> +=C2=A0 DEBUG (( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG_INFO, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "Size =3D 0x%llx\n", >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *Size >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 )); >> + >> +=C2=A0 return TRUE; >> +} >> + >> +/** >> + >> +=C2=A0 Populates FF-A boot information structure. >> + >> +=C2=A0 This function receives the address of a DTB from which boot=20 >> information defind >> +=C2=A0 by FF-A and required to initialize the standalone environment is= =20 >> extracted. >> + >> +=C2=A0 @param [in, out] StmmBootInfo=C2=A0 Pointer to a pre-allocated b= oot=20 >> info structure to be >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 populated. >> +=C2=A0 @param [in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DtbAddress=C2=A0=C2=A0= =C2=A0 Address of the Device tree from=20 >> where boot >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 information will be fetche= d. >> +**/ >> +STATIC >> +EFI_STATUS >> +PopulateBootinformation ( >> +=C2=A0 IN=C2=A0 OUT=C2=A0 EFI_STMM_BOOT_INFO *StmmBootInfo, >> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 VOID=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *DtbAddress >> +) >> +{ >> +=C2=A0 INTN Status; >> +=C2=A0 INT32 Offset; >> +=C2=A0 INT32 Node; >> +=C2=A0 BOOLEAN FoundNsCommBuffer =3D FALSE; >> +=C2=A0 BOOLEAN FoundSharedBuffer =3D FALSE; >> +=C2=A0 BOOLEAN FoundHeap =3D FALSE; >> +=C2=A0 UINT32 PageSize; >> + >> +=C2=A0 Offset =3D fdt_node_offset_by_compatible (DtbAddress, -1,=20 >> "arm,ffa-manifest-1.0"); >> +=C2=A0 DEBUG ((DEBUG_INFO, "Offset=C2=A0 =3D %d \n", Offset)); >> +=C2=A0 if (Offset < 0) { >> +=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_ERROR, "Missing FF-A boot information = in=20 >> manifest\n")); >> +=C2=A0=C2=A0=C2=A0 return EFI_NOT_FOUND; >> +=C2=A0 } >> + >> +=C2=A0 Status =3D ReadProperty64 ( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DtbAddress, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Offset, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "load-address", >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &StmmBootInfo->SpMemBase >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >> +=C2=A0 if (Status !=3D EFI_SUCCESS) { >> +=C2=A0=C2=A0=C2=A0 return Status; >> +=C2=A0 } >> +=C2=A0 DEBUG ((DEBUG_INFO, "sp mem base=C2=A0 =3D 0x%llx\n",=20 >> StmmBootInfo->SpMemBase)); >> + >> +=C2=A0 Status =3D ReadProperty64 ( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DtbAddress, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Offset, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "image-size", >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &StmmBootInfo->SpMemSize >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >> +=C2=A0 if (Status !=3D EFI_SUCCESS) { >> +=C2=A0=C2=A0=C2=A0 return Status; >> +=C2=A0 } >> +=C2=A0 DEBUG ((DEBUG_INFO, "sp mem size=C2=A0 =3D 0x%llx\n",=20 >> StmmBootInfo->SpMemSize)); >> + >> +=C2=A0 Status =3D ReadProperty32 (DtbAddress, Offset, "xlat-granule",= =20 >> &PageSize); >> +=C2=A0 if (Status !=3D EFI_SUCCESS) { >> +=C2=A0=C2=A0=C2=A0 return Status; >> +=C2=A0 } >> + >> +=C2=A0 /*=C2=A0 EFI_PAGE_SIZE is 4KB */ >> +=C2=A0 switch (PageSize) { >> +=C2=A0=C2=A0=C2=A0 case FFA_PAGE_4K: >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PageSize =3D EFI_PAGE_SIZE; >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >> + >> +=C2=A0=C2=A0=C2=A0 case FFA_PAGE_16K: >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PageSize =3D 4 * EFI_PAGE_SIZE; >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >> + >> +=C2=A0=C2=A0=C2=A0 case FFA_PAGE_64K: >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PageSize =3D 16 * EFI_PAGE_SIZE; >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >> + >> +=C2=A0=C2=A0=C2=A0 default: >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_ERROR, "Invalid page type = =3D %lu\n", PageSize)); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return EFI_INVALID_PARAMETER; >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >> +=C2=A0 }; >> + >> +=C2=A0 DEBUG ((DEBUG_INFO, "Page Size =3D 0x%lx\n", PageSize)); >> + >> +=C2=A0 Offset =3D fdt_subnode_offset_namelen ( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DtbAddress, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Offset, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "memory-regions", >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sizeof("memory-regions") - 1 >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >> +=C2=A0 if (Offset < 1) { >> +=C2=A0=C2=A0=C2=A0 DEBUG (( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG_ERROR, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "%s: Missing in = FF-A boot information manifest\n", >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "memory-regions" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 )); >> +=C2=A0=C2=A0=C2=A0 return EFI_INVALID_PARAMETER; >> +=C2=A0 } >> + >> +=C2=A0 for ( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Node =3D fdt_first_subnode (DtbAddress, = Offset); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Node > 0; >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Node =3D fdt_next_subnode (DtbAddress, N= ode)) { >> +=C2=A0=C2=A0=C2=A0 if (!FoundNsCommBuffer) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FoundNsCommBuffer =3D ReadRegionInfo ( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DtbAddress, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Node, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "ns-comm", >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sizeof ("ns-comm= ") - 1, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PageSize, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &StmmBootInfo->S= pNsCommBufBase, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &StmmBootInfo->S= pNsCommBufSize >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >> +=C2=A0=C2=A0=C2=A0 } >> + >> +=C2=A0=C2=A0=C2=A0 if (!FoundHeap) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FoundHeap =3D ReadRegionInfo ( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DtbAddress, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Node, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "heap", >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sizeof ("heap") = - 1, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PageSize, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &StmmBootInfo->S= pHeapBase, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &StmmBootInfo->S= pHeapSize >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >> +=C2=A0=C2=A0=C2=A0 } >> + >> +=C2=A0=C2=A0=C2=A0 if (!FoundSharedBuffer) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FoundSharedBuffer =3D ReadRegionInfo ( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DtbAddress, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Node, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "shared-buff", >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sizeof ("shared-= buff") - 1, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PageSize, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &StmmBootInfo->S= pSharedBufBase, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &StmmBootInfo->S= pSharedBufSize >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >> +=C2=A0=C2=A0=C2=A0 } >> +=C2=A0 } >> + >> +=C2=A0 if (!FoundNsCommBuffer) { >> +=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_ERROR, "Failed to find ns-comm buffer = info\n")); >> +=C2=A0=C2=A0=C2=A0 return EFI_INVALID_PARAMETER; >> +=C2=A0 } >> + >> +=C2=A0 if (!FoundHeap) { >> +=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_ERROR, "Failed to find heap buffer inf= o\n")); >> +=C2=A0=C2=A0=C2=A0 return EFI_INVALID_PARAMETER; >> +=C2=A0 } >> + >> +=C2=A0 if (!FoundSharedBuffer) { >> +=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_ERROR, "Failed to find shared buffer i= nfo\n")); >> +=C2=A0=C2=A0=C2=A0 return EFI_INVALID_PARAMETER; >> +=C2=A0 } >> + >> +=C2=A0 // Populate CPU information under the assumption made in the FF-= A=20 >> spec that >> +=C2=A0 // this is a uniprocessor SP that is capable of migration. So, i= t=20 >> is fine if >> +=C2=A0 // it sees 0 as both its physical and linear cpu id >> +=C2=A0 StmmBootInfo->CpuInfo.Mpidr =3D 0; >> +=C2=A0 StmmBootInfo->CpuInfo.LinearId =3D 0; >> +=C2=A0 StmmBootInfo->CpuInfo.Flags =3D 0; >> + >> +=C2=A0 return EFI_SUCCESS; >> +} > > [GM] > Outside of the mandatory properties, I expect that there could be some=20 > custom fields in the dtb manifest. Can you add a means for a vendor to=20 > hook in parsing properties that only apply to them. An OEM Library ? >> + >> =C2=A0 /** >> =C2=A0=C2=A0=C2=A0 Query the SPM version, check compatibility and return= success if=20 >> compatible. >> >> @@ -343,6 +650,49 @@ InitArmSvcArgs ( >> =C2=A0=C2=A0=C2=A0 } >> =C2=A0 } >> >> + >> +STATIC >> +EFI_STATUS >> +GetSpManifest ( >> +=C2=A0 IN=C2=A0 OUT=C2=A0=C2=A0=C2=A0=C2=A0 UINT64 **SpManifestAddr, >> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 VOID=C2= =A0=C2=A0=C2=A0 *BootInfoAddr >> +=C2=A0 ) >> +{ >> +=C2=A0 EFI_FFA_BOOT_INFO_HEADER *FfaBootInfo; >> +=C2=A0 EFI_FFA_BOOT_INFO_DESC=C2=A0=C2=A0 *FfaBootInfoDesc; >> + >> +=C2=A0 // Paranoid check to avoid an inadvertent NULL pointer dereferen= ce. >> +=C2=A0 if (BootInfoAddr =3D=3D NULL) { >> +=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_ERROR, "FF-A Boot information is NULL\= n")); >> +=C2=A0=C2=A0=C2=A0 return EFI_INVALID_PARAMETER; >> +=C2=A0 } >> + >> +=C2=A0 // Check boot information magic number. >> +=C2=A0 FfaBootInfo =3D (EFI_FFA_BOOT_INFO_HEADER *) BootInfoAddr; >> +=C2=A0 if (FfaBootInfo->Magic !=3D FFA_INIT_DESC_SIGNATURE) { >> +=C2=A0=C2=A0=C2=A0 DEBUG (( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG_ERROR, "Ff= aBootInfo Magic no. is invalid 0x%ux\n", >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FfaBootInfo->Mag= ic >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 )); >> +=C2=A0=C2=A0=C2=A0 return EFI_INVALID_PARAMETER; >> +=C2=A0 } >> + >> + >> +=C2=A0 FfaBootInfoDesc =3D >> +=C2=A0=C2=A0=C2=A0 (EFI_FFA_BOOT_INFO_DESC *)((UINT8 *)BootInfoAddr + >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FfaBootInfo->OffsetBootInfoD= esc); >> + >> +=C2=A0 if (FfaBootInfoDesc->Type =3D=3D >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (FFA_BOOT_INFO_TYPE(FFA_BOOT_INFO_TYPE_S= TD) | >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FFA_BOOT_INFO_TYPE_ID(FFA_BOOT_INFO_TYPE= _ID_FDT))) { >> +=C2=A0=C2=A0=C2=A0 *SpManifestAddr =3D (UINT64 *) FfaBootInfoDesc->Cont= ent; >> +=C2=A0=C2=A0=C2=A0 return EFI_SUCCESS; >> +=C2=A0 } >> + >> +=C2=A0 DEBUG ((DEBUG_ERROR, "SP manifest not found \n")); >> +=C2=A0 return EFI_NOT_FOUND; >> +} >> + >> =C2=A0 /** >> =C2=A0=C2=A0=C2=A0 The entry point of Standalone MM Foundation. >> >> @@ -363,6 +713,7 @@ ModuleEntryPoint ( >> =C2=A0 { >> =C2=A0=C2=A0=C2=A0 PE_COFF_LOADER_IMAGE_CONTEXT=C2=A0=C2=A0=C2=A0 ImageC= ontext; >> =C2=A0=C2=A0=C2=A0 EFI_SECURE_PARTITION_BOOT_INFO=C2=A0 *PayloadBootInfo= ; >> +=C2=A0 EFI_STMM_BOOT_INFO=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 StmmBootInfo =3D {0}; >> =C2=A0=C2=A0=C2=A0 ARM_SVC_ARGS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= InitMmFoundationSvcArgs; >> =C2=A0=C2=A0=C2=A0 EFI_STATUS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 Status; >> =C2=A0=C2=A0=C2=A0 INT32=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Ret; >> @@ -372,6 +723,8 @@ ModuleEntryPoint ( >> =C2=A0=C2=A0=C2=A0 VOID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *TeData; >> =C2=A0=C2=A0=C2=A0 UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 TeDataSize; >> =C2=A0=C2=A0=C2=A0 EFI_PHYSICAL_ADDRESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ImageBase; >> +=C2=A0 UINT64=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 *DtbAddress; >> +=C2=A0 EFI_FIRMWARE_VOLUME_HEADER=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *BfvAdd= ress; >> =C2=A0=C2=A0=C2=A0 BOOLEAN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 UseOnlyFfaAbis =3D FALSE; >> >> =C2=A0=C2=A0=C2=A0 if (FixedPcdGet32 (PcdFfaEnable) !=3D 0) { >> @@ -384,18 +737,36 @@ ModuleEntryPoint ( >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto finish; >> =C2=A0=C2=A0=C2=A0 } >> >> -=C2=A0 PayloadBootInfo =3D GetAndPrintBootinformation (SharedBufAddress= ); >> -=C2=A0 if (PayloadBootInfo =3D=3D NULL) { >> -=C2=A0=C2=A0=C2=A0 Status =3D EFI_UNSUPPORTED; >> -=C2=A0=C2=A0=C2=A0 goto finish; >> +=C2=A0 // If only FF-A is used, the DTB address is passed in the Boot= =20 >> information >> +=C2=A0 // structure. Else, the Boot info is copied from Sharedbuffer. >> +=C2=A0 if (UseOnlyFfaAbis) { >> +=C2=A0=C2=A0=C2=A0 Status =3D GetSpManifest (&DtbAddress, SharedBufAddr= ess); >> +=C2=A0=C2=A0=C2=A0 if (Status !=3D EFI_SUCCESS) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto finish; >> +=C2=A0=C2=A0=C2=A0 } >> + >> +=C2=A0=C2=A0=C2=A0 // Extract boot information from the DTB >> +=C2=A0=C2=A0=C2=A0 Status =3D PopulateBootinformation (&StmmBootInfo, (= VOID *)=20 >> DtbAddress); >> +=C2=A0=C2=A0=C2=A0 if (Status !=3D EFI_SUCCESS) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto finish; >> +=C2=A0=C2=A0=C2=A0 } >> + >> +=C2=A0=C2=A0=C2=A0 // Stash the base address of the boot firmware volum= e >> +=C2=A0=C2=A0=C2=A0 BfvAddress =3D (EFI_FIRMWARE_VOLUME_HEADER *) StmmBo= otInfo.SpMemBase; >> +=C2=A0 } else { >> +=C2=A0=C2=A0=C2=A0 PayloadBootInfo =3D GetAndPrintBootinformation (Shar= edBufAddress); >> +=C2=A0=C2=A0=C2=A0 if (PayloadBootInfo =3D=3D NULL) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status =3D EFI_UNSUPPORTED; >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto finish; >> +=C2=A0=C2=A0=C2=A0 } >> + >> +=C2=A0=C2=A0=C2=A0 // Stash the base address of the boot firmware volum= e >> +=C2=A0=C2=A0=C2=A0 BfvAddress =3D (EFI_FIRMWARE_VOLUME_HEADER *)=20 >> PayloadBootInfo->SpImageBase; >> =C2=A0=C2=A0=C2=A0 } >> >> + >> =C2=A0=C2=A0=C2=A0 // Locate PE/COFF File information for the Standalone= MM core module >> -=C2=A0 Status =3D LocateStandaloneMmCorePeCoffData ( >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 (EFI_FIRMWARE_VOLUME_HEADER=20 >> *)(UINTN)PayloadBootInfo->SpImageBase, >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 &TeData, >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 &TeDataSize >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 ); >> +=C2=A0 Status =3D LocateStandaloneMmCorePeCoffData (BfvAddress, &TeData= ,=20 >> &TeDataSize); >> >> =C2=A0=C2=A0=C2=A0 if (EFI_ERROR (Status)) { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto finish; >> --=20 >> 2.34.1 >> >> >> >> -=3D-=3D-=3D-=3D-=3D-=3D >> Groups.io Links: You receive all messages sent to this group. >> View/Reply Online (#106801):=20 >> https://edk2.groups.io/g/devel/message/106801 >> Mute This Topic: https://groups.io/mt/100079881/6098446 >> Group Owner: devel+owner@edk2.groups.io >> Unsubscribe: https://edk2.groups.io/g/devel/unsub=20 >> [gmahadevan@nvidia.com] >> -=3D-=3D-=3D-=3D-=3D-=3D >> >> > > >=20 > >