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.22361.1581343798218846738 for ; Mon, 10 Feb 2020 06:09:58 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Feb 2020 06:09:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,425,1574150400"; d="scan'208";a="380113442" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga004.jf.intel.com with ESMTP; 10 Feb 2020 06:09:57 -0800 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 10 Feb 2020 06:09:56 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX603.ccr.corp.intel.com (10.109.6.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 10 Feb 2020 22:09:54 +0800 Received: from shsmsx606.ccr.corp.intel.com ([10.109.6.216]) by SHSMSX606.ccr.corp.intel.com ([10.109.6.216]) with mapi id 15.01.1713.004; Mon, 10 Feb 2020 22:09:54 +0800 From: "Liming Gao" To: "Agrawal, Sachin" , "devel@edk2.groups.io" CC: "Feng, Bob C" Subject: Re: [PATCH v2] Add support for Diagnostics ACM in FitGen tool Thread-Topic: [PATCH v2] Add support for Diagnostics ACM in FitGen tool Thread-Index: AQHV3gZ0MtaA8DR/w0W2heV9syjl5KgUe3jg Date: Mon, 10 Feb 2020 14:09:54 +0000 Message-ID: <8ccffd3291d6466d9b68c1497a57ded5@intel.com> References: <20200207223213.28608-1-sachin.agrawal@intel.com> In-Reply-To: <20200207223213.28608-1-sachin.agrawal@intel.com> 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 x-originating-ip: [10.239.127.36] MIME-Version: 1.0 Return-Path: liming.gao@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: Agrawal, Sachin > Sent: Saturday, February 8, 2020 6:32 AM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > Subject: [PATCH v2] Add support for Diagnostics ACM in FitGen tool >=20 > From: "Agrawal, Sachin" >=20 > REF https://bugzilla.tianocore.org/show_bug.cgi?id=3D2200 >=20 > FitGen Tool is responsible for creating FIT table in UEFI BIOS. > A new FIT entry type (FIT Type 0x3) has been allocated for Diagnsotics AC= M. > FitGen tool is updated to add support for this Diagnostics ACM. >=20 > Cc: Bob Feng > Cc: Liming Gao >=20 > Signed-off-by: Sachin Agrawal > --- >=20 > Notes: > v2: > -Remove CheckOverlap call for Diagnostics ACM > -Updated Minor version to 59 >=20 > Silicon/Intel/Tools/FitGen/FitGen.c | 67 ++++++++++++++++++++ > Silicon/Intel/Tools/FitGen/FitGen.h | 2 +- > 2 files changed, 68 insertions(+), 1 deletion(-) >=20 > diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c b/Silicon/Intel/Tools/Fi= tGen/FitGen.c > index 5f5638dc8b..8122c10ebb 100644 > --- a/Silicon/Intel/Tools/FitGen/FitGen.c > +++ b/Silicon/Intel/Tools/FitGen/FitGen.c > @@ -217,6 +217,7 @@ typedef struct { > #define FIT_TABLE_TYPE_HEADER 0 > #define FIT_TABLE_TYPE_MICROCODE 1 > #define FIT_TABLE_TYPE_STARTUP_ACM 2 > +#define FIT_TABLE_TYPE_DIAGNST_ACM 3 > #define FIT_TABLE_TYPE_BIOS_MODULE 7 > #define FIT_TABLE_TYPE_TPM_POLICY 8 > #define FIT_TABLE_TYPE_BIOS_POLICY 9 > @@ -254,6 +255,8 @@ typedef struct { > UINT32 FitHeaderVersion; > FIT_TABLE_CONTEXT_ENTRY StartupAcm; > UINT32 StartupAcmVersion; > + FIT_TABLE_CONTEXT_ENTRY DiagnstAcm; > + UINT32 DiagnstAcmVersion; > FIT_TABLE_CONTEXT_ENTRY BiosModule[MAX_BIOS_MODULE_ENTRY]; > UINT32 BiosModuleVersion; > FIT_TABLE_CONTEXT_ENTRY Microcode[MAX_MICROCODE_ENTRY]; > @@ -326,6 +329,7 @@ Returns: > "\t[-L ]\n" > "\t[-I ]\n" > "\t[-S |] [-= V ]\n" > + "\t[-U |]\n" > "\t[-B ] [-B ...] [-V ]\n" > "\t[-M ] [-M ...]|[-U | MicrocodeRegionSize>|] [-V ]\n" > "\t[-O RecordType ||| [-V > ]] [-O ... [-V ...]]\n" > @@ -340,6 +344,8 @@ Returns: > printf ("\tStartupAcmAddress - Address of StartupAcm.\n"); > printf ("\tStartupAcmSize - Size of StartupAcm.\n"); > printf ("\tStartupAcmGuid - Guid of StartupAcm Module, if Star= tupAcm is in a BiosModule, it will be excluded form that.\n"); > + printf ("\tDiagnstAcmAddress - Address of DiagnstAcm.\n"); > + printf ("\tDiagnstAcmGuid - Guid of DiagnstAcm Module, if Diag= nstAcm is in a BiosModule, it will be excluded from that.\n"); > printf ("\tBiosModuleAddress - Address of BiosModule. User should= ensure there is no overlap.\n"); > printf ("\tBiosModuleSize - Size of BiosModule.\n"); > printf ("\tMicrocodeAddress - Address of Microcode.\n"); > @@ -1029,6 +1035,17 @@ Returns: > gFitTableContext.StartupAcmVersion =3D BiosInfoStruct[BiosInf= oIndex].Version; > gFitTableContext.FitEntryNumber ++; > break; > + case FIT_TABLE_TYPE_DIAGNST_ACM: > + if (gFitTableContext.DiagnstAcm.Type !=3D 0) { > + Error (NULL, 0, 0, "-U Parameter incorrect, Duplicated Diagn= osticsAcm!", NULL); > + return 0; > + } > + gFitTableContext.DiagnstAcm.Type =3D FIT_TABLE_TYPE_DIAGNST= _ACM; > + gFitTableContext.DiagnstAcm.Address =3D (UINT32)BiosInfoStruct= [BiosInfoIndex].Address; > + gFitTableContext.DiagnstAcm.Size =3D 0; > + gFitTableContext.DiagnstAcmVersion =3D DEFAULT_FIT_ENTRY_VERS= ION; > + gFitTableContext.FitEntryNumber ++; > + break; > case FIT_TABLE_TYPE_BIOS_MODULE: > if ((BiosInfoStruct[BiosInfoIndex].Attributes & BIOS_INFO_STRU= CT_ATTRIBUTE_BIOS_POST_IBB) !=3D 0) { > continue; > @@ -1261,6 +1278,40 @@ Returns: > } while (FALSE); >=20 > // > + // 1.5. DiagnosticsAcm > + // > + do { > + if ((Index + 1 >=3D argc) || > + ((strcmp (argv[Index], "-U") !=3D 0) && > + (strcmp (argv[Index], "-u") !=3D 0)) ) { > + if (BiosInfoExist && (gFitTableContext.DiagnstAcm.Type =3D=3D FIT_= TABLE_TYPE_DIAGNST_ACM)) { > + break; > + } > + break; > + } > + if (IsGuidData (argv[Index + 1], &Guid)) { > + FileBuffer =3D FindFileFromFvByGuid (FdBuffer, FdSize, &Guid, &Fil= eSize); > + if (FileBuffer =3D=3D NULL) { > + Error (NULL, 0, 0, "-U Parameter incorrect, GUID not found!", "%= s", argv[Index + 1]); > + return 0; > + } > + FileBuffer =3D (UINT8 *)MEMORY_TO_FLASH (FileBuffer, FdBuffer, FdS= ize); > + Index +=3D 2; > + } else { > + FileBuffer =3D (UINT8 *) (UINTN) xtoi (argv[Index + 1]); > + Index +=3D 2; > + } > + if (gFitTableContext.DiagnstAcm.Type !=3D 0) { > + Error (NULL, 0, 0, "-U Parameter incorrect, Duplicated Diagnostics= Acm!", NULL); > + return 0; > + } > + gFitTableContext.DiagnstAcm.Type =3D FIT_TABLE_TYPE_DIAGNST_ACM; > + gFitTableContext.DiagnstAcm.Address =3D (UINT32) (UINTN) FileBuffer; > + gFitTableContext.DiagnstAcm.Size =3D 0; > + gFitTableContext.FitEntryNumber ++; > + gFitTableContext.DiagnstAcmVersion =3D DEFAULT_FIT_ENTRY_VERSION; > + } while (FALSE); > + > // 2. BiosModule > // > do { > @@ -1933,6 +1984,9 @@ Returns: > if (gFitTableContext.StartupAcm.Address !=3D 0) { > printf ("StartupAcm - (0x%08x, 0x%08x, 0x%04x)\n", gFitTableContext.= StartupAcm.Address, gFitTableContext.StartupAcm.Size, > gFitTableContext.StartupAcmVersion); > } > + if (gFitTableContext.DiagnstAcm.Address !=3D 0) { > + printf ("DiagnosticAcm - (0x%08x, 0x%08x, 0x%04x)\n", gFitTableConte= xt.DiagnstAcm.Address, gFitTableContext.DiagnstAcm.Size, > gFitTableContext.DiagnstAcmVersion); > + } > for (Index =3D 0; Index < gFitTableContext.BiosModuleNumber; Index++) = { > printf ("BiosModule[%d] - (0x%08x, 0x%08x, 0x%04x)\n", Index, gFitTa= bleContext.BiosModule[Index].Address, > gFitTableContext.BiosModule[Index].Size, gFitTableContext.BiosModuleVersi= on); > } > @@ -1957,6 +2011,7 @@ CHAR8 *mFitTypeStr[] =3D { > " ", > "MICROCODE ", > "STARTUP_ACM", > + "DIAGNST_ACM", > " ", > " ", > " ", > @@ -2525,6 +2580,18 @@ Returns: > FitIndex++; > } >=20 > + // > + // 4.5. DiagnosticAcm > + // > + if (gFitTableContext.DiagnstAcm.Address !=3D 0) { > + FitEntry[FitIndex].Address =3D gFitTableContext.DiagnstA= cm.Address; > + *(UINT32 *)&FitEntry[FitIndex].Size[0] =3D 0; > + FitEntry[FitIndex].Version =3D (UINT16)gFitTableContext.= DiagnstAcmVersion; > + FitEntry[FitIndex].Type =3D FIT_TABLE_TYPE_DIAGNST_AC= M; > + FitEntry[FitIndex].C_V =3D 0; > + FitEntry[FitIndex].Checksum =3D 0; > + FitIndex++; > + } > // > // 5. BiosModule > // > diff --git a/Silicon/Intel/Tools/FitGen/FitGen.h b/Silicon/Intel/Tools/Fi= tGen/FitGen.h > index 4d0a2dc6f8..fdf535924c 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 > // Utility version information > // > #define UTILITY_MAJOR_VERSION 0 > -#define UTILITY_MINOR_VERSION 58 > +#define UTILITY_MINOR_VERSION 59 > #define UTILITY_DATE __DATE__ >=20 > // > -- > 2.14.3.windows.1