Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6427632ybi; Mon, 8 Jul 2019 02:58:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlVteTi4Gv4ieWYcCshb89NU7+gQ8BJvcuQzXZEZQZMc7MzLTZrNPjrJHSPFesoEUex8eA X-Received: by 2002:a63:1d55:: with SMTP id d21mr17000397pgm.418.1562579879872; Mon, 08 Jul 2019 02:57:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562579879; cv=none; d=google.com; s=arc-20160816; b=oHErioiFIZv8hFe/KroZpFjiLMGcESOaSVF2AkIjS9OiIVoTJKEcDvOVGoUcMGHoMl CLG3PA5mN96Rytu4CysrGy6ugL7KQiPWumVbxj5hKwcent4g0EcNGa+iIg1aY0OO1pBS M0yROXBBmTyHYAqqIvsUP/8lMtwotDglHi3ZpX3mPqR6YOMe7jBbxc7WuGRdp89lxk0f As819AnYPfu5plltxwSo6edT+yfQ0NK32amWsaMKCObseHQMUYjYI6oQuJX7OaSuNRpp j0lUlifF0+ocsqneFD/KEGlgvqomzyC/DVx+fDCW1N8Aa7bu0CIqyeBvwkY04SzKQ9ns UOpw== 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 :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=zdFoTZe5jhQgP2a+gf1wgkvmt2mMoyRBsqN5ST+5APc=; b=k8g0zinv5lsTl/gXVlhxHSTtScPE4wIBGscF8o6j/kXm25d6F/AtjKNnxSvVmOgbm0 7JbsqYaX6Qaboe0tpGYSEvHpVbNQK8gXJ/WiBb1cD0z3OTMLT8cgJgKc7BhrxbHg67ah owtRIYnA8aS5qXuKLT5hNOSlXYht36DkMusHdPlZc7BpLcHS57XQbS8I+FBxBo2179K2 AC7HLNRscRP5hFCq2AoqsxePqZ9Rc1YVIzhOzdhxK0YHdfJuVpfQdd2amxGaovldZD+r VR6d6216nj3HSVwChQePIZGvoekYuleBR/PtNQrYcUBc+Yh8PFUS7qnTLzFmNaXcxjBt xgZQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s18si16642612plp.128.2019.07.08.02.57.44; Mon, 08 Jul 2019 02:57:59 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729298AbfGHHHX (ORCPT + 99 others); Mon, 8 Jul 2019 03:07:23 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:33059 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726962AbfGHHHW (ORCPT ); Mon, 8 Jul 2019 03:07:22 -0400 Received: from lhreml709-cah.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id A46054F40AAE701A93A0; Mon, 8 Jul 2019 08:07:21 +0100 (IST) Received: from LHREML524-MBS.china.huawei.com ([169.254.2.154]) by lhreml709-cah.china.huawei.com ([10.201.108.32]) with mapi id 14.03.0415.000; Mon, 8 Jul 2019 08:07:13 +0100 From: Shameerali Kolothum Thodi To: Auger Eric , "alex.williamson@redhat.com" CC: "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , Linuxarm , John Garry , "xuwei (O)" , "kevin.tian@intel.com" Subject: RE: [PATCH v7 1/6] vfio/type1: Introduce iova list and add iommu aperture validity check Thread-Topic: [PATCH v7 1/6] vfio/type1: Introduce iova list and add iommu aperture validity check Thread-Index: AQHVLDHPKQQdUzHkf0S0a1+iQm67I6a/QOuAgAEcSsA= Date: Mon, 8 Jul 2019 07:07:13 +0000 Message-ID: <5FC3163CFD30C246ABAA99954A238FA83F2E19A9@lhreml524-mbs.china.huawei.com> References: <20190626151248.11776-1-shameerali.kolothum.thodi@huawei.com> <20190626151248.11776-2-shameerali.kolothum.thodi@huawei.com> <9ae8755a-9a2a-da76-e0c1-0f36f75ec2b3@redhat.com> In-Reply-To: <9ae8755a-9a2a-da76-e0c1-0f36f75ec2b3@redhat.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.34.206.221] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SGkgRXJpYywNCg0KPiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBBdWdlciBF cmljIFttYWlsdG86ZXJpYy5hdWdlckByZWRoYXQuY29tXQ0KPiBTZW50OiAwNyBKdWx5IDIwMTkg MTY6MDMNCj4gVG86IFNoYW1lZXJhbGkgS29sb3RodW0gVGhvZGkgPHNoYW1lZXJhbGkua29sb3Ro dW0udGhvZGlAaHVhd2VpLmNvbT47DQo+IGFsZXgud2lsbGlhbXNvbkByZWRoYXQuY29tOyBwbW9y ZWxAbGludXgudm5ldC5pYm0uY29tDQo+IENjOiBrdm1Admdlci5rZXJuZWwub3JnOyBsaW51eC1r ZXJuZWxAdmdlci5rZXJuZWwub3JnOw0KPiBpb21tdUBsaXN0cy5saW51eC1mb3VuZGF0aW9uLm9y ZzsgTGludXhhcm0gPGxpbnV4YXJtQGh1YXdlaS5jb20+OyBKb2huDQo+IEdhcnJ5IDxqb2huLmdh cnJ5QGh1Y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