From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF0BAC433F5 for ; Fri, 17 Sep 2021 05:05:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C3D7860F48 for ; Fri, 17 Sep 2021 05:05:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244774AbhIQFHI (ORCPT ); Fri, 17 Sep 2021 01:07:08 -0400 Received: from verein.lst.de ([213.95.11.211]:43548 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbhIQFHH (ORCPT ); Fri, 17 Sep 2021 01:07:07 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id DB3CD67373; Fri, 17 Sep 2021 07:05:43 +0200 (CEST) Date: Fri, 17 Sep 2021 07:05:43 +0200 From: Christoph Hellwig To: "Tian, Kevin" Cc: Jason Gunthorpe , Kirti Wankhede , Christoph Hellwig , Alex Williamson , Diana Craciun , Cornelia Huck , Eric Auger , "Xu, Terrence" , "kvm@vger.kernel.org" Subject: Re: [PATCH 11/14] vfio: clean up the check for mediated device in vfio_iommu_type1 Message-ID: <20210917050543.GA22003@lst.de> References: <20210913071606.2966-1-hch@lst.de> <20210913071606.2966-12-hch@lst.de> <20210916221854.GT3544071@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Fri, Sep 17, 2021 at 04:49:41AM +0000, Tian, Kevin wrote: > > You just use the new style mdev API and directly call > > vfio_register_group_dev and it will pick up the > > parent->dev->iommu_group naturally like everything else using physical > > iommu groups. > > > > For above usage (wrap pdev into mdev), isn't the right way to directly add > vendor vfio-pci driver since vfio-pci-core has been split out now? It's not > necessary to fake a mdev just for adding some mediation in the r/w path... Exactly. > Another type of IOMMU-backed mdev is with pasid support. But for this > case we discussed earlier that it doesn't have group and will follow the > new /dev/iommu proposal instead. Indeed.