From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web08.4150.1634608757352677994 for ; Mon, 18 Oct 2021 18:59:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=nUZ3gAfF; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: ray.ni@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10141"; a="209200667" X-IronPort-AV: E=Sophos;i="5.85,383,1624345200"; d="scan'208";a="209200667" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2021 18:59:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,383,1624345200"; d="scan'208";a="566730398" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by FMSMGA003.fm.intel.com with ESMTP; 18 Oct 2021 18:59:16 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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.2242.12; Mon, 18 Oct 2021 18:59:15 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 18 Oct 2021 18:59:15 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 18 Oct 2021 18:59:15 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.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.2242.12; Mon, 18 Oct 2021 18:59:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aj9mV99qIJxF7VAJPF6dx6Ju/7CWXycIpqXXsurn2fA1TrGUhBanwl5TADJtIc6Oc+NGL3O0TeW9pTTVq+JiS/+LMsofS79kJiXb27f0UKameAvx9weTHwyRrqh7tseQV0c0GFU9LeW6EdZ/OLIrBcignqfSvkkIKAMWL7RShoTKoSL8vy3jU8x10vvTH9+rya/7TMZ/rs/oC6GlbgmQQ9btQyZ6uwgjx3kYM1ZegZmfirAorIg8r0YzBbyUz9bYvc9Gtx5EVlCoElJdBYLKhao/m+DSXrpIs4X+dqKb6uHTqH569BLi4mbMUPMHtB3jKA4B7hiIFAtwMuQPLuy6EA== 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=gEQK5EbynP+x0CSyMRqsrdb5Ou11FGoRc4t6WJP/k8g=; b=cd09uIvZDpYUmBPocQLjzX29Y7YvuRKSzszz0kQJFsKuayeZFFwZik1lf1/uJQhrhmFT0Z5pR0X56pB/ZtF19nCUyyJ+4gG4AakSn5Ub3eTBv5rRipGItZG+U5XPs7/Hjhs/QSI8iuR++w0E2DveLsG8YVEAQyQemebXmeLpXPzGI5n01fonYV7+R/mXC4KlSMHJCkP9taa3xpatatg6jVIRuT14q9saU0ukMRujon9XS9+VntFpVxFmKUiXhCpjgtA9DZN7vu9kq+CBMyq2eagErfH0y4XzzJg4c7TJJWaL1heGF/t4qJ/1tmMJuGmUJ7vvZuOfweTmxBjIzzDObg== 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=gEQK5EbynP+x0CSyMRqsrdb5Ou11FGoRc4t6WJP/k8g=; b=nUZ3gAfFngvHpCxg8jeFthKrf4QAKRchzDXncMZ+P4PPPYvJ/rEcLJugWjF55Q3eAQyrcGZA/XjbpAngGINFDhvLbpR7rfgAgjAkuqnz6O1A5rOzqMFOSaXvMnSobH1dIBQLQybl7WZAvMqQtrYJSQeSzvibuNBMpyjlmjHhe1Q= Received: from BN0PR11MB5696.namprd11.prod.outlook.com (2603:10b6:408:14b::11) by BN0PR11MB5696.namprd11.prod.outlook.com (2603:10b6:408:14b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Tue, 19 Oct 2021 01:59:14 +0000 Received: from BN0PR11MB5696.namprd11.prod.outlook.com ([fe80::317e:de35:e920:7778]) by BN0PR11MB5696.namprd11.prod.outlook.com ([fe80::317e:de35:e920:7778%3]) with mapi id 15.20.4608.018; Tue, 19 Oct 2021 01:59:14 +0000 From: "Ni, Ray" To: "Kuo, IanX" , "devel@edk2.groups.io" CC: "Chan, Amy" , "Dong, Eric" , "Kumar, Rahul1" Subject: Re: [PATCH v6 3/3] UefiCpuPkg/CpuCacheInfoLib: Add QuickSort function on BaseLib Thread-Topic: [PATCH v6 3/3] UefiCpuPkg/CpuCacheInfoLib: Add QuickSort function on BaseLib Thread-Index: AQHXw9el8/67+bo7DE+R+9CsbfOVAavZkc4g Date: Tue, 19 Oct 2021 01:59:14 +0000 Message-ID: References: <20211018042127.1306-1-ianx.kuo@intel.com> <20211018042127.1306-4-ianx.kuo@intel.com> In-Reply-To: <20211018042127.1306-4-ianx.kuo@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 32d09b96-f253-45d0-d1e4-08d992a40d2c x-ms-traffictypediagnostic: BN0PR11MB5696: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:363; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kvTBn/qnleNNnQLPDvVoahrRGHaO3Kv71rkysOdCn2u3tpGDcY0XEcppisXDOgsiKycSQ7WQwzmP+o9SpFg2zSYpGIdT7F12E6NiThSi9Jv/7MFy1f66w2yp/DzPAn9LVa6E1Zk8L2XySPv0awJ8trYNuX5XHu+pZVBcOUAWkuhHofDj0jUCXcjUEcsvGsp/En27sXpYNW4GFhZOKV0jXhMIKLcaP2Cg/gUib1ke8jZiGd5YP4rL3rUMR/TCXcxQjdaXNyA+WO43e6SFKLDUnvFMSzXsdtygRlxn/1lQoa6haXMRjFBKPsvzpv8JilsbWh6EEoTtPB91tto8xwnnILRsrepkWNZEkS5rEtfLp/FImni1EUOWwJpYL3kKIy1qoL4zQTF8g6TVZAH7qpCz3isYvbhG8cCKhPLkCbTkj6qorRn1J6gkWUA9FGSyfLO4AuTERpaQit4T1NLCQi+f4p91+X5K3k44epnmk3GcmAPk6B2D0wE/R30bGIx10F5pbZLc9N6hBlE5LSN11h4MqemoQh9JeLZK8ksLGZTPDeZyBGMZ5+sB6581Hsly0ULbMFjkq72fh05G2ZnyHGJeXv8yY2IKSEH1TNxRbMiA/VK038NIP+kOrcxyTQN9L6H1jIOeiDfPKFH0g06Rg/CcR/XPSO8vbHROQb5kX9SN+ZmtEdaM86HSmCpMTvS2Hit05133+3pWSzOyMP3Z2Hkl1xwZL6FwA+imzqN9AP6y7t9I6s42iCpimXrcUq7BOoTBNMzqntyJ0ZouAEaz3wBUb6idsg/irfnT+9StepGpfNE= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN0PR11MB5696.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(316002)(19627235002)(83380400001)(71200400001)(38070700005)(38100700002)(26005)(76116006)(55016002)(4326008)(5660300002)(110136005)(8676002)(966005)(9686003)(6506007)(122000001)(53546011)(66946007)(66476007)(66556008)(64756008)(66446008)(54906003)(86362001)(107886003)(7696005)(33656002)(508600001)(2906002)(8936002)(52536014)(186003)(82960400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Rk28nrxWyxK8gDyFq47X2vDCPhyhDYMfOP5auNyz6MJH4tmuJFpRpWiR+cX+?= =?us-ascii?Q?HzEyDEneAEhant1eNW65aeH9MR7mSJINpQKxbqSOenawJtVGlLSFa4r9sH9e?= =?us-ascii?Q?Or5V+k/tY+ZqcZHYejRKnY04AbC7JiKU+n4Om1GKi7sij4aWgfkz6B/J1268?= =?us-ascii?Q?lfa60pwnEbs+eixv9B2hHBphfYJyk4Zyj6Nna8c7b/Ur61ZcsCczHaVjg/Gl?= =?us-ascii?Q?vPTdWNHmOsHFiO2eHrYP7kSLZc37ormjG54e1YTz8GJdSZqk8WbJnGvDGFbE?= =?us-ascii?Q?bDjngQVF4IlojRCkv1GlpI2kBqXQTwnwQP5+JFWsCxhfwuwklpR89YwPSqbo?= =?us-ascii?Q?1mungM8lgW0NBdYaOE7BtA2pQg5cDWfj7C4EsfiLuPR+yYagHCCZQac7QCHS?= =?us-ascii?Q?JsOWVrkoUxQ+MpBtMs7gAFvZyUqkw6CB4PqOlupiEFQtve0AgAXMpWOh2n32?= =?us-ascii?Q?TUjVZkf+lgji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Tenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN0PR11MB5696.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32d09b96-f253-45d0-d1e4-08d992a40d2c X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Oct 2021 01:59:14.0967 (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: tmjGOITAoOIQMhWsPcMjDfFnJHIim9R5UqUykTcd/if3b9zQfd8DNkA0+j7COLfMbJB/o7rUwJ3uMxCmW1eODw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR11MB5696 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 Reviewed-by: Ray Ni -----Original Message----- From: Kuo, IanX =20 Sent: Monday, October 18, 2021 12:21 PM To: devel@edk2.groups.io Cc: Chan, Amy ; Ni, Ray ; Kuo, IanX <= ianx.kuo@intel.com>; Dong, Eric ; Kumar, Rahul1 Subject: [PATCH v6 3/3] UefiCpuPkg/CpuCacheInfoLib: Add QuickSort function = on BaseLib From: IanX Kuo REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3675 Remove MdeModulePkg dependency Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Signed-off-by: IanX Kuo --- UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c | 3 ++- UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf | 2 -- UefiCpuPkg/Library/CpuCacheInfoLib/InternalCpuCacheInfoLib.h | 1 - UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf | 2 -- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c b/UefiCpu= Pkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c index c0077d6770..f4fcee39e9 100644 --- a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c +++ b/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c @@ -282,6 +282,7 @@ CpuCacheInfoCollectCpuCacheInfoData ( UINTN LocalCacheInfoCount; UINTN Index; UINTN NextIndex; + CPU_CACHE_INFO SortBuffer; =20 // // Get number of Packages and Package ID. @@ -369,7 +370,7 @@ CpuCacheInfoCollectCpuCacheInfoData ( // // Sort LocalCacheInfo array by CPU package ID, core type, cache level= and cache type. // - PerformQuickSort (LocalCacheInfo, LocalCacheInfoCount, sizeof (*LocalC= acheInfo), (SORT_COMPARE) CpuCacheInfoCompare); + QuickSort (LocalCacheInfo, LocalCacheInfoCount, sizeof (*LocalCacheInf= o), CpuCacheInfoCompare, (VOID*) &SortBuffer); CopyMem (CacheInfo, LocalCacheInfo, sizeof (*CacheInfo) * LocalCacheIn= foCount); DEBUG_CODE ( CpuCacheInfoPrintCpuCacheInfoTable (CacheInfo, LocalCacheInfoCount); diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf b/Ue= fiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf index c3d3f1e799..fdd79970f9 100644 --- a/UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf +++ b/UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf @@ -25,7 +25,6 @@ =20 [Packages] MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec UefiCpuPkg/UefiCpuPkg.dec =20 [LibraryClasses] @@ -34,7 +33,6 @@ BaseMemoryLib MemoryAllocationLib UefiBootServicesTableLib - SortLib =20 [Protocols] gEfiMpServiceProtocolGuid diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/InternalCpuCacheInfoLib.h b= /UefiCpuPkg/Library/CpuCacheInfoLib/InternalCpuCacheInfoLib.h index 26e1f46516..829a9f43ce 100644 --- a/UefiCpuPkg/Library/CpuCacheInfoLib/InternalCpuCacheInfoLib.h +++ b/UefiCpuPkg/Library/CpuCacheInfoLib/InternalCpuCacheInfoLib.h @@ -17,7 +17,6 @@ #include #include #include -#include #include =20 typedef union { diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf b/Ue= fiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf index 0864497849..c643fc89be 100644 --- a/UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf +++ b/UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf @@ -25,7 +25,6 @@ =20 [Packages] MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec UefiCpuPkg/UefiCpuPkg.dec =20 [LibraryClasses] @@ -34,7 +33,6 @@ BaseMemoryLib MemoryAllocationLib PeiServicesTablePointerLib - SortLib =20 [Ppis] gEdkiiPeiMpServices2PpiGuid --=20 2.30.0.windows.1