From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on070f.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe46::70f]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 04C7E1A1E72 for ; Fri, 21 Oct 2016 09:40:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=G0pQB7mswrRu6/tFLvWJCwZJA3Lj1lvXmOj16zMv0/k=; b=nfPoz24p9HKVp32xdrVWVOGGatLB34xliXhW1r/AS+IJ51ASZ84JP7FkzCSx2iafeekXTSVkvwKPSt36eN/z05uG3obP2Vyje7iTIho7OTAlcZzPECudYKYaduOb376V29xAkviC/MsxYcglrKKaGJUAsuFiCZ4qUF3zQHqNGYY= Received: from BY1PR03MB1355.namprd03.prod.outlook.com (10.162.109.25) by BY1PR03MB1355.namprd03.prod.outlook.com (10.162.109.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11; Fri, 21 Oct 2016 16:39:58 +0000 Received: from BY1PR03MB1355.namprd03.prod.outlook.com ([10.162.109.25]) by BY1PR03MB1355.namprd03.prod.outlook.com ([10.162.109.25]) with mapi id 15.01.0659.028; Fri, 21 Oct 2016 16:39:58 +0000 From: Sean Brogan To: "Zeng, Star" , "Gao, Liming" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] question about a compressed Ffs3 file inside FFS2 filesystem Thread-Index: AQHSKqvKDpCaH9VQ00GEvnXKQI1tm6CxaWAwgACunQCAABFDMA== Date: Fri, 21 Oct 2016 16:39:58 +0000 Message-ID: References: <4A89E2EF3DFEDB4C8BFDE51014F606A14B497236@shsmsx102.ccr.corp.intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103958FEAA@shsmsx102.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483103958FEAA@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=sean.brogan@microsoft.com; x-originating-ip: [2001:4898:80e8:6::4c0] x-ms-office365-filtering-correlation-id: 45cadff9-f979-482a-f2ed-08d3f9d0e570 x-microsoft-exchange-diagnostics: 1; BY1PR03MB1355; 7:jKYSQLnRHlSMl87vVmOwJDH33z4q7nAND25k1EYg8DbeuWiCzSwlU3aMZ2CIN6Ms9rx9o/2L+5y4iQtWy1okc7bjPS43jhJe/7Ek786n5Rwaxl+LL1WUnAZT7pMJHIQNocs5W7RpKEy14u69AvD3fsUjh9KJ7Ug57k6L3WoVxG0V2WEFna1WfEknQRAKvxPClchS0FYwFJJ6nGPpJe51dkd7cFxnP4Mj8IXTf+domCV/HJ1mqQOqHTQwILtMHpTYRU7qm3ZtqZe7Lzdz7M/X2xrVy3jBCuA5PFmzDhw+a0FZv87rVq1qiIuI+BimzllDBS4O6wUYAw0Xeivuoqc0nmMXDAFAfIYwqphdC9OzhKnY71adD+xHwqKlEGRG0OEe x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1355; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(166708455590820)(162533806227266)(211171220733660)(228905959029699)(17755550239193); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(61426038)(61427038); SRVR:BY1PR03MB1355; BCL:0; PCL:0; RULEID:; SRVR:BY1PR03MB1355; x-forefront-prvs: 01026E1310 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(7916002)(377454003)(199003)(189002)(13464003)(43784003)(9686002)(99286002)(101416001)(2900100001)(15975445007)(81166006)(68736007)(105586002)(106116001)(33656002)(11100500001)(575784001)(106356001)(5001770100001)(97736004)(6116002)(102836003)(86612001)(86362001)(2906002)(586003)(189998001)(8990500004)(10290500002)(77096005)(10400500002)(10090500001)(5005710100001)(5002640100001)(8676002)(81156014)(19580405001)(122556002)(92566002)(7696004)(305945005)(107886002)(7846002)(74316002)(7736002)(19580395003)(5660300001)(93886004)(76576001)(2501003)(87936001)(76176999)(8936002)(3660700001)(2950100002)(50986999)(54356999)(3280700002)(3826002)(19627235001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY1PR03MB1355; H:BY1PR03MB1355.namprd03.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Oct 2016 16:39:58.5138 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1355 Subject: Re: question about a compressed Ffs3 file inside FFS2 filesystem X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 16:40:03 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Star, =20 Thanks. That was the issue and that fixed the problem. How about adding = an assert in PeiServicesLib? =20 MdePkg\Library\PeiServicesLib\PeiServicesLib.c ~ line 642=20 add the assert for the else case. =20 if (FvFormat !=3D NULL) { CopyGuid (&FvInfoPpi->FvFormat, FvFormat); } else { CopyGuid (&FvInfoPpi->FvFormat, &gEfiFirmwareFileSystem2Guid); //Since FileSystem 2 is being assumed check the FV //Check that the File system matches. =20 ASSERT(CompareGuid(&(((EFI_FIRMWARE_VOLUME_HEADER *)FvInfo)->FileSystem= Guid), &gEfiFirmwareFileSystem2Guid)); } Thanks again Sean This email message may contain confidential and privileged information.=A0 = Any unauthorized use is prohibited.=A0 If you are not the intended recipien= t, please contact the sender by reply email and destroy all copies of the o= riginal message. > -----Original Message----- > From: Zeng, Star [mailto:star.zeng@intel.com] > Sent: Thursday, October 20, 2016 6:02 PM > To: Sean Brogan ; Gao, Liming > ; edk2-devel@lists.01.org > Cc: Zeng, Star > Subject: RE: [edk2] question about a compressed Ffs3 file inside FFS2 > filesystem >=20 > Sean, >=20 > I guess the codes are reporting FvInfo PPI like below that makes the > problem. >=20 > PeiServicesInstallFvInfoPpi( > NULL, > (VOID *)PcdGet32(PcdFlashFvXXXBase), > PcdGet32(PcdFlashFvXXXSize), > NULL, > NULL > ); >=20 > PeiServicesInstallFvInfoPpi() has below comments for FvFormat parameter. > @param FvFormat Unique identifier of the format of the mem= ory- > mapped > firmware volume. This parameter is option= al and > may be NULL. If NULL is specified, the > *EFI_FIRMWARE_FILE_SYSTEM2_GUID* format is= assumed. >=20 > I suggest the codes can be updated to: >=20 > PeiServicesInstallFvInfoPpi( > &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) > PcdGet32(PcdFlashFvXXXBase))->FileSystemGuid), > (VOID *)PcdGet32(PcdFlashFvXXXBase), > PcdGet32(PcdFlashFvXXXSize), > NULL, > NULL > ); >=20 > Thanks, > Star > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Sean Brogan > Sent: Thursday, October 20, 2016 10:49 PM > To: Gao, Liming ; edk2-devel@lists.01.org > Subject: Re: [edk2] question about a compressed Ffs3 file inside FFS2 > filesystem >=20 > Liming, >=20 > Good catch not sure how that happened. Unfortunately now the problem > doesn't make sense. The code should have IsFfs3Fv =3D True and the debug > message that indicates the code path which ignores the section should not > get executed. I'll look at it again today as the problem still exists, j= ust my > analysis is incorrect. >=20 > Current workaround is to make sure FFS2 sizes and guids are used > everywhere so a problem with FFS3 is lurking somewhere. >=20 > Thanks > Sean >=20 >=20 > > -----Original Message----- > > From: Gao, Liming [mailto:liming.gao@intel.com] > > Sent: Thursday, October 20, 2016 1:27 AM > > To: Sean Brogan ; edk2-devel@lists.01.org > > Subject: RE: [edk2] question about a compressed Ffs3 file inside FFS2 > > filesystem > > > > Sean: > > In MdePkg.dec, gEfiFirmwareFileSystem2Guid and > > gEfiFirmwareFileSystem3Guid are defined below. > > gEfiFirmwareFileSystem2Guid =3D { 0x8c8ce578, 0x8a3d, 0x4f1c, { 0= x99, > 0x35, > > 0x89, 0x61, 0x85, 0xc3, 0x2d, 0xd3 }} > > gEfiFirmwareFileSystem3Guid =3D { 0x5473c07a, 0x3dcb, 0x4dca, { 0x= bd, > 0x6f, > > 0x1e, 0x96, 0x89, 0xe7, 0x34, 0x9a }} > > > > From the dump message, the root FV File System ID is > > 5473c07a-3dcb-4dca- bd6f-1e9689e7349a. It is FF3 file system. > > > > Thanks > > Liming > > > -----Original Message----- > > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf > > > Of Sean Brogan > > > Sent: Thursday, October 20, 2016 7:09 AM > > > To: edk2-devel@lists.01.org > > > Subject: [edk2] question about a compressed Ffs3 file inside FFS2 > > > filesystem > > > > > > We have a condition that occurs when we boot where we see the > > > following message and our boot fails because of it. > > > DEBUG ((EFI_D_ERROR, "Found a FFS3 formatted section in a non-FFS3 > > > formatted FV.\n")); > > > > > > Which is on line 773 of FwVol.c > > > ( > https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/Pe > > > i/FwVol/FwVol.c ) > > > > > > The condition is caused by a large firmware volume (greater than > > > 16mb) that is compressed and put into a smaller FV (less than 16mb). > > > My question is why isn't this allowed (seems like a valid scenario). > > > Volinfo supports this and decodes binary fine. The PI Vol 3 spec > > > has a section 3.2.2 EFI_FIRMWARE_FILE_SYSTEM3_GUID which says > > > FileSystem2 doesn't support large files but it seems that the code > > > is not taking into account that the section is compressed and > > > therefore you can have a large file inside a compressed section insid= e a > FV with File System2. > > > > > > Feedback/thoughts/comments/Bug? > > > > > > Here are some details of my scenario. > > > Compressed FV has filesystem =3D=3D 8c8ce578-8a3d-4f1c-9935- > 896185c32dd3 > > > (ffs3) > > > Non compressed FV has filesystem =3D=3D 5473c07a-3dcb-4dca-bd6f- > > > 1e9689e7349a (ffs2) > > > > > > VolInfo dump of the Non Compressed FV showing the > nested/compressed > > > FV inside. > > > > > > Decoding > > > VolInfo Version 1.0 Build Build 20909 > > > Signature: _FVH (4856465F) > > > Attributes: 4FEFF > > > EFI_FVB2_READ_DISABLED_CAP > > > EFI_FVB2_READ_ENABLED_CAP > > > EFI_FVB2_READ_STATUS > > > EFI_FVB2_WRITE_DISABLED_CAP > > > EFI_FVB2_WRITE_ENABLED_CAP > > > EFI_FVB2_WRITE_STATUS > > > EFI_FVB2_LOCK_CAP > > > EFI_FVB2_LOCK_STATUS > > > EFI_FVB2_STICKY_WRITE > > > EFI_FVB2_MEMORY_MAPPED > > > EFI_FVB2_ERASE_POLARITY > > > EFI_FVB2_READ_LOCK_CAP > > > EFI_FVB2_READ_LOCK_STATUS > > > EFI_FVB2_WRITE_LOCK_CAP > > > EFI_FVB2_WRITE_LOCK_STATUS > > > EFI_FVB2_ALIGNMENT_16 > > > EFI_FVB2_ALIGNMENT_32 > > > EFI_FVB2_ALIGNMENT_64 > > > EFI_FVB2_ALIGNMENT_128 > > > EFI_FVB2_ALIGNMENT_4K > > > EFI_FVB2_ALIGNMENT_8K > > > EFI_FVB2_ALIGNMENT_16K > > > EFI_FVB2_ALIGNMENT_32K > > > EFI_FVB2_ALIGNMENT_1M > > > EFI_FVB2_ALIGNMENT_2M > > > EFI_FVB2_ALIGNMENT_4M > > > EFI_FVB2_ALIGNMENT_8M > > > EFI_FVB2_ALIGNMENT_256M > > > EFI_FVB2_ALIGNMENT_512M > > > EFI_FVB2_ALIGNMENT_1G > > > EFI_FVB2_ALIGNMENT_2G > > > Header Length: 0x00000048 > > > File System ID: 5473c07a-3dcb-4dca-bd6f-1e9689e7349a > > > Revision: 0x0002 > > > Number of Blocks: 0x00000028 > > > Block Length: 0x00010000 > > > Total Volume Size: 0x00280000 > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D > > > =3D=3D > > > File Name: 9E21FD93-9C72-4C15-8C4B-E77F1DB2D792 > > > File Offset: 0x00000048 > > > File Length: 0x001F3FFD > > > File Attributes: 0x00 > > > File State: 0xF8 > > > EFI_FILE_DATA_VALID > > > File Type: 0x0B EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE > > > ------------------------------------------------------------ > > > Type: EFI_SECTION_GUID_DEFINED > > > Size: 0x001F3FE5 > > > SectionDefinitionGuid: ee4e5898-3914-4259-9d6e-dc7bd79403cf > > > > > > DataOffset: 0x0018 > > > Attributes: 0x0001 > > > ------------------------------------------------------------ > > > Type: EFI_SECTION_RAW > > > Size: 0x00000FF8 > > > ------------------------------------------------------------ > > > Type: EFI_SECTION_FIRMWARE_VOLUME_IMAGE > > > Size: 0x01010008 > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D > > > =3D=3D > > > > > > Thanks > > > Sean > > > _______________________________________________ > > > edk2-devel mailing list > > > edk2-devel@lists.01.org > > > https://lists.01.org/mailman/listinfo/edk2-devel > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel