From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id BB1BCD80470 for ; Sat, 9 Dec 2023 01:27:18 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=+WCIHh4CNAhKhXx3k3cc++xCZHHfV9UgUwWpLcGJdpw=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1702085237; v=1; b=hPJNA+jbezxknVzRE+JwV//OEXQNQGCWjhizYILif3u9qShXkjfkBHo7Sb3RElzhye/YAe0H NlH1TOmo2H1UZmT7ny/L3aMQ6p1qOikE6O+tz9Aia36JzR7qrJy23uuNoq8tinOobw5HATvXcgG 5XQkU14SX/qPveMGL8zPcpd8= X-Received: by 127.0.0.2 with SMTP id SMERYY7687511xkhesWpYEdX; Fri, 08 Dec 2023 17:27:17 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by mx.groups.io with SMTP id smtpd.web10.1327.1702085236453003652 for ; Fri, 08 Dec 2023 17:27:16 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10918"; a="16040437" X-IronPort-AV: E=Sophos;i="6.04,262,1695711600"; d="scan'208";a="16040437" X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2023 17:27:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10918"; a="916143239" X-IronPort-AV: E=Sophos;i="6.04,262,1695711600"; d="scan'208";a="916143239" X-Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga001.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 08 Dec 2023 17:27:11 -0800 X-Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 8 Dec 2023 17:27:10 -0800 X-Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 8 Dec 2023 17:27:10 -0800 X-Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 8 Dec 2023 17:27:10 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.168) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 8 Dec 2023 17:27:07 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jn7B4fzE3eJobgsfG5QsI0iMnlrbfIRxWD0t616E3oJ6LySdtouGN+hicfXk8X91i+/cOqraEU0pfQ1cff3QMwAIqyGjGSZpGgtyR+f2i7yCjx/d+UZRX0BGXWvIyfJulX+UP3eSfqmgeX1qNinAUlaSa09a3qWTvTtGlkW/8B87hZRX7AKnuYfgM/OdAv59wzpQXVNE/Z36357SJJJrfqvk24wlD3TgteL/jZtTKhL46k4nocuja7pk+U2XLBSQCbL0uBNYWV8ppIb61DzVM7TZohtBLB7ZkCDKmPr5evhPGbvOFRL+PjpOZok8sm/o9Y7tXSo5LLL4OQJ+R4iiFg== 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=uE0GcusW3LXyPMp1WdOb8/u9vldPcfdlORcx+bbE624=; b=bzAqczPcbgThEQoiwSp79NxtidZYcB3L1bWzFmY9rf3OG3KslSWBw/t1jovbsUEIzVx/9Nb7eJoZdEhGzDGk6l8nAjnNqDK/ZW8r8X9TjgeS7DrjgZbHRsv77/pO8qKlU5B8BjKXRY8pHyLuRCZHRrPsBJvKj1HDRrUriboNcTx/m7l+KMqkQPq9sNN3MGA7lli17hH9dyCmHwQQla0xc/AHO73VC1cEQV8E1P4ClXScEIrrmUNOYRSJLoX3hTjeooqVeZYXtikgPisNT59acsuItnvrmXLaxY80CFTh4sCZuMPyCyE4/gHWTIdjJc0qcpA9CtSNNNa9A6WmL/jWVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by DM4PR11MB5405.namprd11.prod.outlook.com (2603:10b6:5:394::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.28; Sat, 9 Dec 2023 01:27:04 +0000 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::b614:1f5e:8b0c:9858]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::b614:1f5e:8b0c:9858%4]) with mapi id 15.20.7068.029; Sat, 9 Dec 2023 01:27:04 +0000 From: "Ni, Ray" To: Nhi Pham , "devel@edk2.groups.io" CC: Ard Biesheuvel , Sami Mujawar , Oliver Smith-Denny Subject: Re: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg/StandaloneMmHobLib: Remove HOB creation Thread-Topic: [PATCH v1 1/1] StandaloneMmPkg/StandaloneMmHobLib: Remove HOB creation Thread-Index: AQHaJ4GyWGdRTnRjdka2QBYXJi71x7CgLmwg Date: Sat, 9 Dec 2023 01:27:03 +0000 Message-ID: References: <20231205134757.14692-1-nhiphambka@gmail.com> In-Reply-To: <20231205134757.14692-1-nhiphambka@gmail.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|DM4PR11MB5405:EE_ x-ms-office365-filtering-correlation-id: f7f05e02-631d-4ee7-e591-08dbf855f326 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: k1tOg8VoLLysU6giYsTMFF5ApR5o0fB0PgwmG0LmJJk58QHOWQCd1EnyPButi49c0LoTQ5YjPsv8A39xW6sJd/nSXg6SiINBxih//CG7rFEn52nLtbzytorAh+3YC5Kpuwhvih4uxlHUxW9WY6Yg174bTEt6LzhOa9156+VPxRSuaGhVxi6Fr5kmI1FvGrPCqOPCNsvYpdkCsZ8YoieahnLX4GgTHrMhbfdv/lLr8Hwrghyt39CcrjyunzfNX4mIh/zuQ3/+OayLZLFT9Y6FZunxUfaPBncXv3npS+PXwJ2Sci5tWkvL/FTZxJefcq3BLe7URjHiMnV7/enGXo0LESSPQINrv9xnYunJvmV909QN7Ta9W6zoKIjC3Qi285KK/qTU1BkdMeAomMXEaPk+8d4D1cDu4lASC91BoN9UPKGQvS1Y418OhMvmQJZfVV+VwqlPIKwDT4XWwCp0azagebJ6ljPpfjoFc3V3hhZtDnvxPhHqsL0uksk6j1K1UNlxXxbu9djDTeAn73GEzdk1Y34HYS/QIAmfoLlORD8FyxdW8dBnT6EUDMZDtrg8rT7H2EYTWzdfxt0Hl4EOFMIzFDCs0QTmwIDOGiRj5W4YMxs= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?IdOXKC1gcxRwj3F0p7O3gO2nTdE6lqJXUOx5NVSpZ6uTNS5Yw6JsFrnmiOVp?= =?us-ascii?Q?6tPzoZQVUn1wDiJHvsXoWc8NULbv3rWYy1UuadltbLZg+OlR+5DJEzpNHnAM?= =?us-ascii?Q?fGx0WHEfS02De78CrDj9FiEVZKTQQFBEgyGN39rJnTGxBr8qVDZQz2W9315b?= =?us-ascii?Q?SxKzdX9AXXqdbrUWW50Ytz3RXxvQg8iE0D3WGjtR/lSNp9VG1yM6RglvHD6m?= =?us-ascii?Q?jKNCRdfCHjt2uH46vLyc6OURcRDsOcMCdYHc7dcmP05u9mH+mu38q86GrIPJ?= =?us-ascii?Q?FKfrDdwBua9SpZuHGjglJ8N3M/gqU0r+BkqPhIZtAGA3pgP/5B+bE/QTGuJ6?= =?us-ascii?Q?UHFxFRPQUY6enUdJy8dPPTIojGwPf2BJAK6B43PQA4OZm6OrpWiVIBkUerBt?= =?us-ascii?Q?y4YtFkMaCtEbSylm/xMnoxTKk6mbB9aDHYQkHfdDksQMJkl/zVqcbFQyOSgh?= =?us-ascii?Q?09cK7VGNQD9Ikq6Dr8ugsQsdIzVv/U1AVBaRsUgtXDZFk6Bk1yNNHUy6ZgRR?= =?us-ascii?Q?MjjTOL3sirBZtghoH4hzIX9K59KPyvbkvO06srty9fYf2XITFiUWvtWHXOZi?= =?us-ascii?Q?jdDUg9mZmC2uQwezof6d5Um1WkYBhSZwY8VQm+5tAa0SVFzwRvpC+oyOSDsR?= =?us-ascii?Q?93CoHsX1HNKdxhIvUDX3rwuaz5POK4E3477UckL4uVPnUZD1jBlJOh0SrURd?= =?us-ascii?Q?/FTHnMsrsu4Gg7MJslAqxVoXq8fQqThVdo9R/8hYzfxozqVkPTn4E2L8Avkg?= =?us-ascii?Q?fl7hphtW+6Jnc3gRe7wEoY0viPuVDqziBW/SLcmYBgKiF+GlezSvwe6AYJc2?= =?us-ascii?Q?RURpp0kaIqfXDo19RgZ4DrUfU1yB4yiSOl6CQeibuUunQ5RAuvOTYZvwWW3Y?= =?us-ascii?Q?Dp0D+GTST1c/eUuNc0a7MzA3PRcfXHSBoAkNK1mE1HCt3khyuIpIZ6gm32Qx?= =?us-ascii?Q?5YLX0m80rP2tnBR89YWP5s69E8iT45MHSA3+YzKaysy4PLyA6H62cTfikYx8?= =?us-ascii?Q?BCzIYsLbz84hRPeWgeZghN0zoyxqSBOim+MoM1NbWg/Lt78yavtB20OutWMb?= =?us-ascii?Q?3AF1T9seDzSvIvvmTjJUTxXHVWsEF0pRJDq8+sJ2KkAhvP//uFg/uBDGOEFX?= =?us-ascii?Q?lR/QFbFvECGBct9Fzt9YR6/JqeFnEKruKthcg2osBIrN2pJLNlzgYu9bZq7l?= =?us-ascii?Q?xkaXYl9U/HXtms6sbd41WoFfcMPxhOi2CusfQwx19+pvLsYEaBEgiVWSbN/o?= =?us-ascii?Q?XA6RQ/7klnDnm+NwCAJHQTiZgXu+82FH9ASLbSBuM0GzcN5s3v2/H3RpqHfR?= =?us-ascii?Q?pV1WeAQDMr/n5j0IjGx7sidT41PnwRb0XmLOJTpVegK276ORpD+5nodImcpb?= =?us-ascii?Q?fCAYX8eRUsl5q0MoSE0zhpf0ozgwbLUG5Vo01jhkEfxFJwxZBCtfRbPjcEoK?= =?us-ascii?Q?mnUJJQRXpuyxpQwPoC+yzdEA+oJCu7GMdVt74C1rDNQLR4T6gStzxlPzIfIs?= =?us-ascii?Q?fq0omyMf4mdxK1opu4xjSXnc16BRLzHcj3N6VC6vqcQ7Z2mQe3Ap5YnD9U87?= =?us-ascii?Q?K7rSIq0styKHacA2kOo=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f7f05e02-631d-4ee7-e591-08dbf855f326 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Dec 2023 01:27:03.8180 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: OrMRuVlC+wTQNs+nJ3zd+R2BzctI+2zxrMWr3SexOhWmUrd5umBeJCm1jnMefVw72DGGuEZTVhdSFcowvhSE+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5405 X-OriginatorOrg: intel.com 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 Reply-To: devel@edk2.groups.io,ray.ni@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: HaGd4apeDG7KYu9Mrj89CG03x7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=hPJNA+jb; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Nhi, Thanks for the follow up! Reviewed-by: Ray Ni Thanks, Ray > -----Original Message----- > From: Nhi Pham > Sent: Tuesday, December 5, 2023 9:48 PM > To: devel@edk2.groups.io > Cc: Nhi Pham ; Ard Biesheuvel > ; Ni, Ray ; Sami Mujawar > ; Oliver Smith-Denny > Subject: [PATCH v1 1/1] StandaloneMmPkg/StandaloneMmHobLib: Remove > HOB creation >=20 > 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. >=20 > [1] https://edk2.groups.io/g/devel/message/108333 >=20 > Cc: Ard Biesheuvel > Cc: Ray Ni > Cc: Sami Mujawar > Cc: Oliver Smith-Denny > Signed-off-by: Nhi Pham > --- > StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.c | > 171 ++++++-------------- > 1 file changed, 51 insertions(+), 120 deletions(-) >=20 > diff --git > a/StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.c > 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 @@ > /** @file >=20 > - HOB Library implementation for Standalone MM Core. >=20 > + HOB Library implementation for Standalone MM modules. >=20 >=20 >=20 > Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
>=20 > Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
>=20 > @@ -250,48 +250,13 @@ GetBootModeHob ( > return HandOffHob->BootMode; >=20 > } >=20 >=20 >=20 > -VOID * >=20 > -CreateHob ( >=20 > - IN UINT16 HobType, >=20 > - IN UINT16 HobLength >=20 > - ) >=20 > -{ >=20 > - EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob; >=20 > - EFI_HOB_GENERIC_HEADER *HobEnd; >=20 > - EFI_PHYSICAL_ADDRESS FreeMemory; >=20 > - VOID *Hob; >=20 > - >=20 > - HandOffHob =3D GetHobList (); >=20 > - >=20 > - HobLength =3D (UINT16)((HobLength + 0x7) & (~0x7)); >=20 > - >=20 > - FreeMemory =3D HandOffHob->EfiFreeMemoryTop - HandOffHob- > >EfiFreeMemoryBottom; >=20 > - >=20 > - if (FreeMemory < HobLength) { >=20 > - return NULL; >=20 > - } >=20 > - >=20 > - Hob =3D (VOID *)(UINTN)HandOffH= ob->EfiEndOfHobList; >=20 > - ((EFI_HOB_GENERIC_HEADER *)Hob)->HobType =3D HobType; >=20 > - ((EFI_HOB_GENERIC_HEADER *)Hob)->HobLength =3D HobLength; >=20 > - ((EFI_HOB_GENERIC_HEADER *)Hob)->Reserved =3D 0; >=20 > - >=20 > - HobEnd =3D (EFI_HOB_GENERIC_HEADER *)((UINTN)Hob = + > HobLength); >=20 > - HandOffHob->EfiEndOfHobList =3D (EFI_PHYSICAL_ADDRESS)(UINTN)HobEnd; >=20 > - >=20 > - HobEnd->HobType =3D EFI_HOB_TYPE_END_OF_HOB_LIST; >=20 > - HobEnd->HobLength =3D sizeof (EFI_HOB_GENERIC_HEADER); >=20 > - HobEnd->Reserved =3D 0; >=20 > - HobEnd++; >=20 > - HandOffHob->EfiFreeMemoryBottom =3D > (EFI_PHYSICAL_ADDRESS)(UINTN)HobEnd; >=20 > - >=20 > - return Hob; >=20 > -} >=20 > - >=20 > /** >=20 > Builds a HOB for a loaded PE32 module. >=20 >=20 >=20 > This function builds a HOB for a loaded PE32 module. >=20 > + It can only be invoked by Standalone MM Core. >=20 > + For Standalone MM drivers, it will ASSERT() since HOB is read only for > Standalone MM drivers. >=20 > + >=20 > If ModuleName is NULL, then ASSERT(). >=20 > If there is no additional space for HOB creation, then ASSERT(). >=20 >=20 >=20 > @@ -310,33 +275,19 @@ BuildModuleHob ( > IN EFI_PHYSICAL_ADDRESS EntryPoint >=20 > ) >=20 > { >=20 > - EFI_HOB_MEMORY_ALLOCATION_MODULE *Hob; >=20 > - >=20 > - ASSERT ( >=20 > - ((MemoryAllocationModule & (EFI_PAGE_SIZE - 1)) =3D=3D 0) && >=20 > - ((ModuleLength & (EFI_PAGE_SIZE - 1)) =3D=3D 0) >=20 > - ); >=20 > - >=20 > - Hob =3D CreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, sizeof > (EFI_HOB_MEMORY_ALLOCATION_MODULE)); >=20 > - >=20 > - CopyGuid (&(Hob->MemoryAllocationHeader.Name), > &gEfiHobMemoryAllocModuleGuid); >=20 > - Hob->MemoryAllocationHeader.MemoryBaseAddress =3D > MemoryAllocationModule; >=20 > - Hob->MemoryAllocationHeader.MemoryLength =3D ModuleLength; >=20 > - Hob->MemoryAllocationHeader.MemoryType =3D EfiBootServicesCode; >=20 > - >=20 > // >=20 > - // Zero the reserved space to match HOB spec >=20 > + // HOB is read only for Standalone MM drivers >=20 > // >=20 > - ZeroMem (Hob->MemoryAllocationHeader.Reserved, sizeof (Hob- > >MemoryAllocationHeader.Reserved)); >=20 > - >=20 > - CopyGuid (&Hob->ModuleName, ModuleName); >=20 > - Hob->EntryPoint =3D EntryPoint; >=20 > + ASSERT (FALSE); >=20 > } >=20 >=20 >=20 > /** >=20 > Builds a HOB that describes a chunk of system memory. >=20 >=20 >=20 > This function builds a HOB that describes a chunk of system memory. >=20 > + It can only be invoked by Standalone MM Core. >=20 > + For Standalone MM drivers, it will ASSERT() since HOB is read only for > Standalone MM drivers. >=20 > + >=20 > If there is no additional space for HOB creation, then ASSERT(). >=20 >=20 >=20 > @param ResourceType The type of resource described by this HOB= . >=20 > @@ -354,15 +305,10 @@ BuildResourceDescriptorHob ( > IN UINT64 NumberOfBytes >=20 > ) >=20 > { >=20 > - EFI_HOB_RESOURCE_DESCRIPTOR *Hob; >=20 > - >=20 > - Hob =3D CreateHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, sizeof > (EFI_HOB_RESOURCE_DESCRIPTOR)); >=20 > - ASSERT (Hob !=3D NULL); >=20 > - >=20 > - Hob->ResourceType =3D ResourceType; >=20 > - Hob->ResourceAttribute =3D ResourceAttribute; >=20 > - Hob->PhysicalStart =3D PhysicalStart; >=20 > - Hob->ResourceLength =3D NumberOfBytes; >=20 > + // >=20 > + // HOB is read only for Standalone MM drivers >=20 > + // >=20 > + ASSERT (FALSE); >=20 > } >=20 >=20 >=20 > /** >=20 > @@ -371,6 +317,9 @@ BuildResourceDescriptorHob ( > This function builds a customized HOB tagged with a GUID for identific= ation >=20 > and returns the start address of GUID HOB data so that caller can fill= the > customized data. >=20 > The HOB Header and Name field is already stripped. >=20 > + It can only be invoked by Standalone MM Core. >=20 > + For Standalone MM drivers, it will ASSERT() since HOB is read only for > Standalone MM drivers. >=20 > + >=20 > If Guid is NULL, then ASSERT(). >=20 > If there is no additional space for HOB creation, then ASSERT(). >=20 > If DataLength >=3D (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT= (). >=20 > @@ -388,16 +337,11 @@ BuildGuidHob ( > IN UINTN DataLength >=20 > ) >=20 > { >=20 > - EFI_HOB_GUID_TYPE *Hob; >=20 > - >=20 > // >=20 > - // Make sure that data length is not too long. >=20 > + // HOB is read only for Standalone MM drivers >=20 > // >=20 > - ASSERT (DataLength <=3D (0xffff - sizeof (EFI_HOB_GUID_TYPE))); >=20 > - >=20 > - Hob =3D CreateHob (EFI_HOB_TYPE_GUID_EXTENSION, (UINT16)(sizeof > (EFI_HOB_GUID_TYPE) + DataLength)); >=20 > - CopyGuid (&Hob->Name, Guid); >=20 > - return Hob + 1; >=20 > + ASSERT (FALSE); >=20 > + return NULL; >=20 > } >=20 >=20 >=20 > /** >=20 > @@ -406,6 +350,9 @@ BuildGuidHob ( > This function builds a customized HOB tagged with a GUID for identific= ation, >=20 > copies the input data to the HOB data field and returns the start addr= ess of > the GUID HOB data. >=20 > The HOB Header and Name field is already stripped. >=20 > + It can only be invoked by Standalone MM Core. >=20 > + For Standalone MM drivers, it will ASSERT() since HOB is read only for > Standalone MM drivers. >=20 > + >=20 > If Guid is NULL, then ASSERT(). >=20 > If Data is NULL and DataLength > 0, then ASSERT(). >=20 > If there is no additional space for HOB creation, then ASSERT(). >=20 > @@ -426,19 +373,20 @@ BuildGuidDataHob ( > IN UINTN DataLength >=20 > ) >=20 > { >=20 > - VOID *HobData; >=20 > - >=20 > - ASSERT (Data !=3D NULL || DataLength =3D=3D 0); >=20 > - >=20 > - HobData =3D BuildGuidHob (Guid, DataLength); >=20 > - >=20 > - return CopyMem (HobData, Data, DataLength); >=20 > + // >=20 > + // HOB is read only for Standalone MM drivers >=20 > + // >=20 > + ASSERT (FALSE); >=20 > + return NULL; >=20 > } >=20 >=20 >=20 > /** >=20 > Builds a Firmware Volume HOB. >=20 >=20 >=20 > This function builds a Firmware Volume HOB. >=20 > + It can only be invoked by Standalone MM Core. >=20 > + For Standalone MM drivers, it will ASSERT() since HOB is read only for > Standalone MM drivers. >=20 > + >=20 > If there is no additional space for HOB creation, then ASSERT(). >=20 >=20 >=20 > @param BaseAddress The base address of the Firmware Volume. >=20 > @@ -452,18 +400,19 @@ BuildFvHob ( > IN UINT64 Length >=20 > ) >=20 > { >=20 > - EFI_HOB_FIRMWARE_VOLUME *Hob; >=20 > - >=20 > - Hob =3D CreateHob (EFI_HOB_TYPE_FV, sizeof > (EFI_HOB_FIRMWARE_VOLUME)); >=20 > - >=20 > - Hob->BaseAddress =3D BaseAddress; >=20 > - Hob->Length =3D Length; >=20 > + // >=20 > + // HOB is read only for Standalone MM drivers >=20 > + // >=20 > + ASSERT (FALSE); >=20 > } >=20 >=20 >=20 > /** >=20 > Builds a EFI_HOB_TYPE_FV2 HOB. >=20 >=20 >=20 > This function builds a EFI_HOB_TYPE_FV2 HOB. >=20 > + It can only be invoked by Standalone MM Core. >=20 > + For Standalone MM drivers, it will ASSERT() since HOB is read only for > Standalone MM drivers. >=20 > + >=20 > If there is no additional space for HOB creation, then ASSERT(). >=20 >=20 >=20 > @param BaseAddress The base address of the Firmware Volume. >=20 > @@ -481,20 +430,19 @@ BuildFv2Hob ( > IN CONST EFI_GUID *FileName >=20 > ) >=20 > { >=20 > - EFI_HOB_FIRMWARE_VOLUME2 *Hob; >=20 > - >=20 > - Hob =3D CreateHob (EFI_HOB_TYPE_FV2, sizeof > (EFI_HOB_FIRMWARE_VOLUME2)); >=20 > - >=20 > - Hob->BaseAddress =3D BaseAddress; >=20 > - Hob->Length =3D Length; >=20 > - CopyGuid (&Hob->FvName, FvName); >=20 > - CopyGuid (&Hob->FileName, FileName); >=20 > + // >=20 > + // HOB is read only for Standalone MM drivers >=20 > + // >=20 > + ASSERT (FALSE); >=20 > } >=20 >=20 >=20 > /** >=20 > Builds a HOB for the CPU. >=20 >=20 >=20 > This function builds a HOB for the CPU. >=20 > + It can only be invoked by Standalone MM Core. >=20 > + For Standalone MM drivers, it will ASSERT() since HOB is read only for > Standalone MM drivers. >=20 > + >=20 > If there is no additional space for HOB creation, then ASSERT(). >=20 >=20 >=20 > @param SizeOfMemorySpace The maximum physical memory > addressability of the processor. >=20 > @@ -508,23 +456,19 @@ BuildCpuHob ( > IN UINT8 SizeOfIoSpace >=20 > ) >=20 > { >=20 > - EFI_HOB_CPU *Hob; >=20 > - >=20 > - Hob =3D CreateHob (EFI_HOB_TYPE_CPU, sizeof (EFI_HOB_CPU)); >=20 > - >=20 > - Hob->SizeOfMemorySpace =3D SizeOfMemorySpace; >=20 > - Hob->SizeOfIoSpace =3D SizeOfIoSpace; >=20 > - >=20 > // >=20 > - // Zero the reserved space to match HOB spec >=20 > + // HOB is read only for Standalone MM drivers >=20 > // >=20 > - ZeroMem (Hob->Reserved, sizeof (Hob->Reserved)); >=20 > + ASSERT (FALSE); >=20 > } >=20 >=20 >=20 > /** >=20 > Builds a HOB for the memory allocation. >=20 >=20 >=20 > This function builds a HOB for the memory allocation. >=20 > + It can only be invoked by Standalone MM Core. >=20 > + For Standalone MM drivers, it will ASSERT() since HOB is read only for > Standalone MM drivers. >=20 > + >=20 > If there is no additional space for HOB creation, then ASSERT(). >=20 >=20 >=20 > @param BaseAddress The 64 bit physical address of the memory. >=20 > @@ -540,23 +484,10 @@ BuildMemoryAllocationHob ( > IN EFI_MEMORY_TYPE MemoryType >=20 > ) >=20 > { >=20 > - EFI_HOB_MEMORY_ALLOCATION *Hob; >=20 > - >=20 > - ASSERT ( >=20 > - ((BaseAddress & (EFI_PAGE_SIZE - 1)) =3D=3D 0) && >=20 > - ((Length & (EFI_PAGE_SIZE - 1)) =3D=3D 0) >=20 > - ); >=20 > - >=20 > - Hob =3D CreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, sizeof > (EFI_HOB_MEMORY_ALLOCATION)); >=20 > - >=20 > - ZeroMem (&(Hob->AllocDescriptor.Name), sizeof (EFI_GUID)); >=20 > - Hob->AllocDescriptor.MemoryBaseAddress =3D BaseAddress; >=20 > - Hob->AllocDescriptor.MemoryLength =3D Length; >=20 > - Hob->AllocDescriptor.MemoryType =3D MemoryType; >=20 > // >=20 > - // Zero the reserved space to match HOB spec >=20 > + // HOB is read only for Standalone MM drivers >=20 > // >=20 > - ZeroMem (Hob->AllocDescriptor.Reserved, sizeof (Hob- > >AllocDescriptor.Reserved)); >=20 > + ASSERT (FALSE); >=20 > } >=20 >=20 >=20 > /** >=20 > -- > 2.34.1 -=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 (#112248): https://edk2.groups.io/g/devel/message/112248 Mute This Topic: https://groups.io/mt/103018869/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-