From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 74EBC21A04830 for ; Tue, 2 May 2017 05:43:24 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP; 02 May 2017 05:43:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,405,1488873600"; d="scan'208,217";a="96614705" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 02 May 2017 05:43:23 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 2 May 2017 05:43:22 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.246]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0319.002; Tue, 2 May 2017 20:43:21 +0800 From: "Yao, Jiewen" To: Ard Biesheuvel CC: "edk2-devel@lists.01.org" , "Ni, Ruiyu" , Leo Duran , Brijesh Singh Thread-Topic: [PATCH 3/3] MdeModulePkg/PciBus: Add IOMMU support. Thread-Index: AQHSwyuLFCHlFIHP4ESMs79jH3wPGaHg/Chw Date: Tue, 2 May 2017 12:43:19 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503A9367F0@shsmsx102.ccr.corp.intel.com> References: <1493473694-5064-1-git-send-email-jiewen.yao@intel.com> <1493473694-5064-4-git-send-email-jiewen.yao@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: Re: [PATCH 3/3] MdeModulePkg/PciBus: Add IOMMU support. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 12:43:24 -0000 Content-Language: en-US Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 VGhhbmsgeW91Lg0KDQpNeSBtaXN0YWtlLiBJdCBzZWVtcyBteSB0ZXN0IHBsYXRmb3JtIGRvZXMg bm90IGhhdmUgc3VjaCBjYXBhYmlsaXR5Lg0KDQpJdCBpcyBmaXhlZCBpbiBWNS4NCg0KVGhhbmsg eW91DQpZYW8gSmlld2VuDQoNCkZyb206IEFyZCBCaWVzaGV1dmVsIFttYWlsdG86YXJkLmJpZXNo ZXV2ZWxAbGluYXJvLm9yZ10NClNlbnQ6IFR1ZXNkYXksIE1heSAyLCAyMDE3IDY6MDQgUE0NClRv OiBZYW8sIEppZXdlbiA8amlld2VuLnlhb0BpbnRlbC5jb20+DQpDYzogZWRrMi1kZXZlbEBsaXN0 cy4wMS5vcmc7IE5pLCBSdWl5dSA8cnVpeXUubmlAaW50ZWwuY29tPjsgTGVvIER1cmFuIDxsZW8u ZHVyYW5AYW1kLmNvbT47IEJyaWplc2ggU2luZ2ggPGJyaWplc2guc2luZ2hAYW1kLmNvbT4NClN1 YmplY3Q6IFJlOiBbUEFUQ0ggMy8zXSBNZGVNb2R1bGVQa2cvUGNpQnVzOiBBZGQgSU9NTVUgc3Vw cG9ydC4NCg0KT24gMjkgQXByaWwgMjAxNyBhdCAxNDo0OCwgSmlld2VuIFlhbyA8amlld2VuLnlh b0BpbnRlbC5jb208bWFpbHRvOmppZXdlbi55YW9AaW50ZWwuY29tPj4gd3JvdGU6DQo+IElmIElP TU1VIHByb3RvY29sIGlzIGluc3RhbGxlZCwgUGNpQnVzIG5lZWQgY2FsbCBJT01NVQ0KPiB0byBz Z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RGV2aWNlLT5IYW5kbGUsDQo+ICsgICAgICAgICAgICAgICAgICAgICAgICAqTWFwcGlu ZywNCj4gKyAgICAgICAgICAgICAgICAgICAgICAgIElvTW11QXR0cmlidXRlDQo+ICsgICAgICAg ICAgICAgICAgICAgICAgICApOw0KPiArICAgIH0NCj4gKyAgfQ0KPiArDQo+ICAgIHJldHVybiBT dGF0dXM7DQo+ICB9DQo+DQo+IEBAIC0xMDI0LDYgKzEwNTIsMTUgQEAgUGNpSW9Vbm1hcCAoDQo+ DQo+ICAgIFBjaUlvRGV2aWNlID0gUENJX0lPX0RFVklDRV9GUk9NX1BDSV9JT19USElTIChUaGlz KTsNCj4NCj4gKyAgaWYgKG1Jb01tdVByb3RvY29sICE9IE5VTEwpIHsNCj4gKyAgICBtSW9NbXVQ cm90b2NvbC0+U2V0TWFwcGluZ0F0dHJpYnV0ZSAoDQo+ICsgICAgICAgICAgICAgICAgICAgICAg bUlvTW11UHJvdG9jb2wsDQo+ICsgICAgICAgICAgICAgICAgICAgICAgUGNpSW9EZXZpY2UtPkhh bmRsZSwNCj4gKyAgICAgICAgICAgICAgICAgICAgICBNYXBwaW5nLA0KPiArICAgICAgICAgICAg ICAgICAgICAgIDANCj4gKyAgICAgICAgICAgICAgICAgICAgICApOw0KPiArICB9DQo+ICsNCj4g ICAgU3RhdHVzID0gUGNpSW9EZXZpY2UtPlBjaVJvb3RCcmlkZ2VJby0+VW5tYXAgKA0KPiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGNpSW9EZXZpY2UtPlBjaVJv b3RCcmlkZ2VJbywNCj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IE1hcHBpbmcNCj4gLS0NCj4gMi43LjQud2luZG93cy4xDQo+DQo=