From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jian.j.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 591792202E484 for ; Wed, 14 Mar 2018 21:58:00 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Mar 2018 22:04:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,308,1517904000"; d="scan'208";a="24668836" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga008.fm.intel.com with ESMTP; 14 Mar 2018 22:04:23 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 14 Mar 2018 22:04:24 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 14 Mar 2018 22:04:23 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.235]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.108]) with mapi id 14.03.0319.002; Thu, 15 Mar 2018 13:04:21 +0800 From: "Wang, Jian J" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" CC: "Yao, Jiewen" , "Dong, Eric" , "Zeng, Star" Thread-Topic: [edk2] [PATCH] MdeModulePkg/Core: allow HeapGuard even before CpuArchProtocol installed Thread-Index: AQHTvAVASaY2lsHvvUO8aXi2NVuBb6PQIlqAgACbkvA= Date: Thu, 15 Mar 2018 05:04:20 +0000 Message-ID: References: <20180315022750.15216-1-jian.j.wang@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGMwNjc1ZmEtODIzNy00ZDNjLWEwYWUtY2VjMjc3MDhmMWU4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJLVFcreEE0VWcwTnBBbmtqRDhZNnlOVTlBZ0hKUDVTamk1VnFXV1Y5R3IwTW5FcjV4OVVwNnBubG12cDdRaGl3In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg/Core: allow HeapGuard even before CpuArchProtocol installed X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 04:58:00 -0000 Content-Language: en-US Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 VGhhbmtzIGNhdGNoaW5nIHRoaXMuIE5ldyBwYXRjaCBoYXMgc2VudCBvdXQuDQoNClJlZ2FyZHMs DQpKaWFuDQoNCg0KPiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBOaSwgUnVp eXUNCj4gU2VudDogVGh1cnNkYXksIE1hcmNoIDE1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gPiArICAgICAgICBMZXZlbCAgICAgICAgICAgICs9IDE7DQo+ID4gKyAgICAgICAg VGFibGVzW0xldmVsXSAgICAgPSBUYWJsZUVudHJ5Ow0KPiA+ICsgICAgICAgIEFkZHJlc3Nlc1tM ZXZlbF0gID0gQWRkcmVzczsNCj4gPiArICAgICAgICBJbmRpY2VzW0xldmVsXSAgICA9IDA7DQo+ ID4gKw0KPiA+ICsgICAgICAgIGNvbnRpbnVlOw0KPiA+ICsNCj4gPiArICAgICAgfSBlbHNlIHsN Cj4gPiArDQo+ID4gKyAgICAgICAgSW5kZXggPSAwOw0KPiA+ICsgICAgICAgIHdoaWxlIChJbmRl eCA8IEdVQVJERURfSEVBUF9NQVBfRU5UUllfQklUUykgew0KPiA+ICsgICAgICAgICAgaWYgKChU YWJsZUVudHJ5ICYgMSkgPT0gMSkgew0KPiA+ICsgICAgICAgICAgICBpZiAoT25HdWFyZGluZykg ew0KPiA+ICsgICAgICAgICAgICAgIEd1YXJkUGFnZSA9IDA7DQo+ID4gKyAgICAgICAgICAgIH0g ZWxzZSB7DQo+ID4gKyAgICAgICAgICAgICAgR3VhcmRQYWdlID0gQWRkcmVzcyAtIEVGSV9QQUdF X1NJWkU7DQo+ID4gKyAgICAgICAgICAgIH0NCj4gPiArICAgICAgICAgICAgT25HdWFyZGluZyA9 IFRSVUU7DQo+ID4gKyAgICAgICAgICB9IGVsc2Ugew0KPiA+ICsgICAgICAgICAgICBpZiAoT25H dWFyZGluZykgew0KPiA+ICsgICAgICAgICAgICAgIEd1YXJkUGFnZSA9IEFkZHJlc3M7DQo+ID4g KyAgICAgICAgICAgIH0gZWxzZSB7DQo+ID4gKyAgICAgICAgICAgICAgR3VhcmRQYWdlID0gMDsN Cj4gPiArICAgICAgICAgICAgfQ0KPiA+ICsgICAgICAgICAgICBPbkd1YXJkaW5nID0gRkFMU0U7 DQo+ID4gKyAgICAgICAgICB9DQo+ID4gKw0KPiA+ICsgICAgICAgICAgaWYgKEd1YXJkUGFnZSA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