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.web11.23919.1591304018414132223 for ; Thu, 04 Jun 2020 13:53:38 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=SU9PwmWi; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: jorge.hernandez.beltran@intel.com) IronPort-SDR: Diu2DTZn7KU5gXQsQttk8+R3MLdv7PgSqcsUE9UiZw+fMQznKgXCwVhbCEWjrXO+66yB0lYd/f 2MJcLLinlXoQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2020 13:53:37 -0700 IronPort-SDR: NIv9oQL+78nOid3RWLF+/KQrUROkIySgKKJppoH10Yj/vqoTnRpOhKNM6XsRh5pklu+a0ox4Xv U/iRxdQMb1Bg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,472,1583222400"; d="scan'208";a="471666434" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by fmsmga005.fm.intel.com with ESMTP; 04 Jun 2020 13:53:37 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 4 Jun 2020 13:53:35 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 4 Jun 2020 13:53:35 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 4 Jun 2020 13:53:35 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.101) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 4 Jun 2020 13:53:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VYqie+fwE4pjL59BdGHGnAqXTm9YGgSBQ+plFIB7obIpq+6mIgOzfItKhSE0jJA7pce8Sx1Uet4jyEIfVXm6Bu3PIvSYMx94e0UsrBvvxEgr0/39oCXyxrB8YeMv34oW6Wehr8v97gwAy5dkxMXsegXV1L7bza0lzmqcRMMvLSQoEOcBSKijsYnZApc38rJH9XJhiZT5e+2d5HLyFORyw3q8pn/8F4TSkVo+5Zn2+0L8qHkYm6jc8XyCPOUR4uVDbRX6tiNwnOVR7B3uz4Ui7m+3/xdwwITWFC4uzyEyMmVBmBEwKA/KC/C7FkgUJtdKgmx9YdilFnxi3Zz+breeGA== 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=kf3cGGaKav22qsy4FDtotuLsft2t7iXqyq06pPmQ+Yw=; b=Y/e2CIp47UaMnPwLBRBmxPyR+kfqYCG9lCdGPZGcsWpllQ/FvpSl74lCWosJ6jgOPWuJFZ43ir2A7k6RZS2q8PqAxRKddb4h4HGUGMS+i8xn4T11xg594twdED749yIL1sLVX+VjdjVDs817lvPmdIJxt4RCuDI7CcRVs7SRmKaHHeuxp0bbaVJUhj3vFSV2aXpOlEm9GM4fHmj2q2N6PozYIto1ecRXRG/pmubkHz8TNsqv8EfvGkoUc4iNsNc4UgSGYBJBKeRlPyPNo8Ho28Xw9yqOrkP3qm3P3i07celoqtdirYKW50xxi5MazJR1/VW0yvX+J62nqfHMIMaprQ== 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=kf3cGGaKav22qsy4FDtotuLsft2t7iXqyq06pPmQ+Yw=; b=SU9PwmWiJi1zyFAIS/978HexPK3sTtsHZuyQqmjcgpO66PJ/b4eNwV+HcaPSBJwi+UdHaHCt2GU3Ven/JfqMgo53BgbBo1AWBJCOydpDs38Ku8qiysMzEJnafgQ3uB985P94qVLgSq++fa6n7+CnC83ikFuusX9TATGHosqqqEM= Received: from MW3PR11MB4588.namprd11.prod.outlook.com (2603:10b6:303:54::19) by MW3PR11MB4522.namprd11.prod.outlook.com (2603:10b6:303:2d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.20; Thu, 4 Jun 2020 20:53:34 +0000 Received: from MW3PR11MB4588.namprd11.prod.outlook.com ([fe80::61c5:809c:cd86:d4c1]) by MW3PR11MB4588.namprd11.prod.outlook.com ([fe80::61c5:809c:cd86:d4c1%7]) with mapi id 15.20.3066.019; Thu, 4 Jun 2020 20:53:34 +0000 From: "Hernandez Beltran, Jorge" To: "Gao, Liming" , "Lohr, Paul A" , "devel@edk2.groups.io" Subject: Re: [Patch 1/1] [Edk2Platforms] FitGen: Update FitGen tool to be compliance with the FIT specification revision 1.2 Thread-Topic: [Patch 1/1] [Edk2Platforms] FitGen: Update FitGen tool to be compliance with the FIT specification revision 1.2 Thread-Index: AQHWNQ7dH+h/BeCJY0SgU+WraRwf8ajG/ScAgAAQtICAAFzQUIAAPG2AgAFSu5A= Date: Thu, 4 Jun 2020 20:53:34 +0000 Message-ID: References: <20200528164102.31576-1-jorge.hernandez.beltran@intel.com> 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: [189.205.200.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 335f6c28-c261-489e-8e99-08d808c958c3 x-ms-traffictypediagnostic: MW3PR11MB4522: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2276; x-forefront-prvs: 04244E0DC5 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Q3LiNzIZgYswh0yyhlz70c3j6VSIBPfuT2cHOZgLr3WI2NQFdlgvNCbqU6/FqGcMweOevOPGykf4vLk+lJgouroPOeTYGJ7cd84jLW6LcsjZi/QyuiRowp2MKGmWHXT36RlGxmslyrY8BzY0bH8SVMxUOba4liivW0KlEsGAdqodijgfn9SXzugssuP2OKBT8LmJSFm6IUIG5HFHCXxmI7Ky7J1F6YJpoXiel3mqzLZtS4PJfI8ufOY/v8DWjhArZXK1e2k9+jpnZwaDhawo9z2KldN3B0uV9aipgeO68hyBezacKy4GpR6r810G1lV7hxKbeyMYPfgarRjWZ5NdnOxN7VERw2b37hQ64vJRxEUWl8Wo0fzujdqhHG7FT0Fn5rTOndiX7tuRW8Ev1Tfgcw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR11MB4588.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(346002)(39860400002)(376002)(136003)(366004)(396003)(53546011)(6506007)(9686003)(110136005)(33656002)(26005)(478600001)(52536014)(83380400001)(30864003)(55016002)(5660300002)(2906002)(8936002)(66556008)(71200400001)(966005)(15650500001)(66946007)(66446008)(186003)(76116006)(86362001)(316002)(7696005)(64756008)(8676002)(66476007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: 5Cla+9A3BsMDNvmbGcT0W4r1O0QDa0HiwEXqXItR18PDkmfarcjSudbzZeFCzlYUQfXSKrvzZ3X8/zGmpvdbqZ6iyixkoM8VfL7/iuujA2Ivc5AkAUMSD2Yq9zorJ3tRE6q9zFRFz40jgR02TYcizhpL5a93henp2Zkfz/Wx/ZHOQQfrXeVFG9z/x6HnFlUWSYknJBKf6ThH7H++2NpzsDkfdl+VOMzVtCjpLK4nTGxT6v7j7HECmoW+p1dPiZX+1lsZwXQvNXfJjjG6CTQE8WAR5cCNsBnQJFRqzz6DTDMp1AToHuDkFZASBnZQkA6SzKHTdR+wGR9QBrZfj2dnoXVdvEjARbgofcTjanD2aSKrpxVeMSScwu0zvGj8HOmy4noeDDKFC1PDGoo2jazJTYspxY0L30H9/IhAN4iV9h+KsiE0Z7nEOnXuZShM6TMFVmPHe1Dw9epYLxtgnWzdFTCVKm3xIBt3xZ8fF1y5Ew1+3iHqsgPkD2VQmCiCrzkF MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 335f6c28-c261-489e-8e99-08d808c958c3 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jun 2020 20:53:34.2121 (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: 7m1UxW1GwLnJejPuGY4O5WEKy1EJdq7feggJ6oNJ/oQtMIuQb54mwuI0f0Xfkzi9OBQHpzmtsJmr8jwbicVP09/xzGEquDtfvTYf1MMyk9+MAx9x/oMcCpMAWvtvxTvY X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4522 Return-Path: jorge.hernandez.beltran@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable Thank for the info. I tried and indeed the subject now reflects the patch v= ersion. I already added this to my notes for future code reviews -----Original Message----- From: Gao, Liming =20 Sent: Wednesday, June 3, 2020 7:39 PM To: Hernandez Beltran, Jorge ; Lohr, Pau= l A ; devel@edk2.groups.io Subject: RE: [Patch 1/1] [Edk2Platforms] FitGen: Update FitGen tool to be c= ompliance with the FIT specification revision 1.2 Jorge: You can use git command git format-patch -1 --subject-prefix=3D"Patch V2"= to generate the patch.=20 Thanks Liming -----Original Message----- From: Hernandez Beltran, Jorge Sent: 2020=1B$BG/=1B(B6=1B$B7n=1B(B4=1B$BF|=1B(B 5:17 To: Lohr, Paul A ; Gao, Liming ; devel@edk2.groups.io Subject: RE: [Patch 1/1] [Edk2Platforms] FitGen: Update FitGen tool to be c= ompliance with the FIT specification revision 1.2 Done. I fixed the commit message issues regarding the format and I sent the= updated patch with "git send-email --compose --to=3Ddevel@edk2.groups.io..= ." command again. I added "-v2 --annotate" to indicate it was version 2 of the patch but I gu= ess it didn't work, subject from new email doesn't have the "[Patch v2 1/1]= " part I was expecting even after I set it manually when composing "the em= ail". @Gao, Liming If you know how to force subject to reflect the version, "[Pat= ch v2 1/1]", I would appreciate the help... -----Original Message----- From: Lohr, Paul A Sent: Wednesday, June 3, 2020 10:31 AM To: Gao, Liming ; Hernandez Beltran, Jorge ; devel@edk2.groups.io Subject: RE: [Patch 1/1] [Edk2Platforms] FitGen: Update FitGen tool to be c= ompliance with the FIT specification revision 1.2 Thanks Liming. I agree the code changes look good. Paul A. Lohr ? Server Firmware Enabling 512.239.9073 (cell) 512.794.5044 (work) -----Original Message----- From: Gao, Liming Sent: Wednesday, June 3, 2020 9:31 AM To: Hernandez Beltran, Jorge ; devel@edk= 2.groups.io Cc: Lohr, Paul A Subject: RE: [Patch 1/1] [Edk2Platforms] FitGen: Update FitGen tool to be c= ompliance with the FIT specification revision 1.2 Jorge: The patch is good. But, the commit message is too long than 80. Please up= date the commit message to be short. You can use edk2\BaseTools\Scripts\PatchCheck.py tool to check the patch = format. =20 =20 With the commit message change, Reviewed-by: Liming Gao Thanks Liming > -----Original Message----- > From: Hernandez Beltran, Jorge > Sent: Friday, May 29, 2020 12:41 AM > To: devel@edk2.groups.io > Cc: Gao, Liming ; Lohr, Paul A=20 > ; Hernandez Beltran, Jorge=20 > > Subject: [Patch 1/1] [Edk2Platforms] FitGen: Update FitGen tool to be=20 > compliance with the FIT specification revision 1.2 >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2687 >=20 > FIT specification revision 1.2 was recently released to the open commun= ity. > Revision 1.2 updates CSE Secure Boot Rules in section 4.12, and adds 2 = new entry > sub-types used to distinguish the CSE entries. >=20 > Signed-off-by: Jorge Hernandez Beltran=20 > > --- > Silicon/Intel/Tools/FitGen/FitGen.c | 152 +++++++++++++++++++++++++++---= ------ > Silicon/Intel/Tools/FitGen/FitGen.h | 2 +- > 2 files changed, 114 insertions(+), 40 deletions(-) >=20 > diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c > b/Silicon/Intel/Tools/FitGen/FitGen.c > index 75d8932d90ac..c4006e69c822 100644 > --- a/Silicon/Intel/Tools/FitGen/FitGen.c > +++ b/Silicon/Intel/Tools/FitGen/FitGen.c > @@ -226,6 +226,8 @@ typedef struct { > #define FIT_TABLE_TYPE_BOOT_POLICY_MANIFEST 12 > #define FIT_TABLE_TYPE_BIOS_DATA_AREA 13 > #define FIT_TABLE_TYPE_CSE_SECURE_BOOT 16 > +#define FIT_TABLE_SUBTYPE_FIT_PATCH_MANIFEST 12 > +#define FIT_TABLE_SUBTYPE_ACM_MANIFEST 13 >=20 > // > // With OptionalModule Address isn't known until free space has been=20 > @@ -236,6 +238,7 @@ typedef struct { // typedef struct { > UINT32 Type; > + UINT32 SubType; // Used by OptionalModule only > UINT32 Address; > UINT8 *Buffer; // Used by OptionalModule only > UINT32 Size; > @@ -295,7 +298,7 @@ Returns: > --*/ > { > printf ( > - "%s - Tiano IA32/X64 FIT table generation Utility for FIT spec revis= ion 1.1."" Version %i.%i\n\n", > + "%s - Tiano IA32/X64 FIT table generation Utility for FIT spec=20 > + revision 1.2."" Version %i.%i\n\n", > UTILITY_NAME, > UTILITY_MAJOR_VERSION, > UTILITY_MINOR_VERSION > @@ -334,7 +337,7 @@ Returns: > "\t[-U |]\n" > "\t[-B ] [-B ...] [-V ]\n" > "\t[-M ] [-M ...]|[-U=20 > | MicrocodeRegionSize>|] [-V ]\n" > - "\t[-O RecordType ||| [-V > ]] [-O ... [-V ...]]\n" > + "\t[-O RecordType + RecordDataSize>| RecordDataSize>||| [-V ]] [-O ... [-V ...]]\n" > "\t[-P RecordType [-V ]] [-P ... [-V ...]]\n" > , UTILITY_NAME); > printf (" Where:\n"); > @@ -366,6 +369,7 @@ Returns: > printf ("\tRecordDataSize - FIT entry record data size.\n"); > printf ("\tRecordDataGuid - FIT entry record data GUID.\n"); > printf ("\tRecordBinFile - FIT entry record data binary file.= \n"); > + printf ("\tCseRecordSubType - FIT entry record subtype. Use to f= urther distinguish CSE entries (see FIT spec revision 1.2 chapter > 4.12).\n"); > printf ("\tFitEntryDefaultVersion - The default version for all FIT=20 > table entries. 0x%04x is used if this is not specified.\n", DEFAULT_FIT_E= NTRY_VERSION); > printf ("\tFitHeaderVersion - The version for FIT header. (Overr= ide default version)\n"); > printf ("\tStartupAcmVersion - The version for StartupAcm. (Overr= ide default version)\n"); > @@ -857,6 +861,7 @@ Returns: > UINT8 *FileBuffer; > UINT32 FileSize; > UINT32 Type; > + UINT32 SubType; > UINT8 *MicrocodeFileBuffer; > UINT8 *MicrocodeFileBufferRaw; > UINT32 MicrocodeFileSize; > @@ -1608,26 +1613,22 @@ Returns: > } > Type =3D xtoi (argv[Index + 1]); > // > - // 1st, try GUID > + // 1st, try CSE entry sub-type > // > - if (IsGuidData (argv[Index + 2], &Guid)) { > - FileBuffer =3D FindFileFromFvByGuid (FdBuffer, FdSize, &Guid, &Fil= eSize); > - if (FileBuffer =3D=3D NULL) { > - Error (NULL, 0, 0, "-O Parameter incorrect, GUID not found!", "%= s", argv[Index + 2]); > - // not found > - return 0; > - } > - if (FileSize >=3D 0x80000000) { > - Error (NULL, 0, 0, "-O Parameter incorrect, FileSize too large!"= , NULL); > - return 0; > + SubType =3D 0; > + if (Type =3D=3D FIT_TABLE_TYPE_CSE_SECURE_BOOT) { > + if (Index + 3 >=3D argc) { > + break; > } > - FileBuffer =3D (UINT8 *)MEMORY_TO_FLASH (FileBuffer, FdBuffer, FdS= ize); > - Index +=3D 3; > - } else { > + SubType =3D xtoi (argv[Index + 2]); > // > - // 2nd, try file > + // try file > // > - Status =3D ReadInputFile (argv[Index + 2], &FileBuffer, &FileSize,= NULL); > + if (SubType !=3D FIT_TABLE_SUBTYPE_FIT_PATCH_MANIFEST && SubType != =3D FIT_TABLE_SUBTYPE_ACM_MANIFEST) { > + Error (NULL, 0, 0, "-O Parameter incorrect, SubType unsupported!= ", NULL); > + return 0; > + } > + Status =3D ReadInputFile (argv[Index + 3], &FileBuffer,=20 > + &FileSize, NULL); > if (Status =3D=3D STATUS_SUCCESS) { > if (FileSize >=3D 0x80000000) { > Error (NULL, 0, 0, "-O Parameter incorrect, FileSize too=20 > large!", NULL); @@ -1640,48 +1641,90 @@ Returns: > // Assume the file size should < 2G. > // > FileSize |=3D 0x80000000; > + Index +=3D 4; > + } else { > + if (Status =3D=3D STATUS_WARNING) { > + Error (NULL, 0, 0, "-O Parameter incorrect, Unable to open fil= e", argv[Index + 3]); > + } > + return 0; > + } > + } else { > + // > + // 2nd, try GUID > + // > + if (IsGuidData (argv[Index + 2], &Guid)) { > + FileBuffer =3D FindFileFromFvByGuid (FdBuffer, FdSize, &Guid, &F= ileSize); > + if (FileBuffer =3D=3D NULL) { > + Error (NULL, 0, 0, "-O Parameter incorrect, GUID not found!", = "%s", argv[Index + 2]); > + // not found > + return 0; > + } > + if (FileSize >=3D 0x80000000) { > + Error (NULL, 0, 0, "-O Parameter incorrect, FileSize too large= !", NULL); > + return 0; > + } > + FileBuffer =3D (UINT8 *)MEMORY_TO_FLASH (FileBuffer, FdBuffer,=20 > + FdSize); > Index +=3D 3; > } else { > // > - // 3rd, try > + // 3rd, try file > // > - if (Index + 3 >=3D argc) { > - break; > - } > - if ((strcmp (argv[Index + 2], "RESERVE") =3D=3D 0) || > - (strcmp (argv[Index + 2], "reserve") =3D=3D 0)) { > - FileSize =3D xtoi (argv[Index + 3]); > + Status =3D ReadInputFile (argv[Index + 2], &FileBuffer, &FileSiz= e, NULL); > + if (Status =3D=3D STATUS_SUCCESS) { > if (FileSize >=3D 0x80000000) { > Error (NULL, 0, 0, "-O Parameter incorrect, FileSize too=20 > large!", NULL); > + free (FileBuffer); > return 0; > } > - FileBuffer =3D malloc (FileSize); > - if (FileBuffer =3D=3D NULL) { > - Error (NULL, 0, 0, "No sufficient memory to allocate!", NULL= ); > - return 0; > - } > - SetMem (FileBuffer, FileSize, 0xFF); > // > // Set the most significant bit > // It means the data in memory, not in flash yet. > // Assume the file size should < 2G. > // > FileSize |=3D 0x80000000; > - Index +=3D 4; > + Index +=3D 3; > } else { > // > - // 4th, try > + // 4th, try > // > if (Index + 3 >=3D argc) { > break; > } > - FileBuffer =3D (UINT8 *) (UINTN) xtoi (argv[Index + 2]); > - FileSize =3D xtoi (argv[Index + 3]); > - if (FileSize >=3D 0x80000000) { > - Error (NULL, 0, 0, "-O Parameter incorrect, FileSize too lar= ge!", NULL); > - return 0; > + if ((strcmp (argv[Index + 2], "RESERVE") =3D=3D 0) || > + (strcmp (argv[Index + 2], "reserve") =3D=3D 0)) { > + FileSize =3D xtoi (argv[Index + 3]); > + if (FileSize >=3D 0x80000000) { > + Error (NULL, 0, 0, "-O Parameter incorrect, FileSize too l= arge!", NULL); > + return 0; > + } > + FileBuffer =3D malloc (FileSize); > + if (FileBuffer =3D=3D NULL) { > + Error (NULL, 0, 0, "No sufficient memory to allocate!", NU= LL); > + return 0; > + } > + SetMem (FileBuffer, FileSize, 0xFF); > + // > + // Set the most significant bit > + // It means the data in memory, not in flash yet. > + // Assume the file size should < 2G. > + // > + FileSize |=3D 0x80000000; > + Index +=3D 4; > + } else { > + // > + // 5th, try > + // > + if (Index + 3 >=3D argc) { > + break; > + } > + FileBuffer =3D (UINT8 *) (UINTN) xtoi (argv[Index + 2]); > + FileSize =3D xtoi (argv[Index + 3]); > + if (FileSize >=3D 0x80000000) { > + Error (NULL, 0, 0, "-O Parameter incorrect, FileSize too l= arge!", NULL); > + return 0; > + } > + Index +=3D 4; > } > - Index +=3D 4; > } > } > } > @@ -1691,6 +1734,9 @@ Returns: > return 0; > } > =20 > gFitTableContext.OptionalModule[gFitTableContext.OptionalModuleNumber] > .Type =3D Type; > + if (gFitTableContext.OptionalModule[gFitTableContext.OptionalModuleN= umber].Type =3D=3D FIT_TABLE_TYPE_CSE_SECURE_BOOT) { > + gFitTableContext.OptionalModule[gFitTableContext.OptionalModuleNum= ber].SubType =3D SubType; > + } > =20 > gFitTableContext.OptionalModule[gFitTableContext.OptionalModuleNumber] > .Address =3D (UINT32) (UINTN) FileBuffer; > =20 > gFitTableContext.OptionalModule[gFitTableContext.OptionalModuleNumber] > .Buffer =3D FileBuffer; > =20 > gFitTableContext.OptionalModule[gFitTableContext.OptionalModuleNumber].Si= ze =3D FileSize; @@ -2055,6 +2101,23 @@ Returns: > return ; > } >=20 > +CHAR8 *mFitCseSubTypeStr[] =3D { > + "CSE_RSVD ", > + "CSE_K_HASH1", > + "CSE_M_HASH ", > + "CSE_BPOLICY", > + "CSE_OTHR_BP", > + "CSE_OEMSMIP", > + "CSE_MRCDATA", > + "CSE_IBBL_H ", > + "CSE_IBB_H ", > + "CSE_OEM_ID ", > + "CSEOEMSKUID", > + "CSE_BD_IND ", > + "CSE_FPM ", > + "CSE_ACMM " > +}; > + > CHAR8 *mFitTypeStr[] =3D { > " ", > "MICROCODE ", > @@ -2103,6 +2166,14 @@ Returns: > return mFitSignatureInHeader; > } > if (FitEntry->Type < sizeof (mFitTypeStr)/sizeof(mFitTypeStr[0])) { > + if (FitEntry->Type =3D=3D FIT_TABLE_TYPE_CSE_SECURE_BOOT) { > + // > + // "Reserved" field is used to distinguish CSE Secure Boot entries= (see FIT spec revision 1.2) > + // > + if (FitEntry->Rsvd < sizeof (mFitCseSubTypeStr)/sizeof(mFitCseSubT= ypeStr[0])) { > + return mFitCseSubTypeStr[FitEntry->Rsvd]; > + } > + } > return mFitTypeStr[FitEntry->Type]; > } else { > return " "; > @@ -2675,6 +2746,9 @@ Returns: > *(UINT32 *)&FitEntry[FitIndex].Size[0] =3D gFitTableContext.Optional= Module[Index].Size; > FitEntry[FitIndex].Version =3D (UINT16)gFitTableContext.= OptionalModule[Index].Version; > FitEntry[FitIndex].Type =3D (UINT8)gFitTableContext.O= ptionalModule[Index].Type; > + if (FitEntry[FitIndex].Type =3D=3D FIT_TABLE_TYPE_CSE_SECURE_BOOT) { > + FitEntry[FitIndex].Rsvd =3D (UINT8)gFitTableContext.O= ptionalModule[Index].SubType; > + } > FitEntry[FitIndex].C_V =3D 0; > FitEntry[FitIndex].Checksum =3D 0; > FitIndex++; > diff --git a/Silicon/Intel/Tools/FitGen/FitGen.h > b/Silicon/Intel/Tools/FitGen/FitGen.h > index cb9274b4175e..abad2d8799c8 100644 > --- a/Silicon/Intel/Tools/FitGen/FitGen.h > +++ b/Silicon/Intel/Tools/FitGen/FitGen.h > @@ -31,7 +31,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent //=20 > Utility version information // #define UTILITY_MAJOR_VERSION 0=20 > -#define UTILITY_MINOR_VERSION 61 > +#define UTILITY_MINOR_VERSION 62 > #define UTILITY_DATE __DATE__ >=20 > // > -- > 2.16.2.windows.1