From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web12.4447.1588994891094276752 for ; Fri, 08 May 2020 20:28:11 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: ray.ni@intel.com) IronPort-SDR: jTOS/As0p7lP5qsYLTkk97/OGanH64hSXdNN8ndlm+ABFtKOBkIlkq3d4ovksYFX8hjhOyS4FM wM0TtO/vF1QQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2020 20:28:10 -0700 IronPort-SDR: r8cCfGRG5PShxse+rPKa6OPm1X800rnjUs3AZJX9VeeJLuorKu1FJwWPaqu2ZGOVzSatg4iu6t VXaU822JyGTQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,370,1583222400"; d="scan'208";a="462510316" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga005.fm.intel.com with ESMTP; 08 May 2020 20:28:10 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 8 May 2020 20:28:10 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 8 May 2020 20:28:09 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.210]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.225]) with mapi id 14.03.0439.000; Sat, 9 May 2020 11:28:07 +0800 From: "Ni, Ray" To: "Feng, YunhuaX" , "devel@edk2.groups.io" CC: "Feng, Bob C" , "Gao, Liming" Subject: Re: [edk2-staging][PATCH] BaseTools/Fmmt: Fix found the next FFS issue Thread-Topic: [edk2-staging][PATCH] BaseTools/Fmmt: Fix found the next FFS issue Thread-Index: AdYlpUzbYGIqiayXSXG6NdcZlBf1zAABoBJAAAAVEAAAAVfW4A== Date: Sat, 9 May 2020 03:28:06 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C530BB7@SHSMSX104.ccr.corp.intel.com> References: <734D49CCEBEEF84792F5B80ED585239D5C530A62@SHSMSX104.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Ok can you add comments to explain: 1. Why 0xFF instead of 0x00 is used as a condition of break (I am not clea= r). 2. Why 0xFFFFFF is used (I am clear now thanks for the explanation. Please= explain in comments). > -----Original Message----- > From: Feng, YunhuaX > Sent: Saturday, May 9, 2020 11:21 AM > To: Ni, Ray ; devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > Subject: RE: [edk2-staging][PATCH] BaseTools/Fmmt: Fix found the next FF= S issue >=20 > Hi Ray, > I have checked the EFI_FFS_FILE_HEADER, the Size only 3 bytes, GetFf= sFileLength only return 0xFFFFFF. I not found existing > macro >=20 > typedef struct { > EFI_GUID Name; > EFI_FFS_INTEGRITY_CHECK IntegrityCheck; > EFI_FV_FILETYPE Type; > EFI_FFS_FILE_ATTRIBUTES Attributes; > UINT8 Size[3]; > EFI_FFS_FILE_STATE State; > } EFI_FFS_FILE_HEADER >=20 >=20 > -----Original Message----- > From: Ni, Ray > Sent: Saturday, May 9, 2020 10:46 AM > To: devel@edk2.groups.io; Feng, YunhuaX > Cc: Feng, Bob C ; Gao, Liming > Subject: RE: [edk2-staging][PATCH] BaseTools/Fmmt: Fix found the next FF= S issue >=20 > Yunhua, > Why the comparison is against 0xFFFFFF not 0xFFFFFFFF? >=20 > Is there any existing macro that you can use? >=20 > Thanks, > Ray >=20 > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of Feng, Y= unhuaX > > Sent: Saturday, May 9, 2020 9:59 AM > > To: devel@edk2.groups.io > > Cc: Feng, Bob C ; Gao, Liming > > Subject: [edk2-devel] [edk2-staging][PATCH] BaseTools/Fmmt: Fix found = the next FFS issue > > > > if found the next FFS size equal 0xFFFFFF, return NOT_FOUND > > > > Cc: Bob Feng > > Cc: Liming Gao > > > > Signed-off-by: Yunhua Feng > > --- > > BaseTools/Source/C/FMMT/FmmtLib.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/BaseTools/Source/C/FMMT/FmmtLib.c b/BaseTools/Source/C/FM= MT/FmmtLib.c > > index cdbee3d629..4fb10ecfe6 100644 > > --- a/BaseTools/Source/C/FMMT/FmmtLib.c > > +++ b/BaseTools/Source/C/FMMT/FmmtLib.c > > @@ -1769,10 +1769,13 @@ FvBufFindNextFile ( > > (*Key + sizeof (*fhdr)) < fvSize; > > *Key =3D (UINTN)ALIGN_POINTER (*Key, 8) > > ) { > > fhdr =3D (EFI_FFS_FILE_HEADER*) ((UINT8*)hdr + *Key); > > fsize =3D GetFfsFileLength (fhdr); > > + if (fsize =3D=3D 0xffffff) { > > + break; > > + } > > if (!EFI_TEST_FFS_ATTRIBUTES_BIT( > > FvbAttributes, > > fhdr->State, > > EFI_FILE_HEADER_VALID > > ) || > > -- > > 2.12.2.windows.2 > > > > > >=20 >=20 >=20