From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: eric.dong@intel.com) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by groups.io with SMTP; Wed, 11 Sep 2019 19:54:37 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Sep 2019 19:54:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,495,1559545200"; d="scan'208";a="209870251" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 11 Sep 2019 19:54:35 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 11 Sep 2019 19:54:36 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 11 Sep 2019 19:54:35 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.113]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.132]) with mapi id 14.03.0439.000; Thu, 12 Sep 2019 10:54:33 +0800 From: "Dong, Eric" To: Laszlo Ersek , "devel@edk2.groups.io" CC: "Ni, Ray" Subject: Re: [Patch] UefiCpuPkg/CpuDxe: clean up PAGE_TABLE_LIB_PAGING_CONTEXT usage. Thread-Topic: [Patch] UefiCpuPkg/CpuDxe: clean up PAGE_TABLE_LIB_PAGING_CONTEXT usage. Thread-Index: AQHVaLUfW6hE9pfM6JFwxmMja2+6BqcnO16Q Date: Thu, 12 Sep 2019 02:54:33 +0000 Message-ID: References: <20190911014511.9356-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 Return-Path: eric.dong@intel.com Content-Language: en-US Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 SGkgTGFzemxvLA0KDQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IExhc3ps byBFcnNlayBbbWFpbHRvOmxlcnNla0ByZWRoYXQuY29tXQ0KPiBTZW50OiBXZWRuZXNkYXksIFNl cHRlbWJlciAxMSwgMjAxOSAxMToyNSBQTQ0KPiBUbzogRG9uZywgRXJpYyA8ZXJpYy5kb25nQGlu dGVsLmNvbT47IGRldmVsQGVkazIuZ3JvdXBzLmlvDQo+IENjOiBOaSwgUmF5IDxyYXkubmlAaW50 ZWwuY29tPg0KPiBTdWJqZWN0OiBSZTogW1BhdGNoXSBVZWZpQ3B1UGtnL0NwdUR4ZTogY2xlYW4g dXANCj4gUEFHRV9UQUJMRV9MSUJfUEFHSU5HX0NPTlRFWFQgdXNhZ2UuDQo+IA0KPiBPbiAwOS8x MS8xOSAwMzo0NSwgRXJpYyBEb25nIHdyb3RlOg0KPiA+IFJFRjogaHR0cHM6Ly9idWd6aWxsYS50 aWFub2NvcmUub3JnL3Nob3dfYnVnLmNnaT9pZD0xMDM5DQo+ID4NCj4gPiBDdXJyZW50IGltcGxl bWVudGF0aW9uIG5vdCBjaGVja3Mgc3lzdGVtIG1vZGUgYmVmb3JlIHVzaW5nDQo+ID4gUEFHRV9U QUJMRV9MSUJfUEFHSU5HX0NPTlRFWFQuQ29udGV4dERhdGEuWDY0IG9yDQo+ID4gUEFHRV9UQUJM RV9MSUJfUEFHSU5HX0NPTlRFWFQuQ29udGV4dERhdGEuSWEzMi4gVGhpcyBwYXRjaCBjaGVjaw0K PiB0aGUNCj4gPiBtb2RlIGJlZm9yZSB1c2luZyB0aGUgY29ycmVjdCBvbmUuDQo+ID4NCj4gPiBD YzogUmF5IE5pIDxyY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