Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5433325imb; Thu, 7 Mar 2019 15:57:02 -0800 (PST) X-Google-Smtp-Source: APXvYqxCQLf4L7FIGAV5XVepxIEuMPxP5kErxpIFxmIQwf+2v0VCevDKW9z+gdyczO037OfkbC/L X-Received: by 2002:a63:2b82:: with SMTP id r124mr13807039pgr.214.1552003022515; Thu, 07 Mar 2019 15:57:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552003022; cv=none; d=google.com; s=arc-20160816; b=xE9YPybuM4482IRKfLfXZuW7+8UB4VNXK2KMeO6GjIoK0neXRwL290twV1Hhbw0m0P Vdy3uxhhVod9PGa/bWw1XaBCgmETyu21gNkLhaWCvMix3kd2qGCokwZGfyr/TKZIaj6Y w6284s9wffWzZSbOxlQNOfZnRhi3iJVxgyWSPsl6k//jJDAiv2hCOM7YWPZYSlyDKVxV O0H/71xsZkipvpJQzYtqTmpnMDbvG0OkBlqmLOza1QD1cSc46ZloH64vw+zZTvq20PT9 nUqOUTOh+EsQWdsbaDbewgVYOful8641hPM92s1cXolUkIrtXWYKSs0C7hITGccJgkuw odPA== 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=NYnuGQhIFO3XY5NyMp3ADwVTJGf8qukNSDVnnu+JGvE=; b=Kx6ygYBmZKZTFVXY8LmwyeFV7kUE/k0JRtoFIYgQzrjKKQb5WolfSy1QbHwLIrKASp W/ma0Qwe6tcSd6EMqY3ji6JjtiXkVuhHBGgQmYlGTI/YoUGhcpd/VzdXj+xkBswsSffd X8JIxxnyNmh/LVjPWaGO7dTBkoGARR5ErAu1s40Sp7QU8/UrqZqQQ4DJEmcDn51vPx5h ZcA64juvd0yM0DAV0R1EJMUhBwCTTyYo22AJwixCwwiS3C0NWDlgDB+WWePVSAKPwh6q JGh0TKJCPyLHPrnnxx7trtxsvdZ+GWVfAu1F+uR/mN7+bs6/TRMdISzW11pchGBHOZwh +h5w== 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 m32si5502669pld.262.2019.03.07.15.56.46; Thu, 07 Mar 2019 15:57:02 -0800 (PST) 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 S1726267AbfCGX41 (ORCPT + 99 others); Thu, 7 Mar 2019 18:56:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37784 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726234AbfCGX41 (ORCPT ); Thu, 7 Mar 2019 18:56:27 -0500 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 0E93D3084247; Thu, 7 Mar 2019 23:56:27 +0000 (UTC) Received: from w520.home (ovpn-116-24.phx2.redhat.com [10.3.116.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F7A5600D4; Thu, 7 Mar 2019 23:56:23 +0000 (UTC) Date: Thu, 7 Mar 2019 16:56:23 -0700 From: Alex Williamson To: Neo Jia Cc: Lu Baolu , Joerg Roedel , David Woodhouse , Kirti Wankhede , , , , , Jean-Philippe Brucker , , , , , , , , , Jacob Pan Subject: Re: [PATCH v7 9/9] vfio/type1: Handle different mdev isolation type Message-ID: <20190307165623.1834cc93@w520.home> In-Reply-To: <20190307084453.GA9288@nvidia.com> References: <20190222021927.13132-1-baolu.lu@linux.intel.com> <20190222021927.13132-10-baolu.lu@linux.intel.com> <20190307084453.GA9288@nvidia.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.40]); Thu, 07 Mar 2019 23:56:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 7 Mar 2019 00:44:54 -0800 Neo Jia wrote: > On Fri, Feb 22, 2019 at 10:19:27AM +0800, Lu Baolu wrote: > > This adds the support to determine the isolation type > > of a mediated device group by checking whether it has > > an iommu device. If an iommu device exists, an iommu > > domain will be allocated and then attached to the iommu > > device. Otherwise, keep the same behavior as it is. > > > > Cc: Ashok Raj > > Cc: Jacob Pan > > Cc: Kevin Tian > > Signed-off-by: Sanjay Kumar > > Signed-off-by: Liu Yi L > > Signed-off-by: Lu Baolu > > Reviewed-by: Jean-Philippe Brucker > > --- > > drivers/vfio/vfio_iommu_type1.c | 48 ++++++++++++++++++++++++++++----- > > 1 file changed, 41 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c > > index ccc4165474aa..f1392c582a3c 100644 > > --- a/drivers/vfio/vfio_iommu_type1.c > > +++ b/drivers/vfio/vfio_iommu_type1.c > > @@ -1368,13 +1368,40 @@ static void vfio_iommu_detach_group(struct vfio_domain *domain, > > iommu_detach_group(domain->domain, group->iommu_group); > > } > > > > Hi Baolu, > > To allow IOMMU-awared mdev, I think you need to modify the > vfio_iommu_type1_pin_pages and vfio_iommu_type1_unpin_pages to remove the > iommu->external_domain check. > > Could you please include that in your patch? If not, I can send out a separate > patch to address that issue. I figured it was intentional that an IOMMU backed mdev would not use the pin/unpin interface and therefore the exiting -EINVAL returns would be correct. Can you elaborate on the use case for still requiring the mdev pin/unpin interface for these devices? Thanks, Alex