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.web08.8448.1646912645998817647 for ; Thu, 10 Mar 2022 03:44:07 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=NJbg+QDn; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: ted.kuo@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646912646; x=1678448646; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=axxSQjnJ5yStAFtt9WM7nmd12F0Wbtu4kC4qAhHBvhE=; b=NJbg+QDnFqjGhTqERh5AiWdnx2VA4CpBEkeYdfDqpqf9e2474NPCqkMr +8iSDeAOTFOEI11uPtrpeAES5BidsgxG+IDhZy21+czB3MQZ4awhiH0f3 IKzqlYHBP7n+YdVBlzwxe4wbXZ+vj1DyoB3mFU+zPdFDxQsrp5eqEDYu/ FXQlh/iYhYKyjPjzmv42j2AtaeQByiTG2gWLQ4AEzlQHWk6pqHrDERqW+ sbu0z6yHktQrYXlgYoOVcvmzUtEvXckkPUf26Fm2U/ZNEIgYgrAoxdzkC PwEnaKtvduJzfb6ToRCZuk8Gi1i9cf6373gsDgzAOM+BRe/TzdcXMTlD4 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10281"; a="254058147" X-IronPort-AV: E=Sophos;i="5.90,170,1643702400"; d="scan'208";a="254058147" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2022 03:44:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,170,1643702400"; d="scan'208";a="496226992" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga003.jf.intel.com with ESMTP; 10 Mar 2022 03:44:04 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 10 Mar 2022 03:44:04 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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.2308.21 via Frontend Transport; Thu, 10 Mar 2022 03:44:04 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.177) 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.2308.21; Thu, 10 Mar 2022 03:44:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h7B38wzHzBjlIFbIlcMHJTWxokRcUnb0TKsD6aOiWUTvUD7wuEk5CCcAuJVhtSeJz2p34M8Zlgp3PzXZ4IXA1XBtnLX1M2hzuSa+AiRadC6xkrsBoVdLEjSFJ+qaMMvZfIVbpehySib8xvyJ3F46JNlJkoI2KIliv2BpAzO/RjeTx5LCJM9UIuuoyqR16qPkUljS1sBR/eACjgnBMBATZCLxA3GwnfuR6Lq3e8Sq3OHoclv5A/fifwZCaqhBnQeoXhFn0zvxPZ+e2kRx8G9OK8eAv7DLBrtUK+KKGfZ/DK/0FUoTU4K0Nv4wEOlbSXDPzuBeRDqjnnrmbPXAsp/vOA== 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=eanKb/P8zd+IuZ2qQi9gqusMmJkn5lWhXXan2bmqHTw=; b=TKu9IdCpQyUsHkw5OBr/U0fh/fYWHVhjEtPRoRPWfuSX8FXmJqQ0lRph1DzAnXwGd9k/EcZd4CA1cGbPNXwYB5GYSHcsRYid4X7Yw29vrL/dUH2M6ZvJbnz7n7jjIU8LeazXVUCGgUVFVkoqKcZ+N0B40AhvkcNqql6mVh5iCtE/NUBCMhgpzimBCAIbg8iIi9vUsDbgolQbul1Usl/4Mh49U8GJ/54UOkOf7xcu4+S4HkKuEr9V88xlxJIN5HzlLf0TOhdirObk+6t9Uz9/BQ6biiiCgasYB2TBbdJ+2EgYbsXyMfAE6cQu2xxPmQgjEMYUNgoGSuCrJ4gWhHvAiw== 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 MW5PR11MB5932.namprd11.prod.outlook.com (2603:10b6:303:1a2::5) by DM8PR11MB5656.namprd11.prod.outlook.com (2603:10b6:8:38::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.16; Thu, 10 Mar 2022 11:44:01 +0000 Received: from MW5PR11MB5932.namprd11.prod.outlook.com ([fe80::99c1:4af2:442d:4ffa]) by MW5PR11MB5932.namprd11.prod.outlook.com ([fe80::99c1:4af2:442d:4ffa%6]) with mapi id 15.20.5038.027; Thu, 10 Mar 2022 11:44:01 +0000 From: "Kuo, Ted" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "De, Debkumar" , "Han, Harry" , "West, Catharine" Subject: Re: [edk2-devel][PATCH] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm Thread-Topic: [edk2-devel][PATCH] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm Thread-Index: AQHYNDVwMXhx/pILkkqYVgvFf50fwqy4fObw Date: Thu, 10 Mar 2022 11:44:01 +0000 Message-ID: References: <5a3a880ffa4a521565192ca5eda35d0b93625067.1646664121.git.ted.kuo@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.401.20 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: 1cb25904-a491-4156-5a6e-08da028b458f x-ms-traffictypediagnostic: DM8PR11MB5656:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ugSdURNuBjSrE5UBfPoKgbqPcv5xSiLKDjOeawmEU+9JbtuyR2XJikitTao+I2FTFdiz/THc7KgG3u4XMeQktEniNveGIOmCYRLfWGs/MQEmBED/maZxBdPhbyjoHC58kGFEHJJcesX+cv/fuExDJyJlh8cMzhYCjDxs2tjkIJL/CleF5SyWBsEDGFsU8kembrkSp7clit4tUzXGHG12IOuOx52rYOwJtOkS9Cj9ZI58R7cl9M5bJHbUJupwfS3Vstgxtqy6RkHv6S5VvPlPEOpS7g3LyndajDGRwLVnSkzndpqouaSoFAyBSpbGFkXmt3UUnHuAQLJ8eXgtP8jWhGo3CWUDyLuZOOUSX1iIemOPtNqOafhA+QyV09lYq0oEnWf9shTsqN4dct5sB8yYd/FIPFRA8WyOVWSqo7AtIeRr17XmJXtAuVD9R+AgElgGA6/2gEVlANlHL7Fcx6SYj2vNCBs78uoO2w7PwOxE7uB6z85SHV+HsVR0/g9Z/nbq+03A1UoU2+hLGZGyTSxV5mpsYkLSFBvZuLSpnb08PxjlyVmcHr6DPuyLtqfmERr6fbeeoU71j1lfvRzswCFeR1qcpGsuTBfRXOMRA1K3szRyDr0jkbXgvM/8kVI/RSAaKaJGPJqZUDEpeMvv6PLLPVn3KspeV7a8YORFJBexSBPiLECWLtE0U3z97pPdYCHTRM4LcT2E0yvkUFhuV2+Lsg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW5PR11MB5932.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(82960400001)(110136005)(71200400001)(86362001)(4326008)(64756008)(8676002)(54906003)(316002)(55016003)(5660300002)(66476007)(66556008)(66446008)(52536014)(76116006)(8936002)(66946007)(38100700002)(122000001)(508600001)(2906002)(38070700005)(19627235002)(83380400001)(6506007)(7696005)(33656002)(9686003)(107886003)(53546011)(186003)(26005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?lQjQqGILssxeortgkKW0ROTsxwbd/aWSDb+9tCOdx2UPRYSD53BtFSEzx2X9?= =?us-ascii?Q?Ow1qVuAzfVBvo5bqQ04sFFB/9fwpK/6F4iEkSseiCRt5BWHMInGCHPEMf8hu?= =?us-ascii?Q?xms8nTeDz/ontS4eBHNPmatDoORfN7ah62QdXiWoauI7r4DyidZIfdOZDtrs?= =?us-ascii?Q?t8vuc1GzrcEmpVpxlv3xYAm7+eT6xFnYckfnvLxXWUN8GqcnejeeG05aAoUA?= =?us-ascii?Q?3HmuFaBdhJtQqE8UEww9r1JSn2xxTJoLXmh7COyMBtf+jq7NDNDhqSEnK2hD?= =?us-ascii?Q?IGq5UJ0XLV+GmZpAsZ7JDisU+IOJ0MOxqHdmxd9BsgE5oj2EWrV5Ce+34P9c?= =?us-ascii?Q?5jzc0YGlkhKPFf2v02NIJvV383PFwag/1R2PBQc6FUJasyrUZXJa7QuABOFC?= =?us-ascii?Q?jN98gq823dqRUgpBHxYgLsU42GCICYqSxmgqJEmuyc7ighyCxotsbNEnO/lr?= =?us-ascii?Q?Z2Y8EsdV+sYOTYr3kJkg/Kbs/RbkQp3BaFvH1ndmXbl5d4uHxd3t2yH9s3Vj?= =?us-ascii?Q?0n6gjG5JfpGS/Ei0tZ2Iq8Jp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-ascii?Q?pw4rDxD8b/UXm57G8L655KTS0PGnQg+jLteVeVB0BEVsrTOsxv0y5WRrNSXZ?= =?us-ascii?Q?qNuZr7SFty6Pk0uwRGt9r9Pk0JIGzmm3FC1PXoziy+qGjU3Vn+dWl+f7gnZP?= =?us-ascii?Q?KRGoSP8leI+4hj96i5yq0h+CkNO9R/oPUugGFitWL/1ickbgk5EcqOcQCHeQ?= =?us-ascii?Q?/g=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW5PR11MB5932.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1cb25904-a491-4156-5a6e-08da028b458f X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Mar 2022 11:44:01.5517 (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: lpbMpyGC7brc/Dmltzk003ZXZiXx7jQ1DBGKTxcfiWl6dy00scp2TOjuRfE0WfDBjloRK5t0IA6N/dT5D8goPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5656 Return-Path: ted.kuo@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ray, Please find my inline comments with [Ted]. Thanks, Ted -----Original Message----- From: Ni, Ray =20 Sent: Thursday, March 10, 2022 12:15 PM To: Kuo, Ted ; devel@edk2.groups.io Cc: De, Debkumar ; Han, Harry ;= West, Catharine Subject: RE: [edk2-devel][PATCH] UefiCpuPkg: Support FFS3 GUID in SearchFor= BfvBase.asm 3 comments starting with "[Ray]". ;#define EFI_FIRMWARE_FILE_SYSTEM2_GUID \ ; { 0x8c8ce578, 0x8a3d, 0x4f1c= , { 0x99, 0x35, 0x89, 0x61, 0x85, 0xc3, 0x2d, 0xd3 } } -%define FFS_GUID_DW= ORD0 0x8c8ce578 -%define FFS_GUID_DWORD1 0x4f1c8a3d -%define FFS_GUID_DWORD= 2 0x61893599 -%define FFS_GUID_DWORD3 0xd32dc385 +%define FFS2_GUID_DWORD0 0x8c8ce578 +%define FFS2_GUID_DWORD1 0x4f1c8a3d +%define FFS2_GUID_DWORD2 0x61893599 +%define FFS2_GUID_DWORD3 0xd32dc385 + +;#define EFI_FIRMWARE_FILE_SYSTEM3_GUID \ ; { 0x8c8ce578, 0x3dcb,=20 +0x4dca, { 0xbd, 0x6f, 0x1e, 0x96, 0x89, 0xe7, 0x34, 0x9a } } %define=20 +FFS3_GUID_DWORD0 0x5473c07a %define FFS3_GUID_DWORD1 0x4dca3dcb %define=20 +FFS3_GUID_DWORD2 0x961e6fbd %define FFS3_GUID_DWORD3 0x9a34e789 [Ray] 1. I am not sure if it's the best representation of GUID in NASM? I a= m not the NASM expert. If there is no recommendation, I am ok with this. [Ted] Somehow the diff doesn't reflect the actual representation in my edit= or. I'll check and update the patch. =20 BITS 32 =20 @@ -25,6 +32,7 @@ BITS 32 Flat32SearchForBfvBase: =20 xor eax, eax + mov ecx, 2 ; 2: FFS3 GUID, 1: FFS2 GUID, 0: Not Found [Ray] 2. Can you map ECX 2 to FFS2 GUID, ECX 3 to FFS3 GUID? [Ted] Yes, will update in next patch. searchingForBfvHeaderLoop: ; ; We check for a firmware volume at every 4KB address in the top 16MB = @@ -32,20 +40,37 @@ searchingForBfvHeaderLoop: ; sub eax, 0x1000 cmp eax, 0xff000000 - jb searchedForBfvHeaderButNotFound + jb searchingForBfvWithOtherFfsGuid + cmp ecx, 2 + jne searchingForFfs2Guid =20 ; - ; Check FFS GUID + ; Check FFS3 GUID ; - cmp dword [eax + 0x10], FFS_GUID_DWORD0 + cmp dword [eax + 0x10], FFS3_GUID_DWORD0 jne searchingForBfvHeaderLoop - cmp dword [eax + 0x14], FFS_GUID_DWORD1 + cmp dword [eax + 0x14], FFS3_GUID_DWORD1 jne searchingForBfvHeaderLoop - cmp dword [eax + 0x18], FFS_GUID_DWORD2 + cmp dword [eax + 0x18], FFS3_GUID_DWORD2 jne searchingForBfvHeaderLoop - cmp dword [eax + 0x1c], FFS_GUID_DWORD3 + cmp dword [eax + 0x1c], FFS3_GUID_DWORD3 jne searchingForBfvHeaderLoop + jmp checkingFvLength =20 +searchingForFfs2Guid: + ; + ; Check FFS2 GUID + ; + cmp dword [eax + 0x10], FFS2_GUID_DWORD0 + jne searchingForBfvHeaderLoop + cmp dword [eax + 0x14], FFS2_GUID_DWORD1 + jne searchingForBfvHeaderLoop + cmp dword [eax + 0x18], FFS2_GUID_DWORD2 + jne searchingForBfvHeaderLoop + cmp dword [eax + 0x1c], FFS2_GUID_DWORD3 + jne searchingForBfvHeaderLoop + +checkingFvLength: [Ray] 3. Why is this label added? [Ted] You meant searchingForBfvWithOtherFfsGuid? This is used to restart a = new search with a new target guid before reaching the end of the supported = ffs guid list. ; ; Check FV Length ; @@ -57,6 +82,12 @@ searchingForBfvHeaderLoop: =20 jmp searchedForBfvHeaderAndItWasFound =20 +searchingForBfvWithOtherFfsGuid: + xor eax, eax + dec ecx + cmp ecx, 0 + jne searchingForBfvHeaderLoop + searchedForBfvHeaderButNotFound: ; ; Hang if the SEC entry point was not found -- 2.16.2.windows.1