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.web09.35246.1608522783151930393 for ; Sun, 20 Dec 2020 19:53:03 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Rm/mhgVV; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: aaron.li@intel.com) IronPort-SDR: 5dh/puyUhsrIE2D+R1QjvXA69J+eBOtcLPOPclEQHfu4LmMeP/PWV7fty0wvznpiFKJU5qGikX zdOKgRBaBSuA== X-IronPort-AV: E=McAfee;i="6000,8403,9841"; a="175825418" X-IronPort-AV: E=Sophos;i="5.78,436,1599548400"; d="scan'208";a="175825418" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2020 19:53:02 -0800 IronPort-SDR: n9V/MWwEaOrvrkGAmIuQ+1tG4Z34+2hBAi0rhQbsxqaxyoAz2eKBsVfsIE9gv//nyabIcb2ZMR H9jCYBzxHA8g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,436,1599548400"; d="scan'208";a="372171713" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga008.jf.intel.com with ESMTP; 20 Dec 2020 19:53:02 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 20 Dec 2020 19:53:01 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Sun, 20 Dec 2020 19:53:01 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.44) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Sun, 20 Dec 2020 19:52:58 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CN8mqcCCLPCJVupHLqr2ccBWGQrxsiU4Pyo9UtV1jm5iAeFiSHqUge4p6TKoqQ933+thMUs5rYYOkgSRze9/EvC+snsDHSANe7VZ8X7azA9gC/R/2Lxh+1d4dJw3jcoMs5qoDdBnQLZHzJsSxMnR9fKKyMUpv5jvt+niVHnemObtQGQj1wWDi9SVlHnb/hZnpGqq76yKQaWl9t5gPJVwBhz6zue/sur7Gu9J9ajaXJUk0t3sDk1qecr0HKj0mQeONsWn3z91afozg/WhwFhggAJepB2Umvv6rjcnOf1G70jRTZgBMc9yfwgb+0vExv8V8DD4bHA0PIheK0KUJfWHsA== 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=cqHJNs45FuQ3UC4cWMKQO4w9WwbW1o5oeVeMEdlyWrM=; b=Q3JCWBDGCtlddk6KJMLjnYHnQZSQMmbVltjWgDiicWH+rRVh6/i3nl1RYaQpdmh3yZy6Sc5F6SJJJw+bJM4z8TmyonLoIrRvpBnWtfjswMbcQEHl9zcRj2aFQxCf7ot3Lg/jc0J5DYaEsViDxdOrrsujZZxzxibwBHq+zof99S1Dx0cUXQLY9hlZ22QQ1Yj/TI3Ug7NRG75zm7nQnb7IrCHIyGHM2OeBlmxfwipAuJB1mWWqjHMdnfSWFV3DHY/d/BTKjvBe/xB76GA9ewI9wbG0ucuAvTeXe+fj1xcn5E8kX0sO9TpmCM/y8D3G1FgDF+YU+K5IecjSfA4jaU0LAQ== 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=cqHJNs45FuQ3UC4cWMKQO4w9WwbW1o5oeVeMEdlyWrM=; b=Rm/mhgVVcSvMC2SK5t6QqIwCmcbVZb7oBbPSrainSePzGxWgzA7JxLqRYA39oDHMAHC5EV35mwi3L7IzcF4Oh2Ku9/xShjuyTMbqYmoXgV91DceQdNJ/DLMLiGQyJ5H5gJdJ/dwEk2nz5L/xoIGwfmNvAB4x/tviMbTTV+0Dp6o= Received: from SJ0PR11MB4895.namprd11.prod.outlook.com (2603:10b6:a03:2de::23) by BYAPR11MB3640.namprd11.prod.outlook.com (2603:10b6:a03:f7::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.20; Mon, 21 Dec 2020 03:52:58 +0000 Received: from SJ0PR11MB4895.namprd11.prod.outlook.com ([fe80::9d2c:de8a:5a90:cc47]) by SJ0PR11MB4895.namprd11.prod.outlook.com ([fe80::9d2c:de8a:5a90:cc47%2]) with mapi id 15.20.3676.033; Mon, 21 Dec 2020 03:52:58 +0000 From: "Aaron Li" To: "Feng, Bob C" , Liming Gao CC: "Li, Aaron" , "devel@edk2.groups.io" , "Fu, Siyuan" Subject: Re: [edk2-devel] [PATCH v1 1/1] Silicon/FitGen: Enhance Slot mode support force mode for multiple FV. Thread-Topic: [edk2-devel] [PATCH v1 1/1] Silicon/FitGen: Enhance Slot mode support force mode for multiple FV. Thread-Index: AQHW03pEpLCeh2YJ4Ue4eQ6iyjmrlqoA8PDA Date: Mon, 21 Dec 2020 03:52:58 +0000 Message-ID: References: <165120B57817F578.31352@groups.io> In-Reply-To: <165120B57817F578.31352@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows 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: [192.198.147.212] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4b43d74f-caff-4ac3-2e3c-08d8a563e7c4 x-ms-traffictypediagnostic: BYAPR11MB3640: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gUn9/JPRhQqqeonmcWwGbUTYwAmNyi2z9TzS8SS1k/9iIeR7TK4kVmQYuRtaTV8CrFWnMk/5/xTZmP/hdKJMqcxADdj+fdeh48fnFx6Rp60++Hria1rCDhLHQofHN7EaVt8zXyumtwFdNk6YoLRjjL47EjdJNliJfaRP9xcRgiTX+J4Bpo0KZ+RfShifcCU7h7gaRCoWZ7BsPezu5NA+2sj4QoIM7FCPE/3Evzg9lvtHgzzmyZ75pxyTbryF4XYlWfzDg0LXv+PPdi29VlRetz5VS21EbQahz69OoUG3FcaAjPEGOpfXiRbzBREpsv3ZeWSW1hlucTr0fWnpNyqj5cSIJnNMvUq4ioTgIrwT2FDFmG9vxPqk4uGrbDebJOiWJm04kvKwzmzobMJarccCXg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB4895.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(39860400002)(376002)(136003)(366004)(396003)(110136005)(64756008)(26005)(54906003)(86362001)(107886003)(4326008)(33656002)(66476007)(7696005)(2906002)(52536014)(186003)(66946007)(966005)(66556008)(55016002)(66446008)(9686003)(6506007)(8936002)(8676002)(478600001)(76116006)(53546011)(5660300002)(71200400001)(316002)(83380400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?uwS0joXPYT8o6+khh8MyZUQRZcS5A21wXTu58T4fP8n4e6qd8K4Jtz7uEBWJ?= =?us-ascii?Q?hKfGODNL2zrvTeKe0ttZcBT1shPVNUf7pQU5eYeOS2O/k/vn6kiaFNj2r6Zy?= =?us-ascii?Q?1zRDBtISC6/HuhOGCa3fTImjfGVqIiTvdDsdAWJqLp/Qts/Emrqq6t5osFQC?= =?us-ascii?Q?pyJjnn6DQrW7mi14gVLdQ6EUf9+u4rUkWd+HuYUlJeQIeKd6AcZ11G6zb3/n?= =?us-ascii?Q?HE8wVVPgofchvRWpWRC494JJuUCzDXzCIFIvEUGMqXtuHAo87JtUEmUbWgfm?= =?us-ascii?Q?Ua9uVOuIUMZisHP/YbtEKvPYRtlSVzNIn7vnx3MJHZ6RRPfaUEbg3KvtiXDJ?= =?us-ascii?Q?kPkj5geV350Qo8jAHhXUxD8GzjeojmHIjHya7dYTOmvOeEaS8U+Za3w8NHvY?= =?us-ascii?Q?9jv0Htx5Ri+cPygsqyT82g6V9nDcPMLff73PPT+WpuRhboCVGatFz0OVq0po?= =?us-ascii?Q?hny6asd7+/wM18QSZ2JyaQqBFXZM66jxoMLDCjgfaykY1hJO3GASknZmsOyb?= =?us-ascii?Q?fGnP1m8SgIfkCMYDztK74QPRfwMMdfNmDLjhSxEvAGJ0pi32Dd9Sin35h+5l?= =?us-ascii?Q?JVctl2HrhiVON+wAR8q3j1LJt6LA/twez7xSfr/Nm3SNMkmwXTsYp/CiW/6s?= =?us-ascii?Q?M1ni+XKRLkqfugwTa7pBW11H3Mf281AcSlEQAMa4VTr4zDL37/SMBmsLNjRr?= =?us-ascii?Q?WKYrUL5u9mkMeEqZjDL7tSKd718lnH8EpsGPfhypClWTGFzp0u4pC6N9J7O6?= =?us-ascii?Q?sYpJ6SUauaAswK4KE19j0dfaY2FHhdUFW8BPvrAgLSpXqDMpY+uJfU8pqjLr?= =?us-ascii?Q?z5XrXuypHSGZ9NUvBFCbvgiacggzb5UHXjH69lpcS9D80M6rsreH4gAeu51P?= =?us-ascii?Q?/nvNYOhd7SQPhmvpU0eOWMoNeHgyRCQCNIgQlyZ1OLfXAs3ee3bJXsu+Z3j7?= =?us-ascii?Q?kKx3CZhX8sbkTbQd5tuCjCFy/LJVXdjtKPogoPD92QQ=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB4895.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b43d74f-caff-4ac3-2e3c-08d8a563e7c4 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Dec 2020 03:52:58.0489 (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: 338ZORXt81J04aIVAgGPO2LzuIoblhCkS/CakGbNzf9uz/F1xePYfVrXVLHgRJJ7tyjsRND88a3RiNAseN2rvA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3640 Return-Path: aaron.li@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Bob & Liming, Could you help review this patch? Thanks. Best, Aaron -----Original Message----- From: devel@edk2.groups.io On Behalf Of Aaron Li Sent: Wednesday, December 16, 2020 3:08 PM To: devel@edk2.groups.io Cc: Feng, Bob C ; Liming Gao Subject: [edk2-devel] [PATCH v1 1/1] Silicon/FitGen: Enhance Slot mode supp= ort force mode for multiple FV. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3122 Adding "-LF"/"-lf" option to support slot mode without FFS GUID check. It will support the scenario that multiple Microcode FV with different FFS GUID enable slot mode. The size of slot should be 16 byte-aligned, and larger than every microcode. Signed-off-by: Aaron Li Cc: Bob Feng Cc: Liming Gao --- Silicon/Intel/Tools/FitGen/FitGen.c | 39 +++++++++++++------- Silicon/Intel/Tools/FitGen/FitGen.h | 2 +- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c b/Silicon/Intel/Tools/FitG= en/FitGen.c index e9541c1e95cb..21f0e90c47b9 100644 --- a/Silicon/Intel/Tools/FitGen/FitGen.c +++ b/Silicon/Intel/Tools/FitGen/FitGen.c @@ -333,9 +333,10 @@ Returns: "\t[-F ] [-F ] [-V= ]\n" "\t[-NA]\n" "\t[-A ]\n" - "\t[-REMAP \n" + "\t[-REMAP \n" "\t[-CLEAR]\n" "\t[-L ]\n" + "\t[-LF ]\n" "\t[-I ]\n" "\t[-S |] [-V = ]\n" "\t[-U |]\n" @@ -366,6 +367,7 @@ Returns: printf ("\tMicrocodeGuid - Guid of Microcode Module.\n"); printf ("\tMicrocodeSlotSize - Occupied region size of each Microco= de binary.\n"); printf ("\tMicrocodeFfsGuid - Guid of FFS which is used to save Mi= crocode binary"); + printf ("\t-LF - Microcode Slot mode without FFS chec= k, treat all Microcode FV as slot mode. In this case the Microcode FV shoul= d only contain one FFS.\n"); printf ("\t-NA - No 0x800 aligned Microcode requireme= nt. No -NA means Microcode is aligned with option MicrocodeAlignment value.= \n"); printf ("\tMicrocodeAlignment - HEX value of Microcode alignment. Ig= nored if \"-NA\" is specified. Default value is 0x800. The Microcode update= data must start at a 16-byte aligned linear address.\n"); printf ("\tRecordType - FIT entry record type. User should e= nsure it is ordered.\n"); @@ -882,11 +884,13 @@ Returns: UINTN FitEntryNumber; BOOLEAN BiosInfoExist; BOOLEAN SlotMode; + BOOLEAN SlotModeForce; BIOS_INFO_HEADER *BiosInfo; BIOS_INFO_STRUCT *BiosInfoStruct; UINTN BiosInfoIndex; =20 - SlotMode =3D FALSE; + SlotMode =3D FALSE; + SlotModeForce =3D FALSE; =20 // // Init index @@ -1031,7 +1035,9 @@ Returns: // if ((Index + 1 >=3D argc) || ((strcmp (argv[Index], "-L") !=3D 0) && - (strcmp (argv[Index], "-l") !=3D 0)) ) { + (strcmp (argv[Index], "-l") !=3D 0) && + (strcmp (argv[Index], "-LF") !=3D 0) && + (strcmp (argv[Index], "-lf") !=3D 0))) { // // Bypass // @@ -1039,18 +1045,21 @@ Returns: } else { SlotSize =3D xtoi (argv[Index + 1]); =20 - if (SlotSize =3D=3D 0) { - printf ("Invalid slotsize =3D %d\n", SlotSize); + if (SlotSize & 0xF) { + printf ("Invalid slotsize =3D 0x%x, Microcode data must start at a 1= 6-byte aligned linear address!\n", SlotSize); return 0; } - - SlotMode =3D IsGuidData(argv[Index + 2], &MicrocodeFfsGuid); - if (!SlotMode) { - printf ("Need a ffs GUID for search uCode ffs\n"); - return 0; + if (strcmp (argv[Index], "-LF") !=3D 0 || strcmp (argv[Index], "-lf") = !=3D 0) { + SlotModeForce =3D TRUE; + Index +=3D 2; + } else { + SlotMode =3D IsGuidData(argv[Index + 2], &MicrocodeFfsGuid); + if (!SlotMode) { + printf ("Need a ffs GUID for search uCode ffs\n"); + return 0; + } + Index +=3D 3; } - - Index +=3D 3; } =20 // @@ -1219,6 +1228,10 @@ Returns: gFitTableContext.FitEntryNumber++; =20 if (SlotSize !=3D 0) { + if (SlotSize < MicrocodeSize) { + printf ("Parameter incorrect, Slot size: %x is too small= for Microcode size: %x!\n", SlotSize, MicrocodeSize); + return 0; + } MicrocodeBuffer +=3D SlotSize; } else { MicrocodeBuffer +=3D MicrocodeSize; @@ -1228,7 +1241,7 @@ Returns: /// /// Check the remaining buffer /// - if (((UINT32)(MicrocodeBuffer - MicrocodeFileBuffer) < Microco= deFileSize) && SlotMode !=3D 0) { + if (((UINT32)(MicrocodeBuffer - MicrocodeFileBuffer) < Microco= deFileSize) && (SlotMode || SlotModeForce)) { for (Walker =3D MicrocodeBuffer; Walker < MicrocodeFileBuffe= r + MicrocodeFileSize; Walker++) { if (*Walker !=3D 0xFF) { printf ("Error: detect non-spare space after uCode array= , please check uCode array!\n"); diff --git a/Silicon/Intel/Tools/FitGen/FitGen.h b/Silicon/Intel/Tools/FitG= en/FitGen.h index 435fc26209da..5add6a8870e9 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 63 +#define UTILITY_MINOR_VERSION 64 #define UTILITY_DATE __DATE__ =20 // --=20 2.29.2.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D Groups.io Links: You receive all messages sent to this group. View/Reply Online (#68937): https://edk2.groups.io/g/devel/message/68937 Mute This Topic: https://groups.io/mt/78995825/4128994 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [aaron.li@intel.com] -=3D-=3D-=3D-=3D-=3D-=3D