From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5372D209884A8 for ; Wed, 4 Jul 2018 18:26:49 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jul 2018 18:26:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,309,1526367600"; d="scan'208,217";a="68758252" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga004.fm.intel.com with ESMTP; 04 Jul 2018 18:26:37 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 4 Jul 2018 18:26:37 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 4 Jul 2018 18:26:36 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.57]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.100]) with mapi id 14.03.0319.002; Thu, 5 Jul 2018 09:26:35 +0800 From: "Dong, Eric" To: Fan Jeff , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" , Laszlo Ersek Thread-Topic: [Patch] UefiCpuPkg/MpInitLib: Optimize get processor number performance. Thread-Index: AQHUE3rmDFOShawv6UKSeDwsvBHbsKR/10eA Date: Thu, 5 Jul 2018 01:26:34 +0000 Message-ID: References: <20180704083736.9272-1-eric.dong@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.26 Subject: Re: [Patch] UefiCpuPkg/MpInitLib: Optimize get processor number performance. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 01:26:49 -0000 Content-Language: en-US Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 SmVmZiwNCg0KR290IGl0LiBXaWxsIHVwZGF0ZSB0aGUgY2hhbmdlIGxvZyB3aGVuIEkgY29tbWl0 IHRoZSBjaGFuZ2VzLg0KDQpUaGFua3MsDQpFcmljDQpGcm9tOiBGYW4gSmVmZiBbbWFpbHRvOnZh bmplZmZfOTE5QGhvdG1haWwuY29tXQ0KU2VudDogV2VkbmVzZGF5LCBKdWx5IDQsIDIwMTggNToz OSBQTQ0KVG86IERvbmcsIEVyaWMgPGVyaWMuZG9uZ0BpbnRlbC5jb20+OyBlZGsyLWRldmVsQGxp c3RzLjAxLm9yZw0KQ2M6IE5pLCBSdWl5dSA8cnVpeXUubmlAaW50ZWwuY29tPjsgTGFzemxvIEVy c2VrIDxsZXJzZWtAcmVkaGF0LmNvbT4NClN1YmplY3Q6ILTwuLQ6IFtQYXRjaF0gVWVmaUNwdVBr Zy9NcEluaXRMaWI6IE9wdGltaXplIGdldCBwcm9jZXNzb3IgbnVtYmVyIHBlcmZvcm1hbmNlLg0K DQoNCkVyaWMsDQoNCg0KDQpDdXJyZW50IGltcGxlbWVudGF0aW9uIGRvZXMgbm90IGNhbGwgR2V0 QXBpY2lkKCkgbWFueSB0aW1lcywgIFBsZWFzZSBjb3JyZWN0IHlvdSBjb21taXQgbWVzc2FnZS4g WW91ciBmaXggaXMgd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