From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.6278.1581399451065276681 for ; Mon, 10 Feb 2020 21:37:31 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Feb 2020 21:37:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,427,1574150400"; d="scan'208";a="227404730" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga008.fm.intel.com with ESMTP; 10 Feb 2020 21:37:30 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 10 Feb 2020 21:37:30 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX606.ccr.corp.intel.com (10.109.6.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 11 Feb 2020 13:37:25 +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; Tue, 11 Feb 2020 13:37:25 +0800 From: "Liming Gao" To: "devel@edk2.groups.io" , "Gao, Liming" , "Agrawal, Sachin" CC: "Feng, Bob C" Subject: Re: [edk2-devel] [PATCH v2] Add support for Diagnostics ACM in FitGen tool Thread-Topic: [edk2-devel] [PATCH v2] Add support for Diagnostics ACM in FitGen tool Thread-Index: AQHV3gZ0MtaA8DR/w0W2heV9syjl5KgUe3jggAEDHnA= Date: Tue, 11 Feb 2020 05:37:25 +0000 Message-ID: References: <20200207223213.28608-1-sachin.agrawal@intel.com> <15F20FCE7331F072.7072@groups.io> In-Reply-To: <15F20FCE7331F072.7072@groups.io> 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 Push @ 8864a1ad2f090e8f71bb4a5da873baf903f5e053 > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Liming Ga= o > Sent: Monday, February 10, 2020 10:10 PM > To: Agrawal, Sachin ; devel@edk2.groups.io > Cc: Feng, Bob C > Subject: Re: [edk2-devel] [PATCH v2] Add support for Diagnostics ACM in = FitGen tool >=20 > Reviewed-by: Liming Gao >=20 > > -----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 > > > > From: "Agrawal, Sachin" > > > > REF https://bugzilla.tianocore.org/show_bug.cgi?id=3D2200 > > > > FitGen Tool is responsible for creating FIT table in UEFI BIOS. > > A new FIT entry type (FIT Type 0x3) has been allocated for Diagnsotics= ACM. > > FitGen tool is updated to add support for this Diagnostics ACM. > > > > Cc: Bob Feng > > Cc: Liming Gao > > > > Signed-off-by: Sachin Agrawal > > --- > > > > Notes: > > v2: > > -Remove CheckOverlap call for Diagnostics ACM > > -Updated Minor version to 59 > > > > Silicon/Intel/Tools/FitGen/FitGen.c | 67 ++++++++++++++++++++ > > Silicon/Intel/Tools/FitGen/FitGen.h | 2 +- > > 2 files changed, 68 insertions(+), 1 deletion(-) > > > > diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c b/Silicon/Intel/Tools= /FitGen/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 S= tartupAcm is in a BiosModule, it will be excluded form that.\n"); > > + printf ("\tDiagnstAcmAddress - Address of DiagnstAcm.\n"); > > + printf ("\tDiagnstAcmGuid - Guid of DiagnstAcm Module, if D= iagnstAcm is in a BiosModule, it will be excluded from that.\n"); > > printf ("\tBiosModuleAddress - Address of BiosModule. User sho= uld 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[Bios= InfoIndex].Version; > > gFitTableContext.FitEntryNumber ++; > > break; > > + case FIT_TABLE_TYPE_DIAGNST_ACM: > > + if (gFitTableContext.DiagnstAcm.Type !=3D 0) { > > + Error (NULL, 0, 0, "-U Parameter incorrect, Duplicated Di= agnosticsAcm!", NULL); > > + return 0; > > + } > > + gFitTableContext.DiagnstAcm.Type =3D FIT_TABLE_TYPE_DIAG= NST_ACM; > > + gFitTableContext.DiagnstAcm.Address =3D (UINT32)BiosInfoStr= uct[BiosInfoIndex].Address; > > + gFitTableContext.DiagnstAcm.Size =3D 0; > > + gFitTableContext.DiagnstAcmVersion =3D DEFAULT_FIT_ENTRY_V= ERSION; > > + gFitTableContext.FitEntryNumber ++; > > + break; > > case FIT_TABLE_TYPE_BIOS_MODULE: > > if ((BiosInfoStruct[BiosInfoIndex].Attributes & BIOS_INFO_S= TRUCT_ATTRIBUTE_BIOS_POST_IBB) !=3D 0) { > > continue; > > @@ -1261,6 +1278,40 @@ Returns: > > } while (FALSE); > > > > // > > + // 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 F= IT_TABLE_TYPE_DIAGNST_ACM)) { > > + break; > > + } > > + break; > > + } > > + if (IsGuidData (argv[Index + 1], &Guid)) { > > + FileBuffer =3D FindFileFromFvByGuid (FdBuffer, FdSize, &Guid, &= FileSize); > > + 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, = FdSize); > > + 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 Diagnost= icsAcm!", NULL); > > + return 0; > > + } > > + gFitTableContext.DiagnstAcm.Type =3D FIT_TABLE_TYPE_DIAGNST_ACM; > > + gFitTableContext.DiagnstAcm.Address =3D (UINT32) (UINTN) FileBuff= er; > > + 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", gFitTableConte= xt.StartupAcm.Address, gFitTableContext.StartupAcm.Size, > > gFitTableContext.StartupAcmVersion); > > } > > + if (gFitTableContext.DiagnstAcm.Address !=3D 0) { > > + printf ("DiagnosticAcm - (0x%08x, 0x%08x, 0x%04x)\n", gFitTableCo= ntext.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, gFi= tTableContext.BiosModule[Index].Address, > > gFitTableContext.BiosModule[Index].Size, gFitTableContext.BiosModuleVe= rsion); > > } > > @@ -1957,6 +2011,7 @@ CHAR8 *mFitTypeStr[] =3D { > > " ", > > "MICROCODE ", > > "STARTUP_ACM", > > + "DIAGNST_ACM", > > " ", > > " ", > > " ", > > @@ -2525,6 +2580,18 @@ Returns: > > FitIndex++; > > } > > > > + // > > + // 4.5. DiagnosticAcm > > + // > > + if (gFitTableContext.DiagnstAcm.Address !=3D 0) { > > + FitEntry[FitIndex].Address =3D gFitTableContext.Diagn= stAcm.Address; > > + *(UINT32 *)&FitEntry[FitIndex].Size[0] =3D 0; > > + FitEntry[FitIndex].Version =3D (UINT16)gFitTableConte= xt.DiagnstAcmVersion; > > + FitEntry[FitIndex].Type =3D FIT_TABLE_TYPE_DIAGNST= _ACM; > > + 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= /FitGen/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__ > > > > // > > -- > > 2.14.3.windows.1 >=20 >=20 >=20