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 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A01DCC4332F for ; Fri, 20 May 2022 05:32:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 517E261319; Fri, 20 May 2022 05:32:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8fgQ6zHdrscs; Fri, 20 May 2022 05:32:57 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 34E0761264; Fri, 20 May 2022 05:32:57 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E1DDEC0032; Fri, 20 May 2022 05:32:56 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3E92BC002D for ; Fri, 20 May 2022 05:32:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 11617419CB for ; Fri, 20 May 2022 05:32:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=infradead.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DB1Exx1tZBiQ for ; Fri, 20 May 2022 05:32:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by smtp4.osuosl.org (Postfix) with ESMTPS id 0415041937 for ; Fri, 20 May 2022 05:32:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=3ODmFF5avT53o//v469wF9ADWgGgzn9kRfni0v0nXIk=; b=xcfGVyYeIHH0EKZftIC2xWY0zC fgdQssYI1G+wfHbwl5YgDMWENI1iB21+D4w6NSlrIWEfzeSjnxl9GLiNMt5ztyxsPyGY3/upbv6PO B5QkJ86vZj2QMuG8MEhwiX/kT/Fm9/Igkyd4pNv4CNtyqvsUfDDcvlnhHyaThnvUe2CQC4NUQRstV pZksUFj0pZO/TGicFs+JhNNKIK7JQ55+wejCq8IJd0cKrRB13p+NEbcLZ5xpMnr39nUGU/x14apEO pvWWIk4yoEOD62ZPC/gv8GXAtDaKCwDZo8Ly/q7cFy806wc9Fz6eCASLF6XMpef1Fj6OI5g+iEbiA y90SkQIA==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrvFp-00AcYm-2N; Fri, 20 May 2022 05:32:49 +0000 Date: Thu, 19 May 2022 22:32:49 -0700 From: Christoph Hellwig To: Jason Gunthorpe Subject: Re: [PATCH] vfio: Do not manipulate iommu dma_owner for fake iommu groups Message-ID: References: <0-v1-9cfc47edbcd4+13546-vfio_dma_owner_fix_jgg@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <0-v1-9cfc47edbcd4+13546-vfio_dma_owner_fix_jgg@nvidia.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Cc: Eric Farman , Joerg Roedel , kvm@vger.kernel.org, Cornelia Huck , iommu@lists.linux-foundation.org, Kevin Tian , Alex Williamson , Robin Murphy X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Thu, May 19, 2022 at 02:03:48PM -0300, Jason Gunthorpe via iommu wrote: > Since asserting dma ownership now causes the group to have its DMA blocked > the iommu layer requires a working iommu. This means the dma_owner APIs > cannot be used on the fake groups that VFIO creates. Test for this and > avoid calling them. > > Otherwise asserting dma ownership will fail for VFIO mdev devices as a > BLOCKING iommu_domain cannot be allocated due to the NULL iommu ops. Fake iommu groups come back to bite again, part 42.. The patch looks good: Reviewed-by: Christoph Hellwig _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu