Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp846900imm; Fri, 14 Sep 2018 07:14:47 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbRCSZpIVCCQoARwweHp95+VGios2Obs3458Jyv2+lgPr4RYhy4boGzA+qdrh+Gl9KTHk8D X-Received: by 2002:a63:9dcd:: with SMTP id i196-v6mr12296694pgd.238.1536934487895; Fri, 14 Sep 2018 07:14:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536934487; cv=none; d=google.com; s=arc-20160816; b=0+vKaIzaG9HQWQko2I9XHVM/TMmt1iALzj/s9y8zRUliCmV54k3pHaXrhy+VxBYMet QokHsAz81pzKkRBxPuHePHwuBC7faqBkHaN6v3TNQQGifbX3LWPxIBKY9DYCSivJMKWI gQQtFupWNxWeSWyR6wT5D5L50GIzPFc90Tj8md44JACEX63m6QjS/+m8ybyR2CEdcwar XL6h1VB2ZLHjFViOO9FuhomFbDaklk4T0vANXWIL9xtc90Zxsguy4coG0hDNPorBAinr dB3UZMIuYqH+E0OQ2qFgP6Wi0ETV+xPNiBxNzzca1gqduOZEG452hq1u2Tv/yePLMZdE EL9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=YISY7CT0E9xQaQUVR7LNWGxSFTyKyK9uj6CZmpwpQ0o=; b=j8VBECN5Cxd+6QyW36OskPe1e5spkIGwBhByyS1RCNMMxuFiEoFeXyG1WzD7lXPGzf oXxCULYhRsgExq7YDBBRbNX852l+XBWSnXYPRjIPLPdK6H5nCcuAklRmDZhUs/6ApMbI XKHBnY2+uJf7tybrdz4Re3PLCFF43BC7+vtPvwz6cFO7faYmjfHcNtu9mabXQwznLOSx xV/2FYx4E0Inf7sh4t2tmnDOWSrDwtcD1R1z/Wak0LDS2SpzBr5ONivj1uXryyH0OEyz BBY0aYqRayAvHAWgnUQhm/XGpwX2gVXtHpuGJGYPyIyzNX+fFjv5GLLXiqlsjVHF5NjY Ufhg== 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 184-v6si7118739pfe.249.2018.09.14.07.14.18; Fri, 14 Sep 2018 07:14:47 -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 S1728050AbeINT2v (ORCPT + 99 others); Fri, 14 Sep 2018 15:28:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58328 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726925AbeINT2u (ORCPT ); Fri, 14 Sep 2018 15:28:50 -0400 Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EE76930842AD; Fri, 14 Sep 2018 14:14:08 +0000 (UTC) Received: from redhat.com (ovpn-125-82.rdu2.redhat.com [10.10.125.82]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DE1F96BFE7; Fri, 14 Sep 2018 14:13:45 +0000 (UTC) Date: Fri, 14 Sep 2018 10:13:43 -0400 From: Jerome Glisse To: "Tian, Kevin" Cc: Kenneth Lee , Kenneth Lee , Herbert Xu , "kvm@vger.kernel.org" , Jonathan Corbet , Greg Kroah-Hartman , Zaibo Xu , "linux-doc@vger.kernel.org" , "Kumar, Sanjay K" , Hao Fang , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "linuxarm@huawei.com" , Alex Williamson , "linux-crypto@vger.kernel.org" , Zhou Wang , Philippe Ombredanne , Thomas Gleixner , Lu Baolu , "David S . Miller" , "linux-accelerators@lists.ozlabs.org" , Joerg Roedel Subject: Re: [RFCv2 PATCH 0/7] A General Accelerator Framework, WarpDrive Message-ID: <20180914141342.GB3826@redhat.com> References: <20180907165303.GA3519@redhat.com> <20180910032809.GJ230707@Turing-Arch-b> <20180910145423.GA3488@redhat.com> <20180911024209.GK230707@Turing-Arch-b> <20180911033358.GA4730@redhat.com> <20180911064043.GA207969@Turing-Arch-b> <20180911134013.GA3932@redhat.com> <20180913083232.GB207969@Turing-Arch-b> <20180913145149.GB3576@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 14 Sep 2018 14:14:09 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 14, 2018 at 06:50:55AM +0000, Tian, Kevin wrote: > > From: Jerome Glisse > > Sent: Thursday, September 13, 2018 10:52 PM > > > [...] > > AFAIK, on x86 and PPC at least, all PCIE devices are in the same group > > by default at boot or at least all devices behind the same bridge. > > the group thing reflects physical hierarchy limitation, not changed > cross boot. Please note iommu group defines the minimal isolation > boundary - all devices within same group must be attached to the > same iommu domain or address space, because physically IOMMU > cannot differentiate DMAs out of those devices. devices behind > legacy PCI-X bridge is one example. other examples include devices > behind a PCIe switch port which doesn't support ACS thus cannot > route p2p transaction to IOMMU. If talking about typical PCIe > endpoint (with upstreaming ports all supporting ACS), you'll get > one device per group. > > One iommu group today is attached to only one iommu domain. > In the future one group may attach to multiple domains, as the > aux domain concept being discussed in another thread. Thanks for the info. > > > > > Maybe they are kernel option to avoid that and userspace init program > > can definitly re-arrange that base on sysadmin policy). > > I don't think there is such option, as it may break isolation model > enabled by IOMMU. > > [...] > > > > That is why i am being pedantic :) on making sure there is good reasons > > > > to do what you do inside VFIO. I do believe that we want a common > > frame- > > > > work like the one you are proposing but i do not believe it should be > > > > part of VFIO given the baggages it comes with and that are not relevant > > > > to the use cases for this kind of devices. > > > > > The purpose of VFIO is clear - the kernel portal for granting generic > device resource (mmio, irq, etc.) to user space. VFIO doesn't care > what exactly a resource is used for (queue, cmd reg, etc.). If really > pursuing VFIO path is necessary, maybe such common framework > should lay down in user space, which gets all granted resource from > kernel driver thru VFIO and then provides accelerator services to > other processes? Except that many existing device driver falls under that description (ie exposing mmio, command queues, ...) and are not under VFIO. Up to mdev VFIO was all about handling a full device to userspace AFAIK. With the introduction of mdev a host kernel driver can "slice" its device and share it through VFIO to userspace. Note that in that case it might never end over any mmio, irq, ... the host driver might just be handling over memory and would be polling from it to schedule on the real hardware. The question i am asking about warpdrive is wether being in VFIO is necessary ? as i do not see the requirement myself. Cheers, J?r?me