Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3291863imm; Tue, 4 Sep 2018 20:03:14 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaHuoo68McywxS0fNXDaZIS/JPTkLI7oSW1ujbQVMAQSBA632CA5G3QOnRbXTyTCcbgsXuK X-Received: by 2002:a17:902:6b05:: with SMTP id o5-v6mr36920001plk.338.1536116594341; Tue, 04 Sep 2018 20:03:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536116594; cv=none; d=google.com; s=arc-20160816; b=lfYlGGFugCK5vGXvlFfp4Cvej4hJTuGeG7Yd6yS4kN4NTfrrUvKw0XwU6b28G7nPXV t/jC2/gaEMyVYc9ukrQDeHDm61Jw9pwOOt9EGvUrkZVGoZxNRatS3mK45vXpKlsZ2lOM xlpt+xYEcsC3UbS8E9uJU1LZGFOEmgcXANw9skd2+Nnnbis394zQ+ejGHbKR8gjz/s52 gU22GxeQt1xUBqw754IKXMSAZJIraUOVzjw2hxO8521FUoQVueZBn4UjiB0aVOnNHrhk Y/PMyBwwfUGwj96yS7aTEjFxDOiBvF+UYJc2AxHAjM75TWXm1EBTGpJD8LnOIVBfVEai KFjg== 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; bh=20LgMTjK5Z8XBokm8Q292FCQqsLDc1AcBBu0u0hskig=; b=n2eM1H461St1SH0dUUEKjQY9nMubf/F50SI5F7V3sGUaFO9WpNjfvuc9pFMFhyOtDG aTVrIzhdCafNABLH9TUEqr0xnI2YOoogcI7dU7fm9pd7HSUURJiaQNZs27Iyu2/eq0ml TiyxqN3xOkS+x/iw1AIsXVyAwytt+Y4LRnmsfg90GMOhl3u6gzZgNuCU2fN2nlld/G+S uh8WB35OKNZ3X/yk+tMgPb1L1oFFCZztpQ02F9rI/aZkCPS1nkQId9jhShzstRkBnLsE 4PE93s/Ie3Il+8JCnFuw1nVFKia3kbtat3xcBj31EqU+2Pd6vdIAoHBEzUexEqRxuy85 zJHg== 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 x10-v6si673063pgt.655.2018.09.04.20.02.58; Tue, 04 Sep 2018 20:03:14 -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 S1727154AbeIEH3v convert rfc822-to-8bit (ORCPT + 99 others); Wed, 5 Sep 2018 03:29:51 -0400 Received: from mga07.intel.com ([134.134.136.100]:44324 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725825AbeIEH3v (ORCPT ); Wed, 5 Sep 2018 03:29:51 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2018 20:01:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,331,1531810800"; d="scan'208";a="71672849" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga006.jf.intel.com with ESMTP; 04 Sep 2018 20:01:42 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 4 Sep 2018 20:01:42 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 4 Sep 2018 20:01:42 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.205]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.16]) with mapi id 14.03.0319.002; Wed, 5 Sep 2018 11:01:40 +0800 From: "Tian, Kevin" To: Lu Baolu , Joerg Roedel , "David Woodhouse" , Alex Williamson , Kirti Wankhede CC: "Raj, Ashok" , "Kumar, Sanjay K" , "Pan, Jacob jun" , Jean-Philippe Brucker , "Liu, Yi L" , "Sun, Yi Y" , "peterx@redhat.com" , "Bie, Tiwei" , "iommu@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [RFC PATCH v2 00/10] vfio/mdev: IOMMU aware mediated device Thread-Topic: [RFC PATCH v2 00/10] vfio/mdev: IOMMU aware mediated device Thread-Index: AQHUQBd63AINefsFr0WaDhgLiguCyqThBixA Date: Wed, 5 Sep 2018 03:01:39 +0000 Message-ID: References: <20180830040922.30426-1-baolu.lu@linux.intel.com> In-Reply-To: <20180830040922.30426-1-baolu.lu@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjI0Njc5ZDUtNWJlZS00MDQ0LWFjZWEtNGY3ZmRhMjgwNTUyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNjRFSHlYMXJENXE0S2pTQk9pQmo2cUo5TzZ4a0dEYVAzZ21cL0pOMllSbFwvRHo5WEtwOHJJRWVUb3p6MWQ1bkVYIn0= dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Lu Baolu [mailto:baolu.lu@linux.intel.com] > Sent: Thursday, August 30, 2018 12:09 PM > [...] > > In order to distinguish the IOMMU-capable mediated devices from those > which still need to rely on parent devices, this patch set adds a > domain type attribute to each mdev. > > enum mdev_domain_type { > DOMAIN_TYPE_NO_IOMMU, /* Don't need any IOMMU support. > * All isolation and protection > * are handled by the parent > * device driver with a device > * specific mechanism. > */ > DOMAIN_TYPE_ATTACH_PARENT, /* IOMMU can isolate and > protect > * the mdev, and the isolation > * domain should be attaced with > * the parent device. > */ > }; > ATTACH_PARENT is not like a good counterpart to NO_IOMMU. what about DOMAIN_TYPE_NO_IOMMU/DOMAIN_TYPE_IOMMU? whether to attach parent device is just internal logic. Alternatively DOMAIN_TYPE_SOFTWARE/DOMAIN_TYPE_HARDWARE, where software means iommu_domain is managed by software while the other means managed by hardware. One side note to Alex - with multiple domain extension in IOMMU layer, this version combines IOMMU-capable usages in VFIO: PASID-based (as in scalable iov) and RID-based (as the usage of mdev wrapper on any device). Both cases share the common path - just binding the domain to the parent device of mdev. IOMMU layer will handle two cases differently later. Thanks Kevin