From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=zjkFuuH9; spf=pass (domain: arm.com, ip: 40.107.2.74, mailfrom: achin.gupta@arm.com) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.74]) by groups.io with SMTP; Thu, 03 Oct 2019 04:17:16 -0700 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=hhFDBEhRtR3L3/LTDWOEzMg2rQu2niGU9eYh4y8suu4=; b=zjkFuuH9LFFQtw0CkTWrn416t3XYsU8y/v9FGjpG8G6slIJgCrsw7ttTbahfPlyeG9Th8rNXr3cDCxUcoVeYxN8lLbqnMKMFW4xZAn1lVG4bqT+BX/JbyufEPvIYfYF1s7xWOMTT90CO8w3YqTxlLLjy81ywY7MPqV2B57R35YA= Received: from AM6PR08CA0026.eurprd08.prod.outlook.com (2603:10a6:20b:c0::14) by VI1PR08MB5293.eurprd08.prod.outlook.com (2603:10a6:803:e3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.20; Thu, 3 Oct 2019 11:17:11 +0000 Received: from AM5EUR03FT003.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::207) by AM6PR08CA0026.outlook.office365.com (2603:10a6:20b:c0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.15 via Frontend Transport; Thu, 3 Oct 2019 11:17:11 +0000 Authentication-Results: spf=temperror (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=none action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT003.mail.protection.outlook.com (10.152.16.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.15 via Frontend Transport; Thu, 3 Oct 2019 11:17:10 +0000 Received: ("Tessian outbound 081de437afc7:v33"); Thu, 03 Oct 2019 11:17:09 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 282c814ef359f664 X-CR-MTA-TID: 64aa7808 Received: from 4b8cd8e799a8.2 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.5.59]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 28F2695D-3B6F-4A73-AE5C-FB3261F5D742.1; Thu, 03 Oct 2019 11:17:03 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02lp2059.outbound.protection.outlook.com [104.47.5.59]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4b8cd8e799a8.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384); Thu, 03 Oct 2019 11:17:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GqcjJW00XCiP77RIK2kER2OJrZG9M0jyRlmsS7FKkZ59Z6UBK5jbAznorf8bxKJZCajzw5eMY+3pG9hi0LnABbetf+3RyYDnw+nJqe8sOBszgADNP6jXF7bxYysALkNcj+1vuFXZBK1lFBy/RrRZnHz2PbNQo9/K/4oRlebxXLcHyoO47zeitC6qDcs/wDakZuL2lz1uc0D5fKxIouSuEFxLegw3/PDzCeX8nkkugYjIJZxoXS3py4GCjtVWXauWy8e+28CcPCHMj/e3vnKfW8Q0elt1A2wcv/WLQg6F4ulfWekB9do93I8/Uv142Q0i3kVD+JacPl5wCW20w+iXDg== 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=hhFDBEhRtR3L3/LTDWOEzMg2rQu2niGU9eYh4y8suu4=; b=K5r/D3sse6cBSEdBN0tmMRFF+qsFCC7pfNKrQAYrENvm5PGGWmfcKqOuh7xi7GLWsehgDrIPsAIWjnHMrd7c6AUbdbuP8V6w26GgMTOMul+MeMCdcXrp8raFB6i/DuMpBrsIqnF63aaqnyyS5Y6sau2OKtXUNCi5rSsxnYBT9MCelyE4UdjF+IOTYWzb7TwKkCP78DrkZdKSZgJIjNgQyxcs2KlmSg/ClLGV35+GbGCqXYfQgK+frMrJveJfu52/LTdQ+5pA7UpQ7buw/8sOA9d1dPbIWMU7L1qM9zKfneK6bXgOWkRlpyhAKfPhkmDRAXfJ2tsBVoDNdxdrm4cQQA== 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=hhFDBEhRtR3L3/LTDWOEzMg2rQu2niGU9eYh4y8suu4=; b=zjkFuuH9LFFQtw0CkTWrn416t3XYsU8y/v9FGjpG8G6slIJgCrsw7ttTbahfPlyeG9Th8rNXr3cDCxUcoVeYxN8lLbqnMKMFW4xZAn1lVG4bqT+BX/JbyufEPvIYfYF1s7xWOMTT90CO8w3YqTxlLLjy81ywY7MPqV2B57R35YA= Received: from AM0PR08MB2980.eurprd08.prod.outlook.com (52.134.92.153) by AM0PR08MB3282.eurprd08.prod.outlook.com (52.134.93.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.15; Thu, 3 Oct 2019 11:17:02 +0000 Received: from AM0PR08MB2980.eurprd08.prod.outlook.com ([fe80::61fe:e079:98cd:4a0d]) by AM0PR08MB2980.eurprd08.prod.outlook.com ([fe80::61fe:e079:98cd:4a0d%6]) with mapi id 15.20.2305.023; Thu, 3 Oct 2019 11:17:02 +0000 From: Achin Gupta To: "devel@edk2.groups.io" , "lersek@redhat.com" CC: Jiewen Yao , Supreeth Venkatesh , nd Subject: Re: [edk2-devel] [PATCH 33/35] StandaloneMmPkg/Core: stop abusing EFI_HANDLE for FwVolHeader tracking Thread-Topic: [edk2-devel] [PATCH 33/35] StandaloneMmPkg/Core: stop abusing EFI_HANDLE for FwVolHeader tracking Thread-Index: AQHVbZEznLaX2gx4b0WV36kX0aBCnqc99i0AgArlIYCAAAGzAA== Date: Thu, 3 Oct 2019 11:17:01 +0000 Message-ID: <20191003111658.GA20493@C02TC1ARHF1T.emea.arm.com> References: <20190917194935.24322-1-lersek@redhat.com> <20190917194935.24322-34-lersek@redhat.com> <86cfd468-7fd4-e7b0-dcd5-cc183abd076d@redhat.com> In-Reply-To: <86cfd468-7fd4-e7b0-dcd5-cc183abd076d@redhat.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mutt/1.12.1 (2019-06-15) x-originating-ip: [217.140.106.54] x-clientproxiedby: LO2P265CA0288.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::36) To AM0PR08MB2980.eurprd08.prod.outlook.com (2603:10a6:208:5b::25) Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Achin.Gupta@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: 004d8e3e-504e-4f6d-bf68-08d747f33bcb X-MS-Office365-Filtering-HT: Tenant X-MS-TrafficTypeDiagnostic: AM0PR08MB3282:|AM0PR08MB3282:|VI1PR08MB5293: X-MS-Exchange-PUrlCount: 3 x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:10000;OLM:10000; x-forefront-prvs: 01792087B6 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(979002)(6029001)(4636009)(366004)(376002)(396003)(39850400004)(346002)(136003)(189003)(199004)(8676002)(66066001)(1076003)(81166006)(8936002)(14454004)(25786009)(86362001)(58126008)(99286004)(316002)(54906003)(110136005)(256004)(76176011)(52116002)(6246003)(7736002)(66946007)(186003)(102836004)(3846002)(6116002)(6306002)(5660300002)(6512007)(71190400001)(66446008)(33656002)(6506007)(53546011)(386003)(64756008)(66556008)(2906002)(66476007)(478600001)(71200400001)(6436002)(476003)(2501003)(446003)(81156014)(4326008)(6486002)(486006)(11346002)(966005)(44832011)(305945005)(26005)(229853002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR08MB3282;H:AM0PR08MB2980.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: zrc8yAy38vjHWxkmgPlYnba+i3F1+cw4exkOkgnsO0D/IHIzQM1pAmcZAM6pQMG1LvR5UvLZlMPruOlmU3WOvroUrsLfF5hkknejSwG5plTF+GeCBSHJWFunviGLMkM4HScX4QtXVM32614/HJb0gGT9dbgSrjCeklwx3C8h8UOgrEp69HOxTwAmkLbZHNEt6GVWLWH+d9E238gmYbM2guORjaRkZTNE+HLR7kEToioCx0Va3veZkaXIOsvBNSXTdnr2Hxvishe+e0rKCSchwthtWsOmK4dTz6UkwiYFyYx51rywgayi5p6LRGbxE4iKgUL/2AsGegx7tsNU07pMuhWhozpdCuCWprA+gZYZTZYJDCS8Oudd3X4/TYfqzQOA2pW+CJ9kGJbw88ZZdulBbNF2TyCn/KLnLJFrkoImzbuYdKyIUAyr1egMGKuvZcz8Htlbmp0ABQkZq2l/K2IdPA== MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3282 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Achin.Gupta@arm.com; Return-Path: Achin.Gupta@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT003.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123;IPV:CAL;SCL:-1;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(979002)(6029001)(4636009)(346002)(39860400002)(376002)(136003)(396003)(189003)(199004)(356004)(478600001)(46406003)(26826003)(102836004)(2501003)(386003)(186003)(36906005)(33656002)(6486002)(11346002)(47776003)(76176011)(6506007)(86362001)(446003)(26005)(58126008)(4326008)(53546011)(316002)(966005)(6512007)(6246003)(336012)(66066001)(99286004)(1076003)(6306002)(76130400001)(97756001)(14454004)(110136005)(7736002)(22756006)(70206006)(6116002)(54906003)(3846002)(486006)(25786009)(50466002)(70586007)(23726003)(81156014)(81166006)(8936002)(8676002)(476003)(2906002)(305945005)(63350400001)(8746002)(229853002)(5660300002)(126002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR08MB5293;H:64aa7808-outbound-1.mta.getcheckrecipient.com;FPR:;SPF:TempError;LANG:en;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;MX:1;A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: e656862e-9ddf-4799-ef3d-08d747f336ca NoDisclaimer: True X-Forefront-PRVS: 01792087B6 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xh8189ExexlT/AVj/NOjlMWlPGO16KDhASCbScx4K2dWh9DRdLm2XM6dhSuYiaQG7xHMYy1sDR/HgP1tw6EP5/kcFKQlqjjBZSO1Iaq2taIVXp5UpY/JPFvT1NMSdcE1/d+xhFhmCMY7QcJBqSQBbvghUWLLhmLWKtVHyyGreOsAzaUfk/R+bOhv9DjcxlZwHT6QmRmFLCjSEwdoSm8xM+KvQ7tog6Q+2YEESGVzlJAiDfIzfpXDLL0Qu48ZKslNNkG7Dr8TuMHbSORWw7a3iOxG6quMtTzwCGg1PBM3D9HiuGiEJyDjNQXHwKaYAVg1UwMvlCDtBWdv9Rk4TYLAi8SPpDPqkTlikVSp4/5+2H/bSrxQ9BSDi6Pl/QRkrF4Nudvcu7UY9qQaaJKV+LwqZLwziNT6bV27KBmh20IImfUuTzSOgkAfcwlS3dXj8HRf8mCWGElbYQXwpxBRHqE6bg== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2019 11:17:10.1187 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 004d8e3e-504e-4f6d-bf68-08d747f33bcb 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5293 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable Hi Laszlo, Apologies for not getting back earlier as I was travelling. I will have a = look and get back by tomorrow. cheers, Achin On Thu, Oct 03, 2019 at 01:10:53PM +0200, Laszlo Ersek wrote: > Pinging StandaloneMmPkg maintainers again, for reviewing this patch. > > Thanks > Laszlo > > On 09/26/19 14:48, Laszlo Ersek wrote: > > Achin, Jiewen, Supreeth, > > > > can one of you guys please review this patch? > > > > Thanks > > Laszlo > > > > On 09/17/19 21:49, Laszlo Ersek wrote: > >> The FvHasBeenProcessed() and FvIsBeingProcesssed() functions make sur= e > >> that every firmware volume is processed only once (every driver in ev= ery > >> firmware volume should be discovered only once). For this, the functi= ons > >> use a linked list. > >> > >> In MdeModulePkg's DXE Core and SMM Core, the key used for identifying > >> those firmware volumes that have been processed is the EFI_HANDLE on = which > >> the DXE or SMM firmware volume protocol is installed. In the > >> StandaloneMmPkg core however, the key is the address of the firmware > >> volume header; that is, it has type (EFI_FIRMWARE_VOLUME_HEADER*). > >> > >> (EFI_FIRMWARE_VOLUME_HEADER*) has nothing to do with EFI_HANDLE. > >> EFI_HANDLE just happens to be specified as (VOID*), and therefore the > >> conversion between (EFI_FIRMWARE_VOLUME_HEADER*) and EFI_HANDLE is si= lent. > >> > >> (The FvHasBeenProcessed() and FvIsBeingProcesssed() functions were li= kely > >> copied verbatim from MdeModulePkg's DXE Core and/or the SMM Core, and= not > >> flagged by the compiler in StandaloneMmPkg due to UEFI regrettably > >> specifying EFI_HANDLE as (VOID*), thereby enabling the above implicit > >> conversion.) > >> > >> We should not exploit this circumstance. Represent the key type faith= fully > >> instead. > >> > >> This is a semantic fix; there is no change in operation. > >> > >> Cc: Achin Gupta > >> Cc: Jiewen Yao > >> Cc: Supreeth Venkatesh > >> Signed-off-by: Laszlo Ersek > >> --- > >> > >> Notes: > >> build-tested only > >> > >> StandaloneMmPkg/Core/StandaloneMmCore.h | 2 +- > >> StandaloneMmPkg/Core/Dispatcher.c | 80 +++++++++++--------- > >> StandaloneMmPkg/Core/FwVol.c | 16 ++-- > >> 3 files changed, 52 insertions(+), 46 deletions(-) > >> > >> diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.h b/StandaloneMmPk= g/Core/StandaloneMmCore.h > >> index dcf91bc5e916..23ddbe169faf 100644 > >> --- a/StandaloneMmPkg/Core/StandaloneMmCore.h > >> +++ b/StandaloneMmPkg/Core/StandaloneMmCore.h > >> @@ -67,7 +67,7 @@ typedef struct { > >> > >> LIST_ENTRY ScheduledLink; // mScheduledQue= ue > >> > >> - EFI_HANDLE FvHandle; > >> + EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader; > >> EFI_GUID FileName; > >> VOID *Pe32Data; > >> UINTN Pe32DataSize; > >> diff --git a/StandaloneMmPkg/Core/Dispatcher.c b/StandaloneMmPkg/Core= /Dispatcher.c > >> index 3788389f95ed..9853445a64a1 100644 > >> --- a/StandaloneMmPkg/Core/Dispatcher.c > >> +++ b/StandaloneMmPkg/Core/Dispatcher.c > >> @@ -5,7 +5,7 @@ > >> is added to the mDiscoveredList. The Before, and After D= epex are > >> pre-processed as drivers are added to the mDiscoveredLis= t. If an Apriori > >> file exists in the FV those drivers are addeded to the > >> - mScheduledQueue. The mFvHandleList is used to make sure = a > >> + mScheduledQueue. The mFwVolList is used to make sure a > >> FV is only processed once. > >> > >> Step #2 - Dispatch. Remove driver from the mScheduledQueue and loa= d and > >> @@ -40,13 +40,13 @@ > >> // > >> // MM Dispatcher Data structures > >> // > >> -#define KNOWN_HANDLE_SIGNATURE SIGNATURE_32('k','n','o','w') > >> +#define KNOWN_FWVOL_SIGNATURE SIGNATURE_32('k','n','o','w') > >> > >> typedef struct { > >> - UINTN Signature; > >> - LIST_ENTRY Link; // mFvHandleList > >> - EFI_HANDLE Handle; > >> -} KNOWN_HANDLE; > >> + UINTN Signature; > >> + LIST_ENTRY Link; // mFwVolList > >> + EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader; > >> +} KNOWN_FWVOL; > >> > >> // > >> // Function Prototypes > >> @@ -86,9 +86,10 @@ LIST_ENTRY mDiscoveredList =3D INITIALIZE_LIST_HE= AD_VARIABLE (mDiscoveredList); > >> LIST_ENTRY mScheduledQueue =3D INITIALIZE_LIST_HEAD_VARIABLE (mSche= duledQueue); > >> > >> // > >> -// List of handles who's Fv's have been parsed and added to the mFwD= riverList. > >> +// List of firmware volume headers whose containing firmware volumes= have been > >> +// parsed and added to the mFwDriverList. > >> // > >> -LIST_ENTRY mFvHandleList =3D INITIALIZE_LIST_HEAD_VARIABLE (mFvHand= leList); > >> +LIST_ENTRY mFwVolList =3D INITIALIZE_LIST_HEAD_VARIABLE (mFwVolList= ); > >> > >> // > >> // Flag for the MM Dispacher. TRUE if dispatcher is execuing. > >> @@ -769,26 +770,30 @@ MmInsertOnScheduledQueueWhileProcessingBeforeAn= dAfter ( > >> } > >> > >> /** > >> - Return TRUE if the Fv has been processed, FALSE if not. > >> + Return TRUE if the firmware volume has been processed, FALSE if no= t. > >> > >> - @param FvHandle The handle of a FV that's being test= ed > >> + @param FwVolHeader The header of the firmware volume th= at's being > >> + tested. > >> > >> - @retval TRUE Fv protocol on FvHandle has been pro= cessed > >> - @retval FALSE Fv protocol on FvHandle has not yet = been > >> - processed > >> + @retval TRUE The firmware volume denoted by FwVol= Header has > >> + been processed > >> + @retval FALSE The firmware volume denoted by FwVol= Header has > >> + not yet been processed > >> > >> **/ > >> BOOLEAN > >> FvHasBeenProcessed ( > >> - IN EFI_HANDLE FvHandle > >> + IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader > >> ) > >> { > >> LIST_ENTRY *Link; > >> - KNOWN_HANDLE *KnownHandle; > >> + KNOWN_FWVOL *KnownFwVol; > >> > >> - for (Link =3D mFvHandleList.ForwardLink; Link !=3D &mFvHandleList;= Link =3D Link->ForwardLink) { > >> - KnownHandle =3D CR (Link, KNOWN_HANDLE, Link, KNOWN_HANDLE_SIGNA= TURE); > >> - if (KnownHandle->Handle =3D=3D FvHandle) { > >> + for (Link =3D mFwVolList.ForwardLink; > >> + Link !=3D &mFwVolList; > >> + Link =3D Link->ForwardLink) { > >> + KnownFwVol =3D CR (Link, KNOWN_FWVOL, Link, KNOWN_FWVOL_SIGNATUR= E); > >> + if (KnownFwVol->FwVolHeader =3D=3D FwVolHeader) { > >> return TRUE; > >> } > >> } > >> @@ -796,28 +801,29 @@ FvHasBeenProcessed ( > >> } > >> > >> /** > >> - Remember that Fv protocol on FvHandle has had it's drivers placed = on the > >> - mDiscoveredList. This fucntion adds entries on the mFvHandleList. = Items are > >> - never removed/freed from the mFvHandleList. > >> + Remember that the firmware volume denoted by FwVolHeader has had i= ts drivers > >> + placed on mDiscoveredList. This function adds entries to mFwVolLis= t. Items > >> + are never removed/freed from mFwVolList. > >> > >> - @param FvHandle The handle of a FV that has been pro= cessed > >> + @param FwVolHeader The header of the firmware volume th= at's being > >> + processed. > >> > >> **/ > >> VOID > >> FvIsBeingProcesssed ( > >> - IN EFI_HANDLE FvHandle > >> + IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader > >> ) > >> { > >> - KNOWN_HANDLE *KnownHandle; > >> + KNOWN_FWVOL *KnownFwVol; > >> > >> - DEBUG ((DEBUG_INFO, "FvIsBeingProcesssed - 0x%08x\n", FvHandle)); > >> + DEBUG ((DEBUG_INFO, "FvIsBeingProcesssed - 0x%08x\n", KnownFwVol))= ; > >> > >> - KnownHandle =3D AllocatePool (sizeof (KNOWN_HANDLE)); > >> - ASSERT (KnownHandle !=3D NULL); > >> + KnownFwVol =3D AllocatePool (sizeof (KNOWN_FWVOL)); > >> + ASSERT (KnownFwVol !=3D NULL); > >> > >> - KnownHandle->Signature =3D KNOWN_HANDLE_SIGNATURE; > >> - KnownHandle->Handle =3D FvHandle; > >> - InsertTailList (&mFvHandleList, &KnownHandle->Link); > >> + KnownFwVol->Signature =3D KNOWN_FWVOL_SIGNATURE; > >> + KnownFwVol->FwVolHeader =3D FwVolHeader; > >> + InsertTailList (&mFwVolList, &KnownFwVol->Link); > >> } > >> > >> /** > >> @@ -842,12 +848,12 @@ FvIsBeingProcesssed ( > >> **/ > >> EFI_STATUS > >> MmAddToDriverList ( > >> - IN EFI_HANDLE FvHandle, > >> - IN VOID *Pe32Data, > >> - IN UINTN Pe32DataSize, > >> - IN VOID *Depex, > >> - IN UINTN DepexSize, > >> - IN EFI_GUID *DriverName > >> + IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader, > >> + IN VOID *Pe32Data, > >> + IN UINTN Pe32DataSize, > >> + IN VOID *Depex, > >> + IN UINTN DepexSize, > >> + IN EFI_GUID *DriverName > >> ) > >> { > >> EFI_MM_DRIVER_ENTRY *DriverEntry; > >> @@ -863,7 +869,7 @@ MmAddToDriverList ( > >> > >> DriverEntry->Signature =3D EFI_MM_DRIVER_ENTRY_SIGNATURE; > >> CopyGuid (&DriverEntry->FileName, DriverName); > >> - DriverEntry->FvHandle =3D FvHandle; > >> + DriverEntry->FwVolHeader =3D FwVolHeader; > >> DriverEntry->Pe32Data =3D Pe32Data; > >> DriverEntry->Pe32DataSize =3D Pe32DataSize; > >> DriverEntry->Depex =3D Depex; > >> diff --git a/StandaloneMmPkg/Core/FwVol.c b/StandaloneMmPkg/Core/FwVo= l.c > >> index 9fe0c257a43a..99ecf4af4714 100644 > >> --- a/StandaloneMmPkg/Core/FwVol.c > >> +++ b/StandaloneMmPkg/Core/FwVol.c > >> @@ -24,22 +24,22 @@ EFI_FV_FILETYPE mMmFileTypes[] =3D { > >> > >> EFI_STATUS > >> MmAddToDriverList ( > >> - IN EFI_HANDLE FvHandle, > >> - IN VOID *Pe32Data, > >> - IN UINTN Pe32DataSize, > >> - IN VOID *Depex, > >> - IN UINTN DepexSize, > >> - IN EFI_GUID *DriverName > >> + IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader, > >> + IN VOID *Pe32Data, > >> + IN UINTN Pe32DataSize, > >> + IN VOID *Depex, > >> + IN UINTN DepexSize, > >> + IN EFI_GUID *DriverName > >> ); > >> > >> BOOLEAN > >> FvHasBeenProcessed ( > >> - IN EFI_HANDLE FvHandle > >> + IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader > >> ); > >> > >> VOID > >> FvIsBeingProcesssed ( > >> - IN EFI_HANDLE FvHandle > >> + IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader > >> ); > >> > >> EFI_STATUS > >> > > > > > >=20 > > >