From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id C564DD801DE for ; Fri, 3 May 2024 02:28:53 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=0qG0dwFozQVS+75UB19RorgEoSH+SQ1hAuxGAZLx4hY=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:User-Agent:Subject:To:CC:References:From:In-Reply-To:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1714703332; v=1; b=sRLJi3+4cJuj1NDt88O96vNF1eBDDbxTr6DYpAww3aBSOgmvwvB1vgf+ga2iTDpSOqTZ9JRj bT4Pmb+T80546Gw4tub1E7RAOk1/8uS8NjfQDIlUnfXJN7xn2ARKjecxvw/uGRbM1Y+0drJe9Ks oehHr2TngWyC9GuiXjwKYv3DRd+5+CJuClFOEJHJnrArMhDE8MvqC22gWXtBlBS0RqIx/Ksg8F5 WOGBme4so40bsq82YTRNxlVaa6YtRaJcjwo3thhSuFmdEm/2Kuv0EG7fwVK11Q6F0ZgZnqSsdP+ OffV8f1nJPqf2la8l6T9DoaQY2LU3YIH4BKySNsAwy8ww== X-Received: by 127.0.0.2 with SMTP id 4jSlYY7687511xF5eXg0yFqr; Thu, 02 May 2024 19:28:52 -0700 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.112]) by mx.groups.io with SMTP id smtpd.web11.3830.1714703331345387252 for ; Thu, 02 May 2024 19:28:51 -0700 X-Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by SJ2PR01MB8633.prod.exchangelabs.com (2603:10b6:a03:578::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.42; Fri, 3 May 2024 02:28:48 +0000 X-Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::9ee2:336e:a1f6:486b]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::9ee2:336e:a1f6:486b%4]) with mapi id 15.20.7544.029; Fri, 3 May 2024 02:28:48 +0000 Message-ID: Date: Fri, 3 May 2024 09:28:39 +0700 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg/StandaloneMmHobLib: Remove HOB creation To: devel@edk2.groups.io, osde@linux.microsoft.com, nhiphambka@gmail.com CC: Ard Biesheuvel , Ray Ni , Sami Mujawar , Kun Qin References: <20231205134757.14692-1-nhiphambka@gmail.com> <0d99c3c9-9dd0-494a-93b1-e9270914162b@linux.microsoft.com> From: "Nhi Pham via groups.io" In-Reply-To: <0d99c3c9-9dd0-494a-93b1-e9270914162b@linux.microsoft.com> X-ClientProxiedBy: SGXP274CA0005.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::17) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7287:EE_|SJ2PR01MB8633:EE_ X-MS-Office365-Filtering-Correlation-Id: 458115a0-d96b-4f6d-12ff-08dc6b18c366 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?uRSMNOX5QCFIhyGGDQkFplH/wikSr4nCaUGwPSGcDIfEAwIe2V0aBH75UONI?= =?us-ascii?Q?1d92E3j+EnDUOwT7ojIZT62VaCla7oUuBTW19cfR/PkTETbzoCYat0f/HQmj?= =?us-ascii?Q?7VWDrAKUAtRTBFKI3rF7VV2NCZP6XmrBi/RsLzCuNKS9FkUt9bgbvVCBETd6?= =?us-ascii?Q?y5gox7kTMM+CJvytL14F8iyflkt8lN0+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vazyFk8Bu21ntKUu39RCoPx8cg9D+xJDDao3xMhTWGuAra7B2s/?= =?us-ascii?Q?XOdgljZ8gals4DmPvJwOa06RlhjCg14M9soqHir7dQ7YCln8kS71YULgPI9q?= =?us-ascii?Q?QpkGud9lA74wZhl4NhvAhEqLjmaTN5YEYRQMTdhS/dGVhuNlbYPewFzyUxE?= =?us-ascii?Q?=3D?= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ZA0uf97ccnoyBuTcH0F3/Q/yo4EvtMeLc3qXLWqf0JbhQtLBIm79KBUGF0eW?= =?us-ascii?Q?3WWzieJsz4FZBxeGlkNCLQuZSdFsK3JEeEEwZgXzD42jpwGA5xtd+aSY2WAX?= =?us-ascii?Q?sqIhlE5zGCYmvYWWZZTc5mOOGesw3I5CIIuMdz/6cv4ifiOzO4G4mjWTZN0T?= =?us-ascii?Q?fbDe3aNQU5zS99X6spUfmARdHKzLYNlW4ja6qrn1lolu4AfyFC8NGi0sJGBI?= =?us-ascii?Q?9YMTdYu4mWkFXWmu3BxRoY+mMJQffJL9iEA5qkvStBwFUhb6y3Hy7oSW1dOw?= =?us-ascii?Q?p4dNGIaLxo1MJiWAfhH78TtgtegPrRqJxS9eZiBoNZPh6DRS3LyS8mkkWg89?= =?us-ascii?Q?qLRXtsPhbDsKU2jctZw5U88ZsxInAgie4HVtK1SrCyBZP4wmynVISr04tDAv?= =?us-ascii?Q?8vl+IACaVHuHNDDu+uUYztaqIB/7gHPIHtF78hAL0DKuIlP8Riu0Z5BXYJr6?= =?us-ascii?Q?gOuThN9ZitLFd7nyos8VEoDbH3p+H7AhgJ+wl+9eKayBm+BMVRoquaiHhMvQ?= =?us-ascii?Q?BboixX9bgEEcKIfEpkeGf1GvwWZ2pKt68u0rFFHIVWCk3Lyfp/IrUU+SAKM2?= =?us-ascii?Q?Jes/+izOXuMKuykDLPQ6m59xxuJ9AizwtuvlmIDPp7V5hmfwmQ0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FcD+iK4kUu+ycUHoCN80YTcM2q5kZXiqgeem0Gof?= =?us-ascii?Q?s9OZiPBIo88MJzVYz7HTCHlW/OdKM5uoK1Cjhx2PnLW7Eqc4wxKY7TTuGmNf?= =?us-ascii?Q?0g=3D=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 458115a0-d96b-4f6d-12ff-08dc6b18c366 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2024 02:28:48.4460 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: U2zUgbHwWuuDRnloI5OVrRWuPP7Mkmw44GhUdEDDIhAY3tY55Tnhh2tlpvmotxSqfLDijxw3K0Wk5cZCwvhKAQqD6fY0otDLWbvlKf0LNw8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR01MB8633 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Thu, 02 May 2024 19:28:51 -0700 Resent-From: nhi@os.amperecomputing.com Reply-To: devel@edk2.groups.io,nhi@os.amperecomputing.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: XdzTknrPK618Thcou9EnqbW0x7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=sRLJi3+4; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=pass (policy=none) header.from=groups.io On 5/2/2024 4:31 AM, Oliver Smith-Denny via groups.io wrote: > Hi folks, returning to this thread because I noticed that HOB > creation still exists in StandaloneMmCore for ARM: >=20 > https://github.com/tianocore/edk2/blob/5d4c5253e8bbc0baa8837fcd868925212d= f85201/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList= .c >=20 > As far as I can tell, there is only this one file that creates 6 > HOBs from StandaloneMmCore. Per our earlier discussion that led to > disabling HOB creation in StandaloneMm, I think that this falls into > the case where StandaloneMm is a HOB consumer phase, not a producer > phase and so it should not be creating these HOBs. On the x64 side, > all of the StandaloneMm HOB creation functions ASSERT with the > comment that StandaloneMm is a HOB consumer phase and should not > be creating HOBs. The HOB creation in StandaloneMmCoreEntryPoint is exclusively consumed=20 by the MM_CORE_STANDALONE module=20 (StandaloneMmPkg/Core/StandaloneMmCore.inf), not a MM_STANDALONE module.=20 Per my understanding earlier, the MM_CORE_STANDALONE is a producer and=20 other MM_STANDALONE modules are consumers. So we removed the HOB=20 creation in the StandaloneMmHobLib which is consumed by MM_STANDALONE=20 modules. Also, we still retain the HOB creation in the=20 StandaloneMmPkg/Library/StandaloneMmCoreHobLib library instance. Regards, Nhi >=20 > On ARM this is more complicated, as all of this information would > seem to originate from TF-A and so we would need TF-A to produce > these HOBs to tell StandaloneMm the information it needs to > operate. Today TF-A already has to communicate this information, the > HOBs are just created in StandaloneMmCore instead of in TF-A. >=20 > Curious to get other folks thoughts here on this paradigm. >=20 > Thanks, > Oliver >=20 > On 12/5/2023 5:47 AM, Nhi Pham wrote: >> According to the discussion in "StandaloneMmPkg: Fix HOB space and >> heap space conflicted issue" [1], Standalone MM modules should be HOB >> consumers where HOB is read-only. Therefore, this patch removes the >> supported functions for HOB creation in the StandaloneMmHobLib. >> >> [1] https://edk2.groups.io/g/devel/message/108333 >> >> Cc: Ard Biesheuvel >> Cc: Ray Ni >> Cc: Sami Mujawar >> Cc: Oliver Smith-Denny >> Signed-off-by: Nhi Pham >> --- >> =C2=A0 StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.c |= =20 >> 171 ++++++-------------- >> =C2=A0 1 file changed, 51 insertions(+), 120 deletions(-) >> >> diff --git=20 >> a/StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.c=20 >> b/StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.c >> index ee61bdd227d0..bef66d167494 100644 >> --- a/StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.c >> +++ b/StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.c >> @@ -1,5 +1,5 @@ >> =C2=A0 /** @file >> >> -=C2=A0 HOB Library implementation for Standalone MM Core. >> >> +=C2=A0 HOB Library implementation for Standalone MM modules. >> >> >> =C2=A0 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved= .
>> >> =C2=A0 Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
>> >> @@ -250,48 +250,13 @@ GetBootModeHob ( >> =C2=A0=C2=A0=C2=A0 return HandOffHob->BootMode; >> >> =C2=A0 } >> >> >> -VOID * >> >> -CreateHob ( >> >> -=C2=A0 IN=C2=A0 UINT16=C2=A0 HobType, >> >> -=C2=A0 IN=C2=A0 UINT16=C2=A0 HobLength >> >> -=C2=A0 ) >> >> -{ >> >> -=C2=A0 EFI_HOB_HANDOFF_INFO_TABLE=C2=A0 *HandOffHob; >> >> -=C2=A0 EFI_HOB_GENERIC_HEADER=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *HobEnd; >> >> -=C2=A0 EFI_PHYSICAL_ADDRESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 F= reeMemory; >> >> -=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 *Hob; >> >> - >> >> -=C2=A0 HandOffHob =3D GetHobList (); >> >> - >> >> -=C2=A0 HobLength =3D (UINT16)((HobLength + 0x7) & (~0x7)); >> >> - >> >> -=C2=A0 FreeMemory =3D HandOffHob->EfiFreeMemoryTop -=20 >> HandOffHob->EfiFreeMemoryBottom; >> >> - >> >> -=C2=A0 if (FreeMemory < HobLength) { >> >> -=C2=A0=C2=A0=C2=A0 return NULL; >> >> -=C2=A0 } >> >> - >> >> -=C2=A0 Hob=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=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 =3D (VOID=20 >> *)(UINTN)HandOffHob->EfiEndOfHobList; >> >> -=C2=A0 ((EFI_HOB_GENERIC_HEADER *)Hob)->HobType=C2=A0=C2=A0 =3D HobType= ; >> >> -=C2=A0 ((EFI_HOB_GENERIC_HEADER *)Hob)->HobLength =3D HobLength; >> >> -=C2=A0 ((EFI_HOB_GENERIC_HEADER *)Hob)->Reserved=C2=A0 =3D 0; >> >> - >> >> -=C2=A0 HobEnd=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 =3D (= EFI_HOB_GENERIC_HEADER *)((UINTN)Hob=20 >> + HobLength); >> >> -=C2=A0 HandOffHob->EfiEndOfHobList =3D (EFI_PHYSICAL_ADDRESS)(UINTN)Hob= End; >> >> - >> >> -=C2=A0 HobEnd->HobType=C2=A0=C2=A0 =3D EFI_HOB_TYPE_END_OF_HOB_LIST; >> >> -=C2=A0 HobEnd->HobLength =3D sizeof (EFI_HOB_GENERIC_HEADER); >> >> -=C2=A0 HobEnd->Reserved=C2=A0 =3D 0; >> >> -=C2=A0 HobEnd++; >> >> -=C2=A0 HandOffHob->EfiFreeMemoryBottom =3D (EFI_PHYSICAL_ADDRESS)(UINTN= )HobEnd; >> >> - >> >> -=C2=A0 return Hob; >> >> -} >> >> - >> >> =C2=A0 /** >> >> =C2=A0=C2=A0=C2=A0 Builds a HOB for a loaded PE32 module. >> >> >> =C2=A0=C2=A0=C2=A0 This function builds a HOB for a loaded PE32 module. >> >> +=C2=A0 It can only be invoked by Standalone MM Core. >> >> +=C2=A0 For Standalone MM drivers, it will ASSERT() since HOB is read on= ly=20 >> for Standalone MM drivers. >> >> + >> >> =C2=A0=C2=A0=C2=A0 If ModuleName is NULL, then ASSERT(). >> >> =C2=A0=C2=A0=C2=A0 If there is no additional space for HOB creation, the= n ASSERT(). >> >> >> @@ -310,33 +275,19 @@ BuildModuleHob ( >> =C2=A0=C2=A0=C2=A0 IN EFI_PHYSICAL_ADDRESS=C2=A0 EntryPoint >> >> =C2=A0=C2=A0=C2=A0 ) >> >> =C2=A0 { >> >> -=C2=A0 EFI_HOB_MEMORY_ALLOCATION_MODULE=C2=A0 *Hob; >> >> - >> >> -=C2=A0 ASSERT ( >> >> -=C2=A0=C2=A0=C2=A0 ((MemoryAllocationModule & (EFI_PAGE_SIZE - 1)) =3D= =3D 0) && >> >> -=C2=A0=C2=A0=C2=A0 ((ModuleLength & (EFI_PAGE_SIZE - 1)) =3D=3D 0) >> >> -=C2=A0=C2=A0=C2=A0 ); >> >> - >> >> -=C2=A0 Hob =3D CreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, sizeof=20 >> (EFI_HOB_MEMORY_ALLOCATION_MODULE)); >> >> - >> >> -=C2=A0 CopyGuid (&(Hob->MemoryAllocationHeader.Name),=20 >> &gEfiHobMemoryAllocModuleGuid); >> >> -=C2=A0 Hob->MemoryAllocationHeader.MemoryBaseAddress =3D=20 >> MemoryAllocationModule; >> >> -=C2=A0 Hob->MemoryAllocationHeader.MemoryLength=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 =3D ModuleLength; >> >> -=C2=A0 Hob->MemoryAllocationHeader.MemoryType=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 =3D EfiBootServicesCode; >> >> - >> >> =C2=A0=C2=A0=C2=A0 // >> >> -=C2=A0 // Zero the reserved space to match HOB spec >> >> +=C2=A0 // HOB is read only for Standalone MM drivers >> >> =C2=A0=C2=A0=C2=A0 // >> >> -=C2=A0 ZeroMem (Hob->MemoryAllocationHeader.Reserved, sizeof=20 >> (Hob->MemoryAllocationHeader.Reserved)); >> >> - >> >> -=C2=A0 CopyGuid (&Hob->ModuleName, ModuleName); >> >> -=C2=A0 Hob->EntryPoint =3D EntryPoint; >> >> +=C2=A0 ASSERT (FALSE); >> >> =C2=A0 } >> >> >> =C2=A0 /** >> >> =C2=A0=C2=A0=C2=A0 Builds a HOB that describes a chunk of system memory. >> >> >> =C2=A0=C2=A0=C2=A0 This function builds a HOB that describes a chunk of = system memory. >> >> +=C2=A0 It can only be invoked by Standalone MM Core. >> >> +=C2=A0 For Standalone MM drivers, it will ASSERT() since HOB is read on= ly=20 >> for Standalone MM drivers. >> >> + >> >> =C2=A0=C2=A0=C2=A0 If there is no additional space for HOB creation, the= n ASSERT(). >> >> >> =C2=A0=C2=A0=C2=A0 @param=C2=A0 ResourceType=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 The type of resource described by this=20 >> HOB. >> >> @@ -354,15 +305,10 @@ BuildResourceDescriptorHob ( >> =C2=A0=C2=A0=C2=A0 IN 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 NumberOfBytes >> >> =C2=A0=C2=A0=C2=A0 ) >> >> =C2=A0 { >> >> -=C2=A0 EFI_HOB_RESOURCE_DESCRIPTOR=C2=A0 *Hob; >> >> - >> >> -=C2=A0 Hob =3D CreateHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, sizeof=20 >> (EFI_HOB_RESOURCE_DESCRIPTOR)); >> >> -=C2=A0 ASSERT (Hob !=3D NULL); >> >> - >> >> -=C2=A0 Hob->ResourceType=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D ResourceType= ; >> >> -=C2=A0 Hob->ResourceAttribute =3D ResourceAttribute; >> >> -=C2=A0 Hob->PhysicalStart=C2=A0=C2=A0=C2=A0=C2=A0 =3D PhysicalStart; >> >> -=C2=A0 Hob->ResourceLength=C2=A0=C2=A0=C2=A0 =3D NumberOfBytes; >> >> +=C2=A0 // >> >> +=C2=A0 // HOB is read only for Standalone MM drivers >> >> +=C2=A0 // >> >> +=C2=A0 ASSERT (FALSE); >> >> =C2=A0 } >> >> >> =C2=A0 /** >> >> @@ -371,6 +317,9 @@ BuildResourceDescriptorHob ( >> =C2=A0=C2=A0=C2=A0 This function builds a customized HOB tagged with a G= UID for=20 >> identification >> >> =C2=A0=C2=A0=C2=A0 and returns the start address of GUID HOB data so tha= t caller can=20 >> fill the customized data. >> >> =C2=A0=C2=A0=C2=A0 The HOB Header and Name field is already stripped. >> >> +=C2=A0 It can only be invoked by Standalone MM Core. >> >> +=C2=A0 For Standalone MM drivers, it will ASSERT() since HOB is read on= ly=20 >> for Standalone MM drivers. >> >> + >> >> =C2=A0=C2=A0=C2=A0 If Guid is NULL, then ASSERT(). >> >> =C2=A0=C2=A0=C2=A0 If there is no additional space for HOB creation, the= n ASSERT(). >> >> =C2=A0=C2=A0=C2=A0 If DataLength >=3D (0x10000 - sizeof (EFI_HOB_GUID_TY= PE)), then=20 >> ASSERT(). >> >> @@ -388,16 +337,11 @@ BuildGuidHob ( >> =C2=A0=C2=A0=C2=A0 IN UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 DataLength >> >> =C2=A0=C2=A0=C2=A0 ) >> >> =C2=A0 { >> >> -=C2=A0 EFI_HOB_GUID_TYPE=C2=A0 *Hob; >> >> - >> >> =C2=A0=C2=A0=C2=A0 // >> >> -=C2=A0 // Make sure that data length is not too long. >> >> +=C2=A0 // HOB is read only for Standalone MM drivers >> >> =C2=A0=C2=A0=C2=A0 // >> >> -=C2=A0 ASSERT (DataLength <=3D (0xffff - sizeof (EFI_HOB_GUID_TYPE))); >> >> - >> >> -=C2=A0 Hob =3D CreateHob (EFI_HOB_TYPE_GUID_EXTENSION, (UINT16)(sizeof= =20 >> (EFI_HOB_GUID_TYPE) + DataLength)); >> >> -=C2=A0 CopyGuid (&Hob->Name, Guid); >> >> -=C2=A0 return Hob + 1; >> >> +=C2=A0 ASSERT (FALSE); >> >> +=C2=A0 return NULL; >> >> =C2=A0 } >> >> >> =C2=A0 /** >> >> @@ -406,6 +350,9 @@ BuildGuidHob ( >> =C2=A0=C2=A0=C2=A0 This function builds a customized HOB tagged with a G= UID for=20 >> identification, >> >> =C2=A0=C2=A0=C2=A0 copies the input data to the HOB data field and retur= ns the start=20 >> address of the GUID HOB data. >> >> =C2=A0=C2=A0=C2=A0 The HOB Header and Name field is already stripped. >> >> +=C2=A0 It can only be invoked by Standalone MM Core. >> >> +=C2=A0 For Standalone MM drivers, it will ASSERT() since HOB is read on= ly=20 >> for Standalone MM drivers. >> >> + >> >> =C2=A0=C2=A0=C2=A0 If Guid is NULL, then ASSERT(). >> >> =C2=A0=C2=A0=C2=A0 If Data is NULL and DataLength > 0, then ASSERT(). >> >> =C2=A0=C2=A0=C2=A0 If there is no additional space for HOB creation, the= n ASSERT(). >> >> @@ -426,19 +373,20 @@ BuildGuidDataHob ( >> =C2=A0=C2=A0=C2=A0 IN UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 DataLength >> >> =C2=A0=C2=A0=C2=A0 ) >> >> =C2=A0 { >> >> -=C2=A0 VOID=C2=A0 *HobData; >> >> - >> >> -=C2=A0 ASSERT (Data !=3D NULL || DataLength =3D=3D 0); >> >> - >> >> -=C2=A0 HobData =3D BuildGuidHob (Guid, DataLength); >> >> - >> >> -=C2=A0 return CopyMem (HobData, Data, DataLength); >> >> +=C2=A0 // >> >> +=C2=A0 // HOB is read only for Standalone MM drivers >> >> +=C2=A0 // >> >> +=C2=A0 ASSERT (FALSE); >> >> +=C2=A0 return NULL; >> >> =C2=A0 } >> >> >> =C2=A0 /** >> >> =C2=A0=C2=A0=C2=A0 Builds a Firmware Volume HOB. >> >> >> =C2=A0=C2=A0=C2=A0 This function builds a Firmware Volume HOB. >> >> +=C2=A0 It can only be invoked by Standalone MM Core. >> >> +=C2=A0 For Standalone MM drivers, it will ASSERT() since HOB is read on= ly=20 >> for Standalone MM drivers. >> >> + >> >> =C2=A0=C2=A0=C2=A0 If there is no additional space for HOB creation, the= n ASSERT(). >> >> >> =C2=A0=C2=A0=C2=A0 @param=C2=A0 BaseAddress=C2=A0=C2=A0 The base address= of the Firmware Volume. >> >> @@ -452,18 +400,19 @@ BuildFvHob ( >> =C2=A0=C2=A0=C2=A0 IN 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 Length >> >> =C2=A0=C2=A0=C2=A0 ) >> >> =C2=A0 { >> >> -=C2=A0 EFI_HOB_FIRMWARE_VOLUME=C2=A0 *Hob; >> >> - >> >> -=C2=A0 Hob =3D CreateHob (EFI_HOB_TYPE_FV, sizeof (EFI_HOB_FIRMWARE_VOL= UME)); >> >> - >> >> -=C2=A0 Hob->BaseAddress =3D BaseAddress; >> >> -=C2=A0 Hob->Length=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D Length; >> >> +=C2=A0 // >> >> +=C2=A0 // HOB is read only for Standalone MM drivers >> >> +=C2=A0 // >> >> +=C2=A0 ASSERT (FALSE); >> >> =C2=A0 } >> >> >> =C2=A0 /** >> >> =C2=A0=C2=A0=C2=A0 Builds a EFI_HOB_TYPE_FV2 HOB. >> >> >> =C2=A0=C2=A0=C2=A0 This function builds a EFI_HOB_TYPE_FV2 HOB. >> >> +=C2=A0 It can only be invoked by Standalone MM Core. >> >> +=C2=A0 For Standalone MM drivers, it will ASSERT() since HOB is read on= ly=20 >> for Standalone MM drivers. >> >> + >> >> =C2=A0=C2=A0=C2=A0 If there is no additional space for HOB creation, the= n ASSERT(). >> >> >> =C2=A0=C2=A0=C2=A0 @param=C2=A0 BaseAddress=C2=A0=C2=A0 The base address= of the Firmware Volume. >> >> @@ -481,20 +430,19 @@ BuildFv2Hob ( >> =C2=A0=C2=A0=C2=A0 IN CONST=C2=A0=C2=A0=C2=A0 EFI_GUID=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 *FileName >> >> =C2=A0=C2=A0=C2=A0 ) >> >> =C2=A0 { >> >> -=C2=A0 EFI_HOB_FIRMWARE_VOLUME2=C2=A0 *Hob; >> >> - >> >> -=C2=A0 Hob =3D CreateHob (EFI_HOB_TYPE_FV2, sizeof (EFI_HOB_FIRMWARE_VO= LUME2)); >> >> - >> >> -=C2=A0 Hob->BaseAddress =3D BaseAddress; >> >> -=C2=A0 Hob->Length=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D Length; >> >> -=C2=A0 CopyGuid (&Hob->FvName, FvName); >> >> -=C2=A0 CopyGuid (&Hob->FileName, FileName); >> >> +=C2=A0 // >> >> +=C2=A0 // HOB is read only for Standalone MM drivers >> >> +=C2=A0 // >> >> +=C2=A0 ASSERT (FALSE); >> >> =C2=A0 } >> >> >> =C2=A0 /** >> >> =C2=A0=C2=A0=C2=A0 Builds a HOB for the CPU. >> >> >> =C2=A0=C2=A0=C2=A0 This function builds a HOB for the CPU. >> >> +=C2=A0 It can only be invoked by Standalone MM Core. >> >> +=C2=A0 For Standalone MM drivers, it will ASSERT() since HOB is read on= ly=20 >> for Standalone MM drivers. >> >> + >> >> =C2=A0=C2=A0=C2=A0 If there is no additional space for HOB creation, the= n ASSERT(). >> >> >> =C2=A0=C2=A0=C2=A0 @param=C2=A0 SizeOfMemorySpace=C2=A0=C2=A0 The maximu= m physical memory=20 >> addressability of the processor. >> >> @@ -508,23 +456,19 @@ BuildCpuHob ( >> =C2=A0=C2=A0=C2=A0 IN UINT8=C2=A0 SizeOfIoSpace >> >> =C2=A0=C2=A0=C2=A0 ) >> >> =C2=A0 { >> >> -=C2=A0 EFI_HOB_CPU=C2=A0 *Hob; >> >> - >> >> -=C2=A0 Hob =3D CreateHob (EFI_HOB_TYPE_CPU, sizeof (EFI_HOB_CPU)); >> >> - >> >> -=C2=A0 Hob->SizeOfMemorySpace =3D SizeOfMemorySpace; >> >> -=C2=A0 Hob->SizeOfIoSpace=C2=A0=C2=A0=C2=A0=C2=A0 =3D SizeOfIoSpace; >> >> - >> >> =C2=A0=C2=A0=C2=A0 // >> >> -=C2=A0 // Zero the reserved space to match HOB spec >> >> +=C2=A0 // HOB is read only for Standalone MM drivers >> >> =C2=A0=C2=A0=C2=A0 // >> >> -=C2=A0 ZeroMem (Hob->Reserved, sizeof (Hob->Reserved)); >> >> +=C2=A0 ASSERT (FALSE); >> >> =C2=A0 } >> >> >> =C2=A0 /** >> >> =C2=A0=C2=A0=C2=A0 Builds a HOB for the memory allocation. >> >> >> =C2=A0=C2=A0=C2=A0 This function builds a HOB for the memory allocation. >> >> +=C2=A0 It can only be invoked by Standalone MM Core. >> >> +=C2=A0 For Standalone MM drivers, it will ASSERT() since HOB is read on= ly=20 >> for Standalone MM drivers. >> >> + >> >> =C2=A0=C2=A0=C2=A0 If there is no additional space for HOB creation, the= n ASSERT(). >> >> >> =C2=A0=C2=A0=C2=A0 @param=C2=A0 BaseAddress=C2=A0=C2=A0 The 64 bit physi= cal address of the memory. >> >> @@ -540,23 +484,10 @@ BuildMemoryAllocationHob ( >> =C2=A0=C2=A0=C2=A0 IN EFI_MEMORY_TYPE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 MemoryType >> >> =C2=A0=C2=A0=C2=A0 ) >> >> =C2=A0 { >> >> -=C2=A0 EFI_HOB_MEMORY_ALLOCATION=C2=A0 *Hob; >> >> - >> >> -=C2=A0 ASSERT ( >> >> -=C2=A0=C2=A0=C2=A0 ((BaseAddress & (EFI_PAGE_SIZE - 1)) =3D=3D 0) && >> >> -=C2=A0=C2=A0=C2=A0 ((Length & (EFI_PAGE_SIZE - 1)) =3D=3D 0) >> >> -=C2=A0=C2=A0=C2=A0 ); >> >> - >> >> -=C2=A0 Hob =3D CreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, sizeof=20 >> (EFI_HOB_MEMORY_ALLOCATION)); >> >> - >> >> -=C2=A0 ZeroMem (&(Hob->AllocDescriptor.Name), sizeof (EFI_GUID)); >> >> -=C2=A0 Hob->AllocDescriptor.MemoryBaseAddress =3D BaseAddress; >> >> -=C2=A0 Hob->AllocDescriptor.MemoryLength=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = =3D Length; >> >> -=C2=A0 Hob->AllocDescriptor.MemoryType=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 =3D MemoryType; >> >> =C2=A0=C2=A0=C2=A0 // >> >> -=C2=A0 // Zero the reserved space to match HOB spec >> >> +=C2=A0 // HOB is read only for Standalone MM drivers >> >> =C2=A0=C2=A0=C2=A0 // >> >> -=C2=A0 ZeroMem (Hob->AllocDescriptor.Reserved, sizeof=20 >> (Hob->AllocDescriptor.Reserved)); >> >> +=C2=A0 ASSERT (FALSE); >> >> =C2=A0 } >> >> >> =C2=A0 /** >> >=20 >=20 >=20 >=20 >=20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118552): https://edk2.groups.io/g/devel/message/118552 Mute This Topic: https://groups.io/mt/103018869/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-