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=-4.0 required=3.0 tests=MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 1C977C433FF for ; Mon, 29 Jul 2019 18:29:53 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA17F2073F for ; Mon, 29 Jul 2019 18:29:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA17F2073F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 65B251D0C; Mon, 29 Jul 2019 18:29:39 +0000 (UTC) Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 3A1FB16A5 for ; Mon, 29 Jul 2019 16:31:47 +0000 (UTC) X-Greylist: delayed 00:27:43 by SQLgrey-1.7.6 Received: from inca-roads.misterjones.org (inca-roads.misterjones.org [213.251.177.50]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id AD73B5E4 for ; Mon, 29 Jul 2019 16:31:46 +0000 (UTC) Received: from www-data by cheepnis.misterjones.org with local (Exim 4.80) (envelope-from ) id 1hs87z-0000vv-BM; Mon, 29 Jul 2019 18:03:59 +0200 To: Robin Murphy Subject: Re: [PATCH] iommu/dma: Handle MSI mappings separately X-PHP-Originating-Script: 0:main.inc MIME-Version: 1.0 Date: Mon, 29 Jul 2019 17:03:59 +0100 From: Marc Zyngier In-Reply-To: <2b2595de703c60a772ebcffe248d0cf036143e6a.1564414114.git.robin.murphy@arm.com> References: <2b2595de703c60a772ebcffe248d0cf036143e6a.1564414114.git.robin.murphy@arm.com> Message-ID: X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/0.7.2 X-SA-Exim-Connect-IP: X-SA-Exim-Rcpt-To: robin.murphy@arm.com, joro@8bytes.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, shameerali.kolothum.thodi@huawei.com, andre.przywara@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false X-Mailman-Approved-At: Mon, 29 Jul 2019 18:26:30 +0000 Cc: Andre Przywara , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: iommu-bounces@lists.linux-foundation.org Errors-To: iommu-bounces@lists.linux-foundation.org On 2019-07-29 16:32, Robin Murphy wrote: > MSI pages must always be mapped into a device's *current* domain, > which > *might* be the default DMA domain, but might instead be a VFIO domain > with its own MSI cookie. This subtlety got accidentally lost in the > streamlining of __iommu_dma_map(), but rather than reintroduce more > complexity and/or special-casing, it turns out neater to just split > this > path out entirely. > > Since iommu_dma_get_msi_page() already duplicates much of what > __iommu_dma_map() does, it can easily just make the allocation and > mapping calls directly as well. That way we can further streamline > the > helper back to exclusively operating on DMA domains. > > Fixes: b61d271e59d7 ("iommu/dma: Move domain lookup into > __iommu_dma_{map,unmap}") > Reported-by: Shameer Kolothum > Reported-by: Andre Przywara > Signed-off-by: Robin Murphy With this patch, my TX2 is back in business with a bnx2x device passed to a guest. FWIW: Tested-by: Marc Zyngier Thanks, M. -- Jazz is not dead. It just smells funny... _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 7FAEEC7618B for ; Mon, 29 Jul 2019 16:04:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55B7321773 for ; Mon, 29 Jul 2019 16:04:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hWDFJYgy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55B7321773 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:From:Date: MIME-Version:Subject:To:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vfHx/elRyDzIWvUn641h2A2chDjXVCiVzohbUFjz6fA=; b=hWDFJYgyajqrp4v5kDxJyC2Le hwQcjzLa3CNp0cx52C69P4hJ8Jc6nyBytAmuNXmi+dKSuJHDjugEwUeTZ8erMyj1+ArsWShw93VMC Y6XvqMWknJD67Oqviuh7P8P8z/RGwR/EYs+f7O3BigbU/7F5LGXAwttuxK2Xje4IYq3rW4/bSUEYx 0OLoHxQNYinSEPiqdszjl7LU2eb9t8vWTRRoPd7Cot0w4qaIZnOhsVVoSUq31DWjscL+JL8iLQFol TwLAXAAMiHCCudLSqsCPmrjstXxt4+K4f9LDRqFTK/okc4m760Nkir/fP1KA7eYCFyOpv6MjXO0/V cqDHC9TuQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hs887-0004zg-1s; Mon, 29 Jul 2019 16:04:07 +0000 Received: from inca-roads.misterjones.org ([213.251.177.50]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hs884-0004zM-46 for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2019 16:04:05 +0000 Received: from www-data by cheepnis.misterjones.org with local (Exim 4.80) (envelope-from ) id 1hs87z-0000vv-BM; Mon, 29 Jul 2019 18:03:59 +0200 To: Robin Murphy Subject: Re: [PATCH] iommu/dma: Handle MSI mappings separately X-PHP-Originating-Script: 0:main.inc MIME-Version: 1.0 Date: Mon, 29 Jul 2019 17:03:59 +0100 From: Marc Zyngier In-Reply-To: <2b2595de703c60a772ebcffe248d0cf036143e6a.1564414114.git.robin.murphy@arm.com> References: <2b2595de703c60a772ebcffe248d0cf036143e6a.1564414114.git.robin.murphy@arm.com> Message-ID: X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/0.7.2 X-SA-Exim-Connect-IP: X-SA-Exim-Rcpt-To: robin.murphy@arm.com, joro@8bytes.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, shameerali.kolothum.thodi@huawei.com, andre.przywara@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190729_090404_310874_1874D34E X-CRM114-Status: UNSURE ( 8.88 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andre Przywara , joro@8bytes.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, Shameer Kolothum Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2019-07-29 16:32, Robin Murphy wrote: > MSI pages must always be mapped into a device's *current* domain, > which > *might* be the default DMA domain, but might instead be a VFIO domain > with its own MSI cookie. This subtlety got accidentally lost in the > streamlining of __iommu_dma_map(), but rather than reintroduce more > complexity and/or special-casing, it turns out neater to just split > this > path out entirely. > > Since iommu_dma_get_msi_page() already duplicates much of what > __iommu_dma_map() does, it can easily just make the allocation and > mapping calls directly as well. That way we can further streamline > the > helper back to exclusively operating on DMA domains. > > Fixes: b61d271e59d7 ("iommu/dma: Move domain lookup into > __iommu_dma_{map,unmap}") > Reported-by: Shameer Kolothum > Reported-by: Andre Przywara > Signed-off-by: Robin Murphy With this patch, my TX2 is back in business with a bnx2x device passed to a guest. FWIW: Tested-by: Marc Zyngier Thanks, M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel