Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2297261ybb; Fri, 27 Mar 2020 02:55:09 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuTZyvYiVfdKQSy+AWJTtdm/htRs3YRyr+3uat/7k6SJ64wc68ATDR0NgJHvpUiCglGosnf X-Received: by 2002:a4a:c819:: with SMTP id s25mr3063718ooq.6.1585302909834; Fri, 27 Mar 2020 02:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585302909; cv=none; d=google.com; s=arc-20160816; b=NSFt3bZdiNHTUMwmEtGZ1jQ23RVEDmAdYYbUSqDCmwrsFKZOoJ3wz1fLV5DzS2QU63 4rIYby04697oZ+P8JLzmh2r0+wTuomZZ+yIVXaIwWSLe3zlWb+XoAE8+20aY6hLII9cn KNji454eSosYG8pnZVYyLZnKf9t+rc1oXBh84V8LSyLB3J+Ip4pmDvj/k3dNxOzFPyk/ N+bpOoeHNrIPs0tNR3ixoTluCzaoSq9exdjBCrU3qCG8ImzDy54fevKJUdhECGwLC5hf x3FbnHCXVe/vXxeh63XTI24qHwpp8ATJxO3cb1Jdr9HuN0TsyddFEtlBeuNM1kzF2oxG oaQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=wxit/ehuwb3W3Lm51VsammfsZaYUZrs3Q05xpKWVDpk=; b=HBlMGDf23jsTcFtr8S5OQleBhTjEtKllXbcXAlPvQ/VvlSECQFiCiFuAFCHt3Vxx0n QAbRnPLM4dX0DSHh8fqxOISCT50TKHMjH3YQTyp1G/mLDa6Ea5gnY7XqxEgnWTC+r/IF ytDRBM8ln0c3KvHUksoE/m7+66BwzdyYDnBIkZ+qjeauefh/xemtzw9dzS/4IOCQ212a XxGggXxy7XgVop8mY6Ckhwaacaiy7Hg6XXGNGsbaJKcomq7tJVBceBQyVPJvGXD91akn htMj/ScLou+BHcGUgTRddzo5+gbQYReeB3Uwb2LfLyL9HOoeHH39i5aglBF4TKu1jcLq N0Pg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w17si2042986ooc.23.2020.03.27.02.54.56; Fri, 27 Mar 2020 02:55:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726661AbgC0JyU (ORCPT + 99 others); Fri, 27 Mar 2020 05:54:20 -0400 Received: from mga09.intel.com ([134.134.136.24]:26583 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726168AbgC0JyU (ORCPT ); Fri, 27 Mar 2020 05:54:20 -0400 IronPort-SDR: PcptPF84Ps5oz5cUcfw6Gtpjd09yVZuolFw+2ijocqspcm+JRTHqgSs9UyeQ/T0YTyOpl/iqZM sKjWXDJvzP3Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2020 02:54:15 -0700 IronPort-SDR: h1gfUZYYmsUhWmOoiElw1OyP7qYAGYT0oZCnjxnHQEB2CLgvWoIGOF6SEU3Mk0ER5aUO/eI8p5 mdTfGrmUeXtQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,311,1580803200"; d="scan'208";a="282798738" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 27 Mar 2020 02:54:15 -0700 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 27 Mar 2020 02:54:14 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 27 Mar 2020 02:54:14 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.206]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.155]) with mapi id 14.03.0439.000; Fri, 27 Mar 2020 17:54:11 +0800 From: "Tian, Kevin" To: Jacob Pan , Joerg Roedel , Alex Williamson , Lu Baolu , "iommu@lists.linux-foundation.org" , LKML , David Woodhouse , Jean-Philippe Brucker CC: "Liu, Yi L" , "Raj, Ashok" , Christoph Hellwig , Jonathan Cameron , Eric Auger Subject: RE: [PATCH 06/10] iommu/ioasid: Convert to set aware allocations Thread-Topic: [PATCH 06/10] iommu/ioasid: Convert to set aware allocations Thread-Index: AQHWAs3PpkJj4s2MkUShV+sjRp6tC6hcMlSA Date: Fri, 27 Mar 2020 09:54:11 +0000 Message-ID: References: <1585158931-1825-1-git-send-email-jacob.jun.pan@linux.intel.com> <1585158931-1825-7-git-send-email-jacob.jun.pan@linux.intel.com> In-Reply-To: <1585158931-1825-7-git-send-email-jacob.jun.pan@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org PiBGcm9tOiBKYWNvYiBQYW4gPGphY29iLmp1bi5wYW5AbGludXguaW50ZWwuY29tPg0KPiBTZW50 OiBUaHVyc2RheSwgTWFyY2ggMjYsIDIwMjAgMTo1NSBBTQ0KPiANCj4gVGhlIGN1cnJlbnQgaW9h c2lkX2FsbG9jIGZ1bmN0aW9uIHRha2VzIGEgdG9rZW4vaW9hc2lkX3NldCB0aGVuIHJlY29yZCBp dA0KPiBvbiB0aGUgSU9BU0lEIGJlaW5nIGFsbG9jYXRlZC4gVGhlcmUgaXMgbm8gYWxsb2MvZnJl ZSBvbiB0aGUgaW9hc2lkX3NldC4NCj4gDQo+IFdpdGggdGhlIElPQVNJRCBzZXQgQVBJcywgY2Fs bGVycyBtdXN0IGFsbG9jYXRlIGFuIGlvYXNpZF9zZXQgYmVmb3JlDQo+IGFsbG9jYXRlIElPQVNJ RHMgd2l0aGluIHRoZSBzZXQuIFF1b3RhIGFuZCBvdGhlciBpb2FzaWRfc2V0IGxldmVsDQo+IGFj dGl2aXRpZXMgY2FuIHRoZW4gYmUgZW5mb3JjZWQuDQo+IA0KPiBUaGlzIHBhdGNoIGNvbnZlcnRz IGV4aXN0aW5nIEFQSSB0byB0aGUgbmV3IGlvYXNpZF9zZXQgbW9kZWwuDQo+IA0KPiBTaWduZWQt b2ZmLWJ5OiBMaXUgWWkgTCA8eWkubC5saXVAaW50ZWwuY29tPg0KPiBTaWduZWQtb2ZmLWJ5OiBK YWNvYiBQYW4gPGphY29iLmp1bi5wYW5AbGludXguaW50ZWwuY29tPg0KPiAtLS0NCj4gIGRyaXZl cnMvaW9tbXUvaW50ZWwtaW9tbXUuYyB8IDEwICsrKy0tLQ0KPiAgZHJpdmVycy9pb21tdS9pbnRl bC1zdm0uYyAgIHwgMTAgKysrLS0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