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=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 4EFF9C433FF for ; Mon, 29 Jul 2019 13:13:54 +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 20CE4214AE for ; Mon, 29 Jul 2019 13:13:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VcyxpMu+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20CE4214AE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com 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:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nkwsw8UMUHAqDFeNrXo2GxTFrqOfGuzKziy4r0sQluc=; b=VcyxpMu+5I8Z8zYnUrn6r4ZSq cRGnbZVFKnPacAx8P0427272vsg1Blk4fH2OcyiLOv1vbhSXU7zGAYsc5S53N5j+DzvO88TC+So3b hM1zCButOVcyRsWUvNeKNaZQbuRoZFe09keE63IqiIPp1a3XJoE/Zguxwjos7uTHwO7JCX2m4g73R k1K8LPok1fw7TPAim//AMYATKpJTuPWk3T1WxjCDT8JWidglspR1IasTvBZ36UJvSjPMfT00r6zNC LXWsvyAkoEFrLxG39LKW7iHc6LqDoEjQY/PcIPpOhiOKG/V2mqamktKNpswJydSuYogytVbsM9ppS VRtWHzSaQ==; 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 1hs5TL-0004id-3J; Mon, 29 Jul 2019 13:13:51 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hs5TI-0004iD-1e for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2019 13:13:49 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4CA5328; Mon, 29 Jul 2019 06:13:47 -0700 (PDT) Received: from [10.1.197.57] (e110467-lin.cambridge.arm.com [10.1.197.57]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0363D3F71F; Mon, 29 Jul 2019 06:13:45 -0700 (PDT) Subject: Re: [PATCH 07/24] iommu/dma: Move domain lookup into __iommu_dma_{map, unmap} To: Shameerali Kolothum Thodi , Christoph Hellwig References: <20190520072948.11412-1-hch@lst.de> <20190520072948.11412-8-hch@lst.de> <5FC3163CFD30C246ABAA99954A238FA83F328FAB@lhreml524-mbb.china.huawei.com> From: Robin Murphy Message-ID: <9027b5f1-545b-e11b-ca8f-f1e0bd701634@arm.com> Date: Mon, 29 Jul 2019 14:13:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <5FC3163CFD30C246ABAA99954A238FA83F328FAB@lhreml524-mbb.china.huawei.com> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190729_061348_135442_A8827F75 X-CRM114-Status: GOOD ( 21.51 ) 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: Tom Murphy , Catalin Marinas , Will Deacon , "linux-kernel@vger.kernel.org" , Linuxarm , "iommu@lists.linux-foundation.org" , "Wangzhou \(B\)" , "linux-arm-kernel@lists.infradead.org" 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 Hi Shameer, On 29/07/2019 13:12, Shameerali Kolothum Thodi wrote: > Hi Robin, > >> -----Original Message----- >> From: iommu-bounces@lists.linux-foundation.org >> [mailto:iommu-bounces@lists.linux-foundation.org] On Behalf Of Christoph >> Hellwig >> Sent: 20 May 2019 08:30 >> To: Robin Murphy >> Cc: Tom Murphy ; Catalin Marinas >> ; Will Deacon ; >> linux-kernel@vger.kernel.org; iommu@lists.linux-foundation.org; >> linux-arm-kernel@lists.infradead.org >> Subject: [PATCH 07/24] iommu/dma: Move domain lookup into >> __iommu_dma_{map, unmap} >> >> From: Robin Murphy >> >> Most of the callers don't care, and the couple that do already have the >> domain to hand for other reasons are in slow paths where the (trivial) >> overhead of a repeated lookup will be utterly immaterial. > > On a Hisilicon ARM64 platform with 5.3-rc1, a F_TRANSALTION error from > smmuv3 is reported when an attempt is made to assign a ixgbe vf dev to a > Guest. > > [ 196.747107] arm-smmu-v3 arm-smmu-v3.0.auto: event 0x10 received: > [ 196.747109] arm-smmu-v3 arm-smmu-v3.0.auto: 0x00000180 00000010 > [ 196.747110] arm-smmu-v3 arm-smmu-v3.0.auto: 0x0000020100000000 > [ 196.747111] arm-smmu-v3 arm-smmu-v3.0.auto: 0x00000000ffffe040 > [ 196.747113] arm-smmu-v3 arm-smmu-v3.0.auto: 0x00000000ffffe000 > > Git bisect points to this patch. > > Please see below. [...] >> *iommu_dma_get_msi_page(struct device *dev, >> if (!msi_page) >> return NULL; >> >> - iova = __iommu_dma_map(dev, msi_addr, size, prot, domain); >> + iova = __iommu_dma_map(dev, msi_addr, size, prot); > > I think the domain here is retrieved using iommu_get_domain_for_dev() > which may not be the default domain returned by iommu_get_dma_domain(). Urgh, yes, how did I manage to miss that? :( I doubt this patch reverts cleanly, but I don't think it needs to be completely undone anyway; give me a moment... Robin. > > Please check and let me know. > > Thanks, > Shameer > >> if (iova == DMA_MAPPING_ERROR) >> goto out_free_page; >> -- >> 2.20.1 >> >> _______________________________________________ >> iommu mailing list >> iommu@lists.linux-foundation.org >> https://lists.linuxfoundation.org/mailman/listinfo/iommu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel