Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4195880imm; Wed, 5 Sep 2018 12:17:20 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY6L+cGkR/4yj/Ea30WzpfALrYjVRqMS14tl0Xq+UV6T2kuetxUPl6hRxpIW8TgYTAWLDyQ X-Received: by 2002:a63:6385:: with SMTP id x127-v6mr2142320pgb.413.1536175039973; Wed, 05 Sep 2018 12:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536175039; cv=none; d=google.com; s=arc-20160816; b=wo1i5hIPxcqTNKBHZEFNOWFEF3u5KkaZvvznWjMNZReKy4zo8B935nJmk2dzlz2pW3 /dawHA4YG9yyZ+3BIuHt6rgGAS8p2PfsC8tDdOwP++G5WtLmzC3putirmeS4ScPhjqfL IRIZlM1Peraf1O/S5QnISMf5muSOhPXIsUEgMRg4pEBRfKLVsbDv2xPHLqX+BiUwVILn WY88AW2TfcMBSeXxky2uscJC48rdC30HKsPi0fVe9nsMqaHcHYV7iLA0lHZhkOKmVPnC iLdDJCSRgr7hs6lXv+kPt/mAi1q45iwFgRePqy4kS7IvDkTU19LUP/PJfXDYyE4qxJCn R8qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=ydoZjx/NvPFGIifkKcVbVRuV6Oc0Tkb+YH0Q0IeXI14=; b=gIUv11GZL1MU/cXP79wyPM8OPOdJ5PzTE9HzkTSFA/FlVLPdu95opmO6mqVWgV0nmW q4ER+86NPwT5BjXe+ivtGZA2zRYnwVsP8q4Y3InS6iG+dY78XYWRLFGhL0ZhwMwummi6 o6BM/pVkyGszvZ/xMhpLS1mZFZqdi2jIIP//ji4SuJrlmUMdM49eoTFuxJr0Dtro/zaX wKyx+YxCyNZ0hjudSObZGx8EnqdME4ziuvHUxJNT5u60lKONf4GTdDAzpUKYNzz3iwk5 Z20Lo5nCBICYyh1x6IsxGiovJtcZcEladJkz4rAoXRC7nMPxVu+ua9CSIq7RxvqbGzTq 9egA== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3-v6si2605048pld.329.2018.09.05.12.17.04; Wed, 05 Sep 2018 12:17:19 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727802AbeIEXrK (ORCPT + 99 others); Wed, 5 Sep 2018 19:47:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52692 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726544AbeIEXrK (ORCPT ); Wed, 5 Sep 2018 19:47:10 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C8B03083393; Wed, 5 Sep 2018 19:15:38 +0000 (UTC) Received: from t450s.home (ovpn-116-77.phx2.redhat.com [10.3.116.77]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67D78600C5; Wed, 5 Sep 2018 19:15:34 +0000 (UTC) Date: Wed, 5 Sep 2018 13:15:34 -0600 From: Alex Williamson To: "Tian, Kevin" Cc: Lu Baolu , Joerg Roedel , "David Woodhouse" , Kirti Wankhede , "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 Message-ID: <20180905131534.1e638e3e@t450s.home> In-Reply-To: References: <20180830040922.30426-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 05 Sep 2018 19:15:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 5 Sep 2018 03:01:39 +0000 "Tian, Kevin" wrote: > > 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. Please do not use NO_IOMMU, we already have a thing called vfio-noiommu, enabled through CONFIG_VFIO_NOIOMMU and module parameter enable_unsafe_noiommu_mode. This is much, much too similar and will generate confusion. > 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. I haven't gotten deep enough into the series to see how it's used, but my gut reaction is that we don't need an enum, we just need some sort of pointer on the mdev that points to an iommu_parent, which indicates the root of our IOMMU based isolation, or is NULL, which indicates we use vendor defined isolation as we have now. > 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. Good, I'm glad you've considered the regular (RID) IOMMU domain and not just the new aux domain. Thanks, Alex