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.web12.5003.1607683173864819566 for ; Fri, 11 Dec 2020 02:39:33 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=VWSxeLv7; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: ray.ni@intel.com) IronPort-SDR: 5j/hha+toGyj2UQunGX5cocuwRkHZLVNB4R5P78XNGOwVgiiKD18TjtJVD/4NfOZhMcICQVn3t kAKDGmnPnmfA== X-IronPort-AV: E=McAfee;i="6000,8403,9831"; a="173648134" X-IronPort-AV: E=Sophos;i="5.78,411,1599548400"; d="scan'208";a="173648134" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2020 02:39:33 -0800 IronPort-SDR: 0k3tBD2zpcM98vt8ZCoHWfZczWnhruRU0vVqPJReJL7HVooA01PpQ5CZfJe7bh3AwfDfKowW2a bLCQG8RyJDGQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,411,1599548400"; d="scan'208";a="321706156" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga008.fm.intel.com with ESMTP; 11 Dec 2020 02:39:32 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 11 Dec 2020 02:39:32 -0800 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 11 Dec 2020 02:39:31 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 11 Dec 2020 02:39:31 -0800 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.59) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Fri, 11 Dec 2020 02:39:31 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dMicNK22JSsyX6XZQiA0J0doHOhGhQ2HXqKr9y3iQYgKtQvTvK+juehn64rs9mjs+PseuGJ5pdcj/Ppd10DdfPVSOJsFtz0WMsMBEgl8ieHz0XbbF4Rwen1fwZPubE73lCiEaWuaHeXZ2sPV79zI9Aph+IrlekLhTaEf88QoyEctHit6lpvfRtiCgtOfyGtYj1GGaYD5f+XkTDv98FjGBshaLTvEtgfSFiyXI6S5WsMV0E6XySSy/i+I91JslYwCruBubAVEcET2llZwxWseXy/NnZHBX6Xa8rJFavey6zMsswbMgPPGKcL/jGMEx8jpJ++AQQ2OhlhQ9R/dtcYsAA== 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=1w9Hvp0BsRFez1evw7c5dRCwEA7tJEmhpP+206oTbHs=; b=Nn5pX1OA+GiM5FMdd0Nmm2+pMpnA7uBiEwvinpBxVTjlkNg96zisEf5tQtxZOSvFB5SXV+XgQ5cFvAbVpzhal9sk9tB+Tk2Wfw7E/c1Z4hcM0dujSkipmtUdPfkC4KbLlOlJTt8isaqdYD2kX296Hh0EbVOE1s5vFk7k2i5PdbWgKkk+4qx+wBPy3TCuxsT2ThnxPY3KtGGE2oKHlEqakqKHWr05us75zwdJcCPTMIQAqWgWGbHmxKnP5NKdU0RXIiFR8e/Am+75dmTIl//uoTeeSXj+c0eL2qzrWMrjPb0QOQzHdOlC6xXQNEg8QSHM94TiGnRFRROJLjmzvSHlIg== 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=1w9Hvp0BsRFez1evw7c5dRCwEA7tJEmhpP+206oTbHs=; b=VWSxeLv7OhW0NXzsckahFMCfJw7n89TsR2dFNlU++BSjzI3iqFtzun9V0iDrwD2ATQ3B5wHLGSpbsQ7HBPk5YAX1YZW17dmtSuTnqWvQk0RegwDbBTyihWPWWkbVcSzvKrfj+K64UjWbM1Y3Xt+moKKuAk+PbhIZJFQJXT7zeY8= Received: from CO1PR11MB4930.namprd11.prod.outlook.com (2603:10b6:303:9b::11) by CO1PR11MB5075.namprd11.prod.outlook.com (2603:10b6:303:9e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.14; Fri, 11 Dec 2020 10:39:30 +0000 Received: from CO1PR11MB4930.namprd11.prod.outlook.com ([fe80::d18:1234:c1d6:5936]) by CO1PR11MB4930.namprd11.prod.outlook.com ([fe80::d18:1234:c1d6:5936%7]) with mapi id 15.20.3654.017; Fri, 11 Dec 2020 10:39:30 +0000 From: "Ni, Ray" To: "Zeng, Star" , "devel@edk2.groups.io" CC: "Dong, Eric" , "Lou, Yun" , "Laszlo Ersek" Subject: Re: [PATCH] UefiCpuPkg/CpuFeature: reduce time complexty to calc CpuInfo.First Thread-Topic: [PATCH] UefiCpuPkg/CpuFeature: reduce time complexty to calc CpuInfo.First Thread-Index: AQHWzXNNDf3Wr74jB0GF2/w9GDUrxanudJyQgAND4xA= Date: Fri, 11 Dec 2020 10:39:30 +0000 Message-ID: References: <20201208150142.1894-1-ray.ni@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action 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.216] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0ce0df4e-d923-455f-93f1-08d89dc10aa7 x-ms-traffictypediagnostic: CO1PR11MB5075: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 6Nz+vZ+mpWhqz6qS3GINdeC9VWlW5IDMLZtHqOAk+Pop4Ah/ETo7CU/1l72X9XhW2XCOoO6iuYRQQafBM3Njo0soYA2ZUeBTROTs7V67zK3skrTkAh3tI5YpWziylRUtJwolrG/f+bFhasUSzG2oOzEbgTSku2Ib3rK7mwAoypiahImeXgTHjLJ2I/N5TudJ55wXnEim2BGFp3FAI1t6jZOuViIJznEifNrkHuMFMyT6JZ28QSuX2NyWa5ZX5xOeABnx8iYcHhWzGV2ypq/Yk5I0xTibx1frMMVt92RvRZql8lM8ZyPdg1aVTZ9YGSpup8//6nx5cNDye9LSheMZkn2fBXERPVPZB3KMYV6hruXEwDxXLWwfgxvkiByoY49A x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB4930.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(366004)(376002)(136003)(55016002)(5660300002)(83380400001)(4744005)(76116006)(86362001)(508600001)(66446008)(66556008)(9686003)(4326008)(52536014)(66476007)(64756008)(66946007)(26005)(8676002)(110136005)(71200400001)(6506007)(8936002)(7696005)(186003)(2906002)(33656002)(54906003)(21314003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?xAQZXDcX56Efw/DwAnpNPr2VGc5zUuJngQ2Ad1xzosreYfu/X7uZvuviy+le?= =?us-ascii?Q?/EyfVSCraZD4NvUEqp8ske4zu9EPQKSU2JpQFLo6Pi9hJ2PuBTNZcy0vkzzR?= =?us-ascii?Q?L3NLRKMdn66fsk1PxBT76moJMEuqtJkOeUzjMK8B8F5QwGPhToDN8oNmP6ns?= =?us-ascii?Q?KCvC1gDPderrlxIz49vGe6oriK1wladt0i2D0erETRqQoJBDP6n3cSLmrdZC?= =?us-ascii?Q?GZn4U6h7NYnwePQY74t8DDQZjTwvL5sI+zAWuriFoT7i/RM85oJyMw98SxZO?= =?us-ascii?Q?Fj2wya75Xt2cAOm0Xly1Wo2c5G9PPapStCn1Oup1bVzyb9cBdH8jSRRnxHI8?= =?us-ascii?Q?LjZZKlGlkMlscw9YH61SfgqJqpZfxTp0DY3Ufpy6M9itnOSZuFMHREAVLawv?= =?us-ascii?Q?ysUDlq2hCDNTumWLz14WlsF22/eFuZ35HXRk1Y7SL+ZjBEPaZJAkgYVQguXj?= =?us-ascii?Q?ryW+pm/MBsiLC3qvGjtTh9uTsNFWc15O9sKWo1E2uQIRUhK9zaRfzQgJ5CD7?= =?us-ascii?Q?EDmMgYDO0YQYK0ysyQ1s5Xh6a+8yHkOFeVEZu4UmG0sq+5hp9eZJZNKuLsQM?= =?us-ascii?Q?BCgEHIK/6RkDH7/T8CbA45MJUgX20GYl0Oy7E1lCt1WQdEQOPvwAgHE+dYrD?= =?us-ascii?Q?qKyeL35Hocrw+VmDEXTH+Ur05OzMY2BCNaRBn3Twu9ujjHn1TJoh4GSvA6CC?= =?us-ascii?Q?x+OipTjSEgilc96jU2uOuxMIq1BSMc3GLiaJ83RxJoT+KFAuJFr9V8Rr0Tj2?= =?us-ascii?Q?onPXHBqzOavy+ed2w3a05Dsvcfh7vapMcKXVD22XbC8g4zWNnczNN5govuK5?= =?us-ascii?Q?x3STSmyT84ShO2z1QDKhRPNNi92G3v6qyIZfXsclJk1ggmwvtso8pOnQyZ/h?= =?us-ascii?Q?hIeGzVe9R4P+G9dBJk2cnkD2WkdDLDz97w7ssBU6RGRKKkeOphgWb4H4ZLM+?= =?us-ascii?Q?7s2Y31A2kj++gxDKDue2ZsdmYDk08p1Q4fdjV2xd2TZejybdn11aGvTQa2iV?= =?us-ascii?Q?kBJF?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4930.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ce0df4e-d923-455f-93f1-08d89dc10aa7 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2020 10:39:30.4206 (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: qFIqTPKllKJ6Ei1yO1H3QEL5drRrJGaDcm2TXdc2TYywJ8Cxn+sVXFQM5NgoprdiuCdmyh0NZyn84/IWTXpdbQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5075 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > > + FirstPackage =3D MAX_UINT32; > > > > + for (PackageIndex =3D 0; PackageIndex < CpuStatus->PackageCount; > > PackageIndex++) { > > > > + FirstCore[PackageIndex] =3D MAX_UINT32; > > > > + for (CoreIndex =3D 0; CoreIndex < CpuStatus->MaxCoreCount; CoreInd= ex++) > > { > > > > + FirstThread[PackageIndex * CpuStatus->MaxCoreCount + CoreIndex] = =3D > > MAX_UINT32; > > > > + } > > > > + } >=20 > Could this code block be replaced by a SetMem32(xxx, xxx, MAX_UINT32) cal= l? >=20 Yes. it could. I thought the for loop is more readable. Maybe it doesn't he= lp a lot on the code readability. Let me send an updated version to use SetMem32.