From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web12.38862.1595255435583346268 for ; Mon, 20 Jul 2020 07:30:35 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=GI15Y1dp; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: liming.gao@intel.com) IronPort-SDR: 0QZA5iNcKUmqevX1ERuKO7XkFJnRh3UTsSK7hw46tqooFRoykxLJwsOYpSKcrHuz5xvsmWQsQL QMUBcsZobjlA== X-IronPort-AV: E=McAfee;i="6000,8403,9687"; a="149071319" X-IronPort-AV: E=Sophos;i="5.75,375,1589266800"; d="scan'208";a="149071319" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2020 07:30:32 -0700 IronPort-SDR: BWEGGHaDxD03QXId7E24GCI1lUWoaUJSSIK/HoCg13F0ROvauyKwCKpmiDB0nkbGHu39LMkIS0 +ipKOPbL4SlQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,375,1589266800"; d="scan'208";a="318021841" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga008.jf.intel.com with ESMTP; 20 Jul 2020 07:30:31 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 20 Jul 2020 07:30:31 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 20 Jul 2020 07:30:31 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.175) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 20 Jul 2020 07:30:28 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UePLOC75H1O9Er7Pb4noXgdQZhSkKdhaPQ48lICoCfW2daxTPOX7xbadEnRjEcRlz5jjWbOu1T+IkXEnAs6+zf5J8i/G58q4UlQimaPUcgoxqHEdUQBtizs2ccmQ1eEs+iDUsuQ+CyIruizctFnvKlKRWrVvGbm3SVqkqh71Xs6QEu/Ca5YrK5KDKwTKmzrSY3AcvlTCW+T4pafz6xq4LjoA0PYZkSfw2yDQZqLZ8QGMK4h0znQFF+GvAdaVyZYWGh7jftA44pqLBZm2HMW0wxUSECMCUZ+/S9hv325fyMRoNsrscwGLuuk5ky1oUrJx8aWfFT2TIrAK1s5cSWIaZQ== 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=4gmHgvrDFwfiBlC/gzlXnWyV92lQfkffVAMkqDRotOo=; b=k/1d51MFiZ5j8Le9T/DatCIPlP9UeNVbNQc+qG7VV1le4tjEWcYY73Sw9sX+Tn/E/MP+taOCoUl2NwFcQustZg1/A7AL3bqjbFcc0JpFd/5NPhwdVWspcgab17uvO5GopJs2GJ7DJheUH9tIvZwaTR6sTNez4sH7o6GdJvtv/jujCf6EDTxoYsiQ1V81CjodIiPRDulLrocUTGsolTq77nRJ9cYRYLmeTvG/JHb1HPfS3d2sbR2xxz0K6d/EuB5uKYEJ5oZ0KeRBPiHE7+6rbrA2i0ezMqK6rOAv4MiwgGO5dkzcveOQ8wU9jyuuSmYFIM8kmsw0DwEnVrEHnSLVoA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4gmHgvrDFwfiBlC/gzlXnWyV92lQfkffVAMkqDRotOo=; b=GI15Y1dp8qa9Z1KbcijXclX2GSWU2+eJ64UIbYU8V4zEoGNcN+9vyb7J85c+3rCzMX3XKgIQKlBZUojXfbRLdWQuTCwTH7WPV6Tgx9PYLz3hpDYaEd02FSZGBdNjGZsP/sFWyDXpZm/IATIC/PeCnqivRrDCyCkvGQnVlhM574c= Received: from MWHPR11MB1630.namprd11.prod.outlook.com (2603:10b6:301:e::7) by MWHPR11MB0046.namprd11.prod.outlook.com (2603:10b6:301:67::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.25; Mon, 20 Jul 2020 14:30:27 +0000 Received: from MWHPR11MB1630.namprd11.prod.outlook.com ([fe80::7847:b564:1b55:b67e]) by MWHPR11MB1630.namprd11.prod.outlook.com ([fe80::7847:b564:1b55:b67e%6]) with mapi id 15.20.3195.025; Mon, 20 Jul 2020 14:30:27 +0000 From: "Liming Gao" To: "Feng, YunhuaX" , "devel@edk2.groups.io" CC: "Feng, Bob C" Subject: Re: [edk2-staging][PATCH] BaseTools/Fmmt: Fix regression issue by b41fac8e Thread-Topic: [edk2-staging][PATCH] BaseTools/Fmmt: Fix regression issue by b41fac8e Thread-Index: AdZeZx2EqncGUTPqQnm1aACClnY3FAAOy6wQ Date: Mon, 20 Jul 2020 14:30:27 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.193] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b7d7c07b-6277-46ea-09b7-08d82cb972b4 x-ms-traffictypediagnostic: MWHPR11MB0046: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OY3F2oiN4bc/t+ektS+mbzBJcSWRFp6ygazlogBO9EZimohGAkwT9Ni7KxVWJ76/7w6FgYZYJPmjksDCCjT194fL4SnOk+5BRQbiqp5FHj+MLR7FFL0PJ4neHdXm3IiO5DCqDBt2jq4dDGbFkj6ActxE4ek2vhsUt/cMK7hn7AH3zSy9hmnFNE4KB3Q522FN3kzzelbEJVS73JCnz0027esBW9lk9SssvA3MyS1RdZjw9hp77J/90wwCQVt0K1yOvfVoBh3WOTeURuNQRothfqSMHCCxH/eJ/reY3C3rIL+LCJBjtDtG/hGKLqf165e+TpceRUXI6pwwJSx/S/N4Cg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1630.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(376002)(136003)(346002)(366004)(396003)(39860400002)(9686003)(53546011)(52536014)(6506007)(478600001)(4326008)(5660300002)(83380400001)(316002)(7696005)(110136005)(107886003)(71200400001)(55016002)(66446008)(64756008)(66556008)(66476007)(8676002)(8936002)(2906002)(86362001)(33656002)(186003)(76116006)(66946007)(26005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: XSsW7vCbjYcDmPM/xDOjRPx/GmFtYfYlniwUZo55bGKKNhtfiucQkX83raBB/aGpjnUltrmDmDWbEa56rGyFarG8mFHXSq3V7y83iBbupl5wxk5CsOvollmu1o4C+/YcF4zme3mvGDtxxAljIDm7tBGdZ7f7Qy//+9XNedAkKzEBD2X8xOJdYkWJ2dJW0xib6ogAjE6EDT78sbjFsFciPWxvDEA64BtXsdYjkOuvL17fIfQ5xnP6ODIVBW7R1Jh0sJgKMEUeeOvPrKlEDuKPIejhy+IiFg2gLAuWbTMeoxhR6xGiqImWzXliOkOygaNLYZkNNVbwxN4LwF2cVu21xqpng6A23x3uDMTdRM3eFZstOMFhTOy6/QRLxTBzlFEPtwg/gSadwyVDXzMytuCzvsIRGv6aU2i9AugLNESfGLngZlLCyh4Nub/vHlMiEqCJdq/xtNYJ0rBqq09cVKPtSk7oKxIg2DoRw+4yQq50UPxlYbz0v6IWORK0wJFgdD4G MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1630.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b7d7c07b-6277-46ea-09b7-08d82cb972b4 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2020 14:30:27.5589 (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: pImsyDLy9+hJU1HqKbSlF64QMYPnNb8rmLi4SPnz3hg2BQ8j1/Na9xKKbDfhlP0O+PUOMVSMPN1nsbkCSuTIEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB0046 Return-Path: liming.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: Feng, YunhuaX > Sent: Monday, July 20, 2020 3:27 PM > To: devel@edk2.groups.io > Cc: Gao, Liming ; Feng, Bob C > Subject: [edk2-staging][PATCH] BaseTools/Fmmt: Fix regression issue by b4= 1fac8e >=20 > Fix regression issue by b41fac8e >=20 > Cc: Bob Feng > Cc: Liming Gao > Signed-off-by: Yunhua Feng > --- > .../Source/C/FMMT/FirmwareModuleManagement.c | 1 + > BaseTools/Source/C/FMMT/FmmtLib.c | 20 +++++++------------ > 2 files changed, 8 insertions(+), 13 deletions(-) >=20 > diff --git a/BaseTools/Source/C/FMMT/FirmwareModuleManagement.c b/BaseToo= ls/Source/C/FMMT/FirmwareModuleManagement.c > index c8a53d3def..20663ba163 100644 > --- a/BaseTools/Source/C/FMMT/FirmwareModuleManagement.c > +++ b/BaseTools/Source/C/FMMT/FirmwareModuleManagement.c > @@ -1212,10 +1212,11 @@ FmmtImageAdd( > FvInFd->FfsAttuibutes[EndId].FfsName[_MAX_PATH - 1] =3D = 0; > FvInFd->FfsAttuibutes[EndId].Level =3D NewAddedFfsLevel; > memset (&FvInFd->FfsAttuibutes[EndId].GuidName, '\0', si= zeof(EFI_GUID)); > if (EndId > 0) { > FvInFd->FfsAttuibutes[EndId].FvLevel =3D FvInFd->Ffs= Attuibutes[EndId - 1].FvLevel; > + FvInFd->FfsAttuibutes[EndId].FvId =3D FvInFd->Ffs= Attuibutes[EndId - 1].FvId; > FvInFd->FfsAttuibutes[EndId - 1].IsFvEnd =3D 0; > } > FvInFd->FfsAttuibutes[EndId].IsFvEnd =3D 1; > FvInFd->FfsAttuibutes[EndId].IsFvStart =3D 0; > NewFileNode =3D NewFileNode->Next; > diff --git a/BaseTools/Source/C/FMMT/FmmtLib.c b/BaseTools/Source/C/FMMT/= FmmtLib.c > index 2c3529680e..b945e9b63d 100644 > --- a/BaseTools/Source/C/FMMT/FmmtLib.c > +++ b/BaseTools/Source/C/FMMT/FmmtLib.c > @@ -1,10 +1,10 @@ > /** @file >=20 > Library to parse and generate FV image. >=20 > - Copyright (c) 2019, Intel Corporation. All rights reserved.
> + Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ >=20 > #include "FirmwareModuleManagement.h" > @@ -900,13 +900,11 @@ LibParseSection ( > case EFI_SECTION_FIRMWARE_VOLUME_IMAGE: >=20 > EncapDataNeedUpdata =3D TRUE; > HasUiSection =3D TRUE; >=20 > - if (FirstInFlag) { > - Level ++; > - } > + Level ++; > NumberOfSections ++; >=20 > CurrentFv->FfsAttuibutes[*FfsCount].IsLeaf =3D FALSE; > CurrentFv->FfsAttuibutes[*FfsCount].IsFvStart =3D TRUE; > // > @@ -1193,13 +1191,10 @@ LibParseSection ( > // Put in encapsulate data information. > // > LocalEncapData =3D *CurrentFvEncapData; > if (LocalEncapData->NextNode !=3D NULL) { > EncapDataNeedUpdata =3D FALSE; > - while (Level !=3D LocalEncapData->Level) { > - LocalEncapData =3D LocalEncapData->NextNode; > - } > while (LocalEncapData->RightNode !=3D NULL) { > LocalEncapData =3D LocalEncapData->RightNode; > } > } > GuidAttr =3D ((EFI_GUID_DEFINED_SECTION *)(Ptr + LargeHeaderOffset= ))->Attributes; > @@ -1524,13 +1519,10 @@ LibParseSection ( >=20 > // > //Leaf sections > // > case EFI_SECTION_RAW: > - if (FirstInFlag) { > - Level++; > - } > NumberOfSections ++; > CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level; > if (!ViewFlag) { > if (!*IsFfsGenerated) { > LibGenFfsFile(CurrentFile, CurrentFv, FvName, Level, FfsCount,= ErasePolarity); > @@ -2149,10 +2141,11 @@ LibGetFvInfo ( > EFI_FFS_FILE_HEADER2 *CurrentFile; > UINTN Key; > ENCAP_INFO_DATA *LocalEncapData; > EFI_FIRMWARE_VOLUME_EXT_HEADER *ExtHdrPtr; > EFI_FIRMWARE_VOLUME_HEADER *FvHdr; > + UINT8 PreFvId; >=20 > NumberOfFiles =3D 0; > Key =3D 0; > LocalEncapData =3D NULL; > CurrentFile =3D NULL; > @@ -2324,10 +2317,11 @@ LibGetFvInfo ( > CurrentFile =3D NULL; > } else if (EFI_ERROR (Status)) { > Error ("FMMT", 0, 0003, "error parsing FV image", "cannot find the f= irst file in the FV image"); > return Status; > } > + PreFvId =3D *FvCount; >=20 > while (CurrentFile !=3D NULL) { >=20 > // > // Increment the number of files counter > @@ -2347,11 +2341,11 @@ LibGetFvInfo ( > CurrentFv->FfsHeader[*FfsCount].Type =3D CurrentFile->Ty= pe; > CurrentFv->FfsHeader[*FfsCount].ExtendedSize =3D CurrentFile->Ex= tendedSize; > CurrentFv->FfsAttuibutes[*FfsCount].Offset =3D Key - GetFfsFileLengt= h ((EFI_FFS_FILE_HEADER *) CurrentFile); >=20 > CurrentFv->FfsAttuibutes[*FfsCount].FvLevel =3D CurrentFv->FvLevel; > - CurrentFv->FfsAttuibutes[*FfsCount].FvId =3D *FvCount; > + CurrentFv->FfsAttuibutes[*FfsCount].FvId =3D PreFvId; > if (CurrentFv->FvLevel > CurrentFv->MulFvLevel) { > CurrentFv->MulFvLevel =3D CurrentFv->FvLevel; > } > // > // Display info about this file > @@ -4333,11 +4327,11 @@ LibEncapNewFvFile( > LocalEncapData =3D LocalEncapData->NextNode; > } > } else { > LocalEncapData =3D CurrentEncapData; > while (LocalEncapData !=3D NULL) { > - if (LocalEncapData->Type =3D=3D FMMT_ENCAP_TREE_FFS) { > + if (Level_Break > 1 && LocalEncapData->Type =3D=3D FMMT_ENCAP_TREE= _FFS) { > LocalEncapDataTemp =3D LocalEncapData->RightNode; > while (LocalEncapDataTemp !=3D NULL) { > LocalEncapDataNext =3D LocalEncapDataTemp->NextNode; > if (LocalEncapDataNext !=3D NULL && LocalEncapDataNext->Next= Node !=3D NULL) { > LibEncapNewFvFile(FvInFd, TemDir, LocalEncapDataTemp, Lo= calEncapDataTemp->Level-1, &ChildFileNameList); > @@ -4513,11 +4507,11 @@ LibEncapNewFvFile( > } > } >=20 > NewFileNameList =3D FvInFd->ChildFvFFS; > while (NewFileNameList !=3D NULL && NewFileNameList -> FFSNa= me !=3D NULL) { > - if (NewFileNameList->FvId =3D=3D LocalEncapData->FvId &&= NewFileNameList -> ParentLevel =3D=3D ParentLevel && Index =3D=3D > NewFileNameList->InFvId && NewFileNameList->FfsFoundFlag=3D=3DTRUE) { > + if (NewFileNameList -> ParentLevel =3D=3D ParentLevel &&= Index =3D=3D NewFileNameList->InFvId && NewFileNameList- > >FfsFoundFlag=3D=3DTRUE) { > if (FirstInFlag) { > Status =3D LibAddFfsFileToFvInf (NewFileNameList= ->FFSName, InfFile, TRUE); > FirstInFlag =3D FALSE; > } else { > Status =3D LibAddFfsFileToFvInf (NewFileNameList= ->FFSName, InfFile, FALSE); > -- > 2.27.0.windows.1