From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web08.629.1656009188604671035 for ; Thu, 23 Jun 2022 11:33:08 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=LTknm1fZ; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: isaac.w.oram@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656009188; x=1687545188; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=UXaYus6pk2mb41XejGlEXCi2Lk8Ubt71OImV2HSJvFQ=; b=LTknm1fZWCwqUFLfxHdYNVpad9dXbBYWRCENkCPv06+ruTqkk7Yxf01k umRwtMEupDOE7EHOfHw+gejYWyyrgkJpwh4aMsBW4mwbdydT+eJI/lblr TijTKqqtmICb/wu7twqFeee/n1Dnog4gfh5L6X7G/vJyjxQBvz5RcAMmX fKo383n3wXuhl31tYvlHUgJ+PtzKy73zBvQkf77w4asK41HsGRPmQ/f7x FjU1ws77AN2ul2pV4tQrcRwrCffYFsi7hrSUlaLiKUWVmu9gQ5I/SNqlo PaBJWE/lu8nF0PgAjCL4R9GWOGTcUrXzGBhDOsMydL1lNuQdH9eSoJMKb g==; X-IronPort-AV: E=McAfee;i="6400,9594,10387"; a="306267312" X-IronPort-AV: E=Sophos;i="5.92,216,1650956400"; d="scan'208";a="306267312" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2022 11:33:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,216,1650956400"; d="scan'208";a="691149949" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga002.fm.intel.com with ESMTP; 23 Jun 2022 11:33:08 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 23 Jun 2022 11:33:07 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 23 Jun 2022 11:33:06 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Thu, 23 Jun 2022 11:33:06 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Thu, 23 Jun 2022 11:33:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gy4tiWkzUTBVvYKuUKn6p/M4HTpZDhuWTZiV7Ly9+BUeemKQs7HF6QcsL6XCHcdU2XJCfqgCoQMENV+AKYqcCu/6jkLxWpLh699xrqS6KWvk6l51roh7fvQ1o5a7/vym3uF+AKyXvAa+eri0jymVUiE2rxFU6DAOGq3G2iNOjd2DTnbL2Wfvwf6CbqFb7Ee17luU3TURtAL3E25qPC6HyPtBkHzW+9weWAza/QqGMtlr3qyEGVz/W3dQttdwckvo2iWwXnGfZStGynyHXKtYngWxhmNuGtJUt18AFEaeZ+EA0r5x9e8Ho0HuNesLH3UI3/6YuTmUk83bPAhel2juMQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pKDfzlmVYAWcH+TfibTKmY6p6QBy+8c0v07dHPzGNDo=; b=EEpU5kef06HEHmAcaI5aWpxYDmPbHF8er3fIBcOaV+XeQAlMIWkMsKjm7s7WPowrI7SjC6Zcba/duBqwE5eZjs5WpfLBUKas0s7qpUeCXa/zn62dwil/Ovpkuy10ixKh13w4eNb7AInFllZ2j+3R0qh3gMlkN3y58Zj2Q2UJTZ+d+HPhUqIFab8y7IOhSpeQiyL5DsnrFq40PAWpTFDoHZdcSJK25L7rbW3w0ydMOTAeijVq6NEPhhu50gAXFsSJcj6EDMb2O/1JpCHb1Hgu770bPFS3Qady6C+KeqihxsPTsWj4Aj7M4a4zbOQ/eEXcX431dCeLEZrCzYD7klZmeg== 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 Received: from MW4PR11MB5799.namprd11.prod.outlook.com (2603:10b6:303:181::17) by BL0PR11MB2929.namprd11.prod.outlook.com (2603:10b6:208:75::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.16; Thu, 23 Jun 2022 18:33:01 +0000 Received: from MW4PR11MB5799.namprd11.prod.outlook.com ([fe80::5df:b3be:38f6:718a]) by MW4PR11MB5799.namprd11.prod.outlook.com ([fe80::5df:b3be:38f6:718a%5]) with mapi id 15.20.5373.015; Thu, 23 Jun 2022 18:33:01 +0000 From: "Oram, Isaac W" To: "Lin, Jason1" , "devel@edk2.groups.io" CC: "Feng, Bob C" , "Gao, Liming" , "Chen, Christine" , "Chaganty, Rangasai V" , "Chiang, Dakota" Subject: Re: [PATCH v2 1/2] [edk2-platforms] Silicon/Intel/FitGen: Support multiple Startup ACM Type 2 entries in FitGen tool Thread-Topic: [PATCH v2 1/2] [edk2-platforms] Silicon/Intel/FitGen: Support multiple Startup ACM Type 2 entries in FitGen tool Thread-Index: AQHYhw/ZMlzqQwCPrkSsx1jCSyBps61dUOuQ Date: Thu, 23 Jun 2022 18:33:01 +0000 Message-ID: References: <20220623144453.3172-1-jason1.lin@intel.com> In-Reply-To: <20220623144453.3172-1-jason1.lin@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8d547def-8df4-4bc6-8ca0-08da5546cd8a x-ms-traffictypediagnostic: BL0PR11MB2929:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: EbjZdyrDsWd8OqxRTkUXDNq0QQm2u9u02Ro1omG7XMlNp8UyAc5+TxQYVRiI7X7kK+SPcg2GdO5akM0+TkicdUXon94rx9BESSy/jPhAPtn9TZ37t9X749pwvl916cshgBIa6Sjp1MGzKed4sRyFXfhWcAxkTxmzDyfUlN7nMLpIXyfUBKHMquToOHfSfzYdOFMBcXjqQ8h472nIHkxS8xRlgufbuebxcUV5vKxud0BwvoqlJDu7CJD97BYg6bnMnYnDvSAmnQyRbDfom8q6mE7tKJVuzrAEon+lkEn1TlmA1vKqShz+qNbVkLnmmC3ZKlg98ifeqSX6Sf1W8zHTamGmyKAt7SOQig5aW8ieRzj79xEFC6MVXvbl+E8lPvZaBkUnd4sUbspFpwj9Twk4VRXhgB6qDt+PwvvPl7LLytiOBqqv0dKz116pZQq7PNsLRkAdylGnaoqh3FbjKw5rcMDyrqy1UA/KlnyouTy70VPwWqYXXVVBxuuflSv87Hg+lGipb7Wsgnub+e5zW5lpplCVeoAago11sOu0WyM8VISV78GqluBtXtXCEZvF86+agOv9e0a398OynZWUCoMPG7eH37p9IBF+RbBMKsZNR+bvd0cJw3VTAF7pfNtZYJrPxxVgwD8buKxvcEBaU9Hoy1lOfr3hySQx8cCjUH+8Qgqr6alXyajNLO7nZnaxPEo2naz/hDVUcyeW+kCx8Bc3JwUT7pPeEHlCIrWR4Zb0V7LvO3AU3NjI1Aez0a0EtwccEq1WLy5PEQ7eDyaS4uBL30nSSP5HZraVCC5CoQvDZup6YdsrVaQHXe1G2Qkw0+O7aZDsYXcPeZbmmd7LPSW9AQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR11MB5799.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(346002)(376002)(366004)(136003)(39860400002)(66946007)(66556008)(66476007)(66446008)(64756008)(76116006)(478600001)(55016003)(8676002)(4326008)(5660300002)(8936002)(83380400001)(38070700005)(41300700001)(33656002)(52536014)(86362001)(9686003)(26005)(53546011)(107886003)(71200400001)(966005)(2906002)(110136005)(54906003)(38100700002)(316002)(186003)(122000001)(6506007)(7696005)(82960400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?THiMPCiqbkXBq1rVu6MwbXmC0xmVI/Uw+Hj7swxyyU3mcsmsgbOCj45Qpgvk?= =?us-ascii?Q?Xu9p9sz9q4s+hCybWuGIPZgGCIxcTLGuqcfVzIQk/L/oSvs80Jwh1sKJ9XPc?= =?us-ascii?Q?dNbDBfCkqY4IiLMLCns4yDcOMjLrkRzoPps26UokDYK4sRJG0WHOe1Y89tee?= =?us-ascii?Q?IF/iow9GuSooEYQX93wDScVl/ECSTfy3tLeQIE9kviYFR0tsaGXRaGJZ1AaJ?= =?us-ascii?Q?sUlLnZPVsYVAjUfvp0efXWURChQLgt+jZx1160Ihlv9mRHJ0xFgUIXr/lb+w?= =?us-ascii?Q?uCdsDjvKHdYXr5x6kGTqAs42qaKaDpNShjbqg+prhJVAowd7Zi6XfnA3WQYl?= =?us-ascii?Q?Pu1qspdSdGA4+zn2sP1giLqn6yqPuJFPLEP7mbodrjDjufoZkVVlH3ow+7Xy?= =?us-ascii?Q?iAuC27HGrUlPrc1Lbs3m6zce0LZj3W4o80KTVIT5iHT+96C+Q2Hho+3tY8WT?= =?us-ascii?Q?yK/V9YM9+rjklKU6m62CLSvGlc/UDrLHBcdMuntzRf7wS5Wk7QZZ0aRKobQZ?= =?us-ascii?Q?R39YuigMNZyLlZsw0HG/qbk6/20LyLFmKNNdPORhk4KUxvxZ1+IeN6ADT2PJ?= =?us-ascii?Q?nm8vp4ZrdAije1G1Oxr3d0+LTurz5Mf4p79/t3eFanOWAJA0SeR6za3/pGct?= =?us-ascii?Q?lJYcDqnVBVsA2gqy7sP5ZyrG65B7txoiDloJ4X0uxWq9AQIdSLgHsethdoY0?= =?us-ascii?Q?qKTYh2TZfBE2Pzm+RTlXjlRHyNaUiA5xon7JSXO4j3F56ubjXUGu5O3qgEMB?= =?us-ascii?Q?6AYk8yvC90K6+TDGvldVX580hbyTZllnTO824K15bigA3yAwO3/JcZJhmvI6?= =?us-ascii?Q?CykOzvQBPfNbtcW4hmC7boTZjXDWD61CHMU/a0KIoHrnokkfqI/9KjOHs1v0?= =?us-ascii?Q?oD8cr6i2kn8K5HNgDXzplQFYDLH7OFeEmX/aVKCWYJzNSFmwo37EAjJWXgbd?= =?us-ascii?Q?lpKg6VbXYg78VXRyky6RMZGd4CGTmUiTQTn/r42yu4lNubXjhMUl1RcVzK0t?= =?us-ascii?Q?lkMiNh3+ly5ByyLXwhZSMQcmMNBr/HMl0aKAI8JxI5xzodARDOVHlslLuWaC?= =?us-ascii?Q?4e1dGIe+zXu/mdag5KXKoqGWUql15Pw0SUdz+VnLmklx72YET0+IQVEJjwgN?= =?us-ascii?Q?AvelNq1qTecZZpJMXlNu62CxoASrkclAzMLSKs5+0C0Ra7ETHGYdIWSUPfpm?= =?us-ascii?Q?Cb80eVLo0exvR374BBEAtk0xcaC9fM9GtZL93uwh8T1dw+7hDpoFkY/5KJdx?= =?us-ascii?Q?TF1l4VlHcWcqUZ14BdiA5QnMoU4YwdHjuat44C+ypat0q4peFg5Wjsh6RETf?= =?us-ascii?Q?ZRLNOchEYyVgn6Nzx8l7A6BLYJ4ZbR1rqd/mQJoB3Et4d/uK0BiMqcmtrhG6?= =?us-ascii?Q?z3s0RBVitLXba/NZWy8dInnZGhRqxz1jJoTCW9utfTE4chDM8G6n42mhoS6x?= =?us-ascii?Q?DYVIV5YT41lR8AI3OlR4CaqE5MrW6hoqcwgVIZNOwR6d9IbAEMHEvZyv9b8W?= =?us-ascii?Q?WUXI3t8bHH1s+3Wc2RW58sH8Mbn6pYglvzuFdsp0ccaxx23XG0pvaq7QTC6p?= =?us-ascii?Q?3ARgE7cF1FhXMxHUTWQhbxkVTBLP4R9MGFPOy9lz?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5799.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d547def-8df4-4bc6-8ca0-08da5546cd8a X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jun 2022 18:33:01.0514 (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: pnk+j5YxnZsViXT1r9M8eoEiOOvek/ys6mN2TvrqhMxZF4bT7ZNfms588obCLhRpuwjjAGD3OuGM638TxIifhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR11MB2929 Return-Path: isaac.w.oram@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Isaac Oram -----Original Message----- From: Lin, Jason1 =20 Sent: Thursday, June 23, 2022 7:45 AM To: devel@edk2.groups.io Cc: Lin, Jason1 ; Feng, Bob C ;= Gao, Liming ; Chen, Christine ; Oram, Isaac W ; Chaganty, Rangasai V ; Chiang, Dakota Subject: [PATCH v2 1/2] [edk2-platforms] Silicon/Intel/FitGen: Support mult= iple Startup ACM Type 2 entries in FitGen tool From: Jason1 Lin REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3958 Within current FitGen tool there had limitation only allow one S-ACM to gen= erate the Type 2 entry. This code change is used to support multiple type 2 entries up to 0x20. Signed-off-by: Jason1 Lin Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Cc: Isaac W Oram Cc: Rangasai V Chaganty Cc: Dakota Chiang --- Silicon/Intel/Tools/FitGen/FitGen.c | 89 +++++++++++--------- Silicon/Int= el/Tools/FitGen/FitGen.h | 4 +- 2 files changed, 50 insertions(+), 43 deletions(-) diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c b/Silicon/Intel/Tools/FitG= en/FitGen.c index 4de72ea422..eac8fa8715 100644 --- a/Silicon/Intel/Tools/FitGen/FitGen.c +++ b/Silicon/Intel/Tools/FitGen/FitGen.c @@ -2,7 +2,7 @@ This utility is part of build process for IA32/X64 FD. It generates FIT ta= ble. -Copyright (c) 2010-2021, Intel Corporation. All rights reserved.
+= Copyright (c) 2010-2022, Intel Corporation. All rights reserved.
SPDX-L= icense-Identifier: BSD-2-Clause-Patent **/@@ -204,6 +204,7 @@ typedef stru= ct { #define MAX_BIOS_MODULE_ENTRY 0x20 #define MAX_MICROCODE_ENTRY 0x20+#= define MAX_STARTUP_ACM_ENTRY 0x20 #define MAX_OPTIONAL_ENTRY 0x20 #def= ine MAX_PORT_ENTRY 0x20 @@ -255,11 +256,12 @@ typedef struct { UINT32 FitEntryNumber; UINT32 = BiosModuleNumber; UINT32 MicrocodeNumber;+ UINT32 = StartupAcmNumber; UINT32 OptionalMo= duleNumber; UINT32 PortModuleNumber; UINT32 = GlobalVersion; UINT32 FitHeaderVersion;-= FIT_TABLE_CONTEXT_ENTRY StartupAcm;+ FIT_TABLE_CONTEXT_ENTRY Start= upAcm[MAX_STARTUP_ACM_ENTRY]; UINT32 StartupAcmVersio= n; FIT_TABLE_CONTEXT_ENTRY DiagnstAcm; UINT32 Di= agnstAcmVersion;@@ -1149,14 +1151,15 @@ Returns: Error (NULL, 0, 0, "-I Parameter incorrect, Header Type unsuppor= ted!", NULL); return 0; case FIT_TABLE_TYPE_STARTUP_ACM:-= if (gFitTableContext.StartupAcm.Type !=3D 0) {- Error = (NULL, 0, 0, "-I Parameter incorrect, Duplicated StartupAcm!", NULL);+ = if (gFitTableContext.StartupAcmNumber >=3D MAX_STARTUP_ACM_ENTRY) {+ = Error (NULL, 0, 0, "-I Parameter incorrect, too many StartupAcm!"= , NULL); return 0; }- gFitTableContext.Start= upAcm.Type =3D FIT_TABLE_TYPE_STARTUP_ACM;- gFitTableContext.St= artupAcm.Address =3D (UINT32)BiosInfoStruct[BiosInfoIndex].Address;- = gFitTableContext.StartupAcm.Size =3D (UINT32)BiosInfoStruct[BiosInfoI= ndex].Size;- gFitTableContext.StartupAcmVersion =3D BiosInfoStruc= t[BiosInfoIndex].Version;+ gFitTableContext.StartupAcm[gFitTableCo= ntext.StartupAcmNumber].Type =3D FIT_TABLE_TYPE_STARTUP_ACM;+ g= FitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Address =3D (= UINT32)BiosInfoStruct[BiosInfoIndex].Address;+ gFitTableContext.St= artupAcm[gFitTableContext.StartupAcmNumber].Size =3D (UINT32)BiosInfoStr= uct[BiosInfoIndex].Size;+ gFitTableContext.StartupAcm[gFitTableCon= text.StartupAcmNumber].Version =3D BiosInfoStruct[BiosInfoIndex].Version;+ = gFitTableContext.StartupAcmNumber ++; gFitTableContext.F= itEntryNumber ++; break; case FIT_TABLE_TYPE_DIAGNST_ACM:= @@ -1351,16 +1354,15 @@ Returns: // // 1. StartupAcm //- do {+ while (TRUE) { if ((Index + 1 >= =3D argc) || ((strcmp (argv[Index], "-S") !=3D 0) && (strc= mp (argv[Index], "-s") !=3D 0)) ) {- if (BiosInfoExist && (gFitTableCo= ntext.StartupAcm.Type =3D=3D FIT_TABLE_TYPE_STARTUP_ACM)) {- break;+= if (gFitTableContext.StartupAcmNumber =3D=3D 0) {+ printf ("-S= not found. WARNING!\n"); } // Error (NULL, 0, 0, "-S Parameter = incorrect, expect -S!", NULL); // return 0;- printf ("-S not foun= d. WARNING!\n"); break; } if (IsGuidData (argv[Index + 1], &G= uid)) {@@ -1381,14 +1383,13 @@ Returns: FileSize =3D xtoi (argv[Index + 2]); Index +=3D 3; }- i= f (gFitTableContext.StartupAcm.Type !=3D 0) {- Error (NULL, 0, 0, "-S = Parameter incorrect, Duplicated StartupAcm!", NULL);+ if (gFitTableConte= xt.StartupAcmNumber >=3D MAX_STARTUP_ACM_ENTRY) {+ Error (NULL, 0, 0, = "-S Parameter incorrect, too many StartupAcm!", NULL); return 0; = }- gFitTableContext.StartupAcm.Type =3D FIT_TABLE_TYPE_STARTUP_ACM;- = gFitTableContext.StartupAcm.Address =3D (UINT32) (UINTN) FileBuffer;- gF= itTableContext.StartupAcm.Size =3D FileSize;- gFitTableContext.FitEntryN= umber ++;+ gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber= ].Type =3D FIT_TABLE_TYPE_STARTUP_ACM;+ gFitTableContext.StartupAcm[gFit= TableContext.StartupAcmNumber].Address =3D (UINT32) (UINTN) FileBuffer;+ = gFitTableContext.StartupAcm[gFitTableContext.StartupAcmNumber].Size =3D Fi= leSize; // // 1.1 StartupAcm version@@ -1407,7 +1408,10 @@ Returns= : gFitTableContext.StartupAcmVersion =3D xtoi (argv[Index + 1]); = Index +=3D 2; }- } while (FALSE);++ gFitTableContext.StartupAcmNum= ber ++;+ gFitTableContext.FitEntryNumber ++;+ } // // 1.5. Diagnos= ticsAcm@@ -1890,7 +1894,9 @@ Returns: // // Final: Check StartupAcm in BiosModule. //- CheckOverlap (gFit= TableContext.StartupAcm.Address, gFitTableContext.StartupAcm.Size);+ for (= Index =3D 0; Index < (INTN)gFitTableContext.StartupAcmNumber; Index++) {+ = CheckOverlap (gFitTableContext.StartupAcm[Index].Address, gFitTableContex= t.StartupAcm[Index].Size);+ } FitEntryNumber =3D gFitTableContext.FitEnt= ryNumber; for (Index =3D 0; Index < (INTN)gFitTableContext.OptionalModule= Number; Index++) { if ((gFitTableContext.OptionalModule[Index].Type =3D= =3D FIT_TABLE_TYPE_BIOS_POLICY) ||@@ -2178,8 +2184,8 @@ Returns: } printf ("Total FIT Entry number: 0x%x\n", gFitTableContext.FitEntryN= umber); printf ("FitHeader version: 0x%04x\n", gFitTableContext.FitHeader= Version);- if (gFitTableContext.StartupAcm.Address !=3D 0) {- printf ("= StartupAcm - (0x%08x, 0x%08x, 0x%04x)\n", gFitTableContext.StartupAcm.Addre= ss, gFitTableContext.StartupAcm.Size, gFitTableContext.StartupAcmVersion);+= for (Index =3D 0; Index < gFitTableContext.StartupAcmNumber; Index++) {+ = printf ("StartupAcm[%d] - (0x%08x, 0x%08x, 0x%04x)\n", Index, gFitTableC= ontext.StartupAcm[Index].Address, gFitTableContext.StartupAcm[Index].Size, = gFitTableContext.StartupAcmVersion); } if (gFitTableContext.DiagnstAcm.= Address !=3D 0) { printf ("DiagnosticAcm - (0x%08x, 0x%08x, 0x%04x)\n",= gFitTableContext.DiagnstAcm.Address, gFitTableContext.DiagnstAcm.Size, gFi= tTableContext.DiagnstAcmVersion);@@ -2809,8 +2815,8 @@ Returns: // // 4. StartupAcm //- if (gFitTableContext.StartupAcm.Address != =3D 0) {- FitEntry[FitIndex].Address =3D gFitTableContext.St= artupAcm.Address;+ for (Index =3D 0; Index < gFitTableContext.StartupAcmNu= mber; Index++) {+ FitEntry[FitIndex].Address =3D gFitTableCo= ntext.StartupAcm[Index].Address; *(UINT32 *)&FitEntry[FitIndex].Size[0]= =3D 0; //gFitTableContext.StartupAcm.Size / 16; FitEntry[FitIndex].Ver= sion =3D (UINT16)gFitTableContext.StartupAcmVersion; FitEnt= ry[FitIndex].Type =3D FIT_TABLE_TYPE_STARTUP_ACM;@@ -3110,7 = +3116,7 @@ GetFitEntryInfo ( Routine Description: - Fill the FIT table information to Fvrecovery+ Ge= t the FIT table information from Fvrecovery Arguments: @@ -3164,8 +3170,8 = @@ Returns: gFitTableContext.MicrocodeNumber ++; break; case FIT_TABLE= _TYPE_STARTUP_ACM:- gFitTableContext.StartupAcm.Address =3D (UINT32)Fi= tEntry[FitIndex].Address;- gFitTableContext.StartupAcmVersion =3D Fit= Entry[FitIndex].Version;+ gFitTableContext.StartupAcm[gFitTableContext= .StartupAcmNumber].Address =3D (UINT32)FitEntry[FitIndex].Address;+ gF= itTableContext.StartupAcmVersion =3D Fi= tEntry[FitIndex].Version; break; case FIT_TABLE_TYPE_BIOS_MODULE:= gFitTableContext.BiosModule[gFitTableContext.BiosModuleNumber].Addre= ss =3D (UINT32)FitEntry[FitIndex].Address;@@ -3232,6 +3238,7 @@ Returns: UINT32 FdFileSize; UINT8 *= AcmBuffer;+ INTN Index; UINT32 = FixedFitLocation; FileBufferRaw =3D NULL;@@ -3323,22 +3330,23 @@ Retu= rns: // // Get ACM buffer //- if (gFitTableContext.StartupAcm.Ad= dress !=3D 0) {- AcmBuffer =3D FLASH_TO_MEMORY(gFitTableContext.Startu= pAcm.Address, FdFileBuffer, FdFileSize);- if ((AcmBuffer < FdFileBuffe= r) || (AcmBuffer + gFitTableContext.StartupAcm.Size > FdFileBuffer + FdFile= Size)) {- printf ("ACM out of range - can not validate it\n");- = AcmBuffer =3D NULL;- }+ for (Index =3D 0; Index < (INTN)gFitTabl= eContext.StartupAcmNumber; Index ++) {+ if (gFitTableContext.StartupAc= m[Index].Address !=3D 0) {+ AcmBuffer =3D FLASH_TO_MEMORY(gFitTableC= ontext.StartupAcm[Index].Address, FdFileBuffer, FdFileSize);+ if ((A= cmBuffer < FdFileBuffer) || (AcmBuffer + gFitTableContext.StartupAcm[Index]= .Size > FdFileBuffer + FdFileSize)) {+ printf ("ACM out of range -= can not validate it\n");+ AcmBuffer =3D NULL;+ } - if= (AcmBuffer !=3D NULL) {- if (CheckAcm ((ACM_FORMAT *)AcmBuffer, gFi= tTableContext.StartupAcm.Size)) {- DumpAcm ((ACM_FORMAT *)AcmBuffe= r);- } else {- Status =3D STATUS_ERROR;- goto exit= Func;+ if (AcmBuffer !=3D NULL) {+ if (CheckAcm ((ACM_FORMA= T *)AcmBuffer, gFitTableContext.StartupAcm[Index].Size)) {+ Dump= Acm ((ACM_FORMAT *)AcmBuffer);+ } else {+ Status =3D ST= ATUS_ERROR;+ goto exitFunc;+ } } }- }= //@@ -3576,4 +3584,3 @@ Returns: return u; }-diff --git a/Silicon/Intel/Tools/FitGen/FitGen.h b/Silicon/= Intel/Tools/FitGen/FitGen.h index 5add6a8870..b7de0a6b2d 100644 --- a/Silicon/Intel/Tools/FitGen/FitGen.h +++ b/Silicon/Intel/Tools/FitGen/FitGen.h @@ -1,7 +1,7 @@ /**@file Definitions for the FitGen utility. -Copyright (c) 2010-2020, Int= el Corporation. All rights reserved.
+Copyright (c) 2010-2022, Intel Cor= poration. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Pa= tent **/@@ -31,7 +31,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent // Utility version information // #define UTILITY_MAJOR_VERSION 0-#define = UTILITY_MINOR_VERSION 64+#define UTILITY_MINOR_VERSION 65 #define UTILITY_D= ATE __DATE__ //--=20 2.26.2.windows.1