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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 88A86C433ED for ; Mon, 17 May 2021 12:53:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 648716100C for ; Mon, 17 May 2021 12:53:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233280AbhEQMyr (ORCPT ); Mon, 17 May 2021 08:54:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230527AbhEQMyh (ORCPT ); Mon, 17 May 2021 08:54:37 -0400 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33A40C061573 for ; Mon, 17 May 2021 05:53:21 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 771D72E7; Mon, 17 May 2021 14:53:18 +0200 (CEST) Date: Mon, 17 May 2021 14:53:16 +0200 From: Joerg Roedel To: Jason Gunthorpe Cc: "Tian, Kevin" , Christoph Hellwig , Alex Williamson , David Woodhouse , Lu Baolu , Will Deacon , Kirti Wankhede , "linux-arm-kernel@lists.infradead.org" , "iommu@lists.linux-foundation.org" , "kvm@vger.kernel.org" Subject: Re: [PATCH 3/6] vfio: remove the unused mdev iommu hook Message-ID: References: <20210510065405.2334771-4-hch@lst.de> <20210510155454.GA1096940@ziepe.ca> <20210513120058.GG1096940@ziepe.ca> <20210514121925.GI1096940@ziepe.ca> <20210514133143.GK1096940@ziepe.ca> <20210517123010.GO1096940@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210517123010.GO1096940@ziepe.ca> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, May 17, 2021 at 09:30:10AM -0300, Jason Gunthorpe wrote: > On Mon, May 17, 2021 at 02:22:06PM +0200, Joerg Roedel wrote: > > Yes, I know, We have the AUX-domain specific functions now, but I > > suggested a while back to turn the mdev code into its own bus > > implementation and let the IOMMU driver deal with whether it has an mdev > > or a pdev. When that is done the aux-specific functions can go away. > > Yuk, no. > > PASID is not connected to the driver model. It is inherently wrong to > suggest this. There will be no drivers for that, but an mdev is a container for resources of a physical device which can be assigned to a virtual machine or a user-space process. In this way it fits very well into the existing abstractions. > PASID is a property of a PCI device and any PCI device driver should > be able to spawn PASIDs without silly restrictions. Some points here: 1) The concept of PASIDs is not limited to PCI devices. 2) An mdev is not a restriction. It is an abstraction with which other parts of the kernel can work. > Fixing the IOMMU API is clearly needed here to get a clean PASID > implementation in the kernel. You still have to convince me that this is needed and a good idea. By now I am not even remotely convinced and putting words like 'fixing', 'clearly' and 'silly' in a sentence is by far not enough for this to happen. > We aren't talking about mm_struct. Passing an mm_struct to a device is another use-case for PASIDs, you should keep that in mind. The mdev abstraction was made for a different use-case. To be clear, I agree that the aux-domain specifics should be removed from the IOMMU-API, but the mdev-abstraction itself still makes sense. > As above a domain isn't an IOASID, it only does a few things an IOASID > can do. For example? Regards, Joerg