Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp547468ybp; Tue, 8 Oct 2019 23:51:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzof5gRjwni3ABI/s4Dft/HftSoVsqlEQjvELgPNjQBFjaXTJbw1cl+ltXWW2u24dekM1dN X-Received: by 2002:aa7:d884:: with SMTP id u4mr1498574edq.207.1570603883679; Tue, 08 Oct 2019 23:51:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570603883; cv=none; d=google.com; s=arc-20160816; b=JlzxwxSyrqs1XV9vqgT3V/SN1EmrIxxt+aNY1wUE9dnsKGshW4mH+B9mxE9EAei7E0 cBQb6qJpFcJc+6PW7iNd3PT3WjYYthPu1TaxFCjFO5WGmijdv7NgTkCkt5CrrELqrkYh RK4aojwPeIS8ciafsxsYvfPWmc2LEQmc3da9tuGIfHXvoyUDRVDsoL0m7wwCs6XvstHY 3Xl0eKQ7BlwNZUG9mbEgFRPgpfgaSWD+/173MLimaN0nuTznSmcJjNXuslQvrTxeAY/x o3rhN/IerNLqWYaLXcWYcleQv81iPHlhTMMpHXHBeepueb3rdEO+3bQVJl5tUFEGaxKO PaSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=EsUGB62iwM/9DUQi/REPbx5hBYJizrBJvvopcI3cv34=; b=s+RF0JgAVgFbP+pR19NNPkhYu5QyjOea/IppZfhdd4SxQIatNWNhLQ9045lJgUn1CG PPIJxayP+eRdEoHC/qlE12IjwVW/d/YNOyZ31Fekr6xzbrsv31OLaGJDsOAIzyzuCc++ WiwmG3GQsuMhwLJTp+w5rqCqp91dUPhtwib7OiQlsv14Xvtn/Yd1JtdmzCeJzDrRNSZB v/4mTX6/CRfB/fohAyPxIqf4H5i+WCO7ULNfSWkWsm/gqf3LEP8kVcK40kr8LV7L7hx2 uX/QjXSomGzx6ATxtjK8tKImTaP76DW+4Jcn+z5EPNYyOluT/fKi7z0oOnIlO24Sh/zu dN4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o49si819203edc.261.2019.10.08.23.50.59; Tue, 08 Oct 2019 23:51:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725953AbfJIGur (ORCPT + 99 others); Wed, 9 Oct 2019 02:50:47 -0400 Received: from verein.lst.de ([213.95.11.211]:50518 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725440AbfJIGur (ORCPT ); Wed, 9 Oct 2019 02:50:47 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 0914168B05; Wed, 9 Oct 2019 08:50:44 +0200 (CEST) Date: Wed, 9 Oct 2019 08:50:43 +0200 From: Christoph Hellwig To: Arvind Sankar Cc: Christoph Hellwig , Christoph Hellwig , linux-kernel@vger.kernel.org Subject: Re: ehci-pci breakage with dma-mapping changes in 5.4-rc2 Message-ID: <20191009065043.GA30157@lst.de> References: <20191007175528.GA21857@lst.de> <20191007175630.GA28861@infradead.org> <20191007175856.GA42018@rani.riverdale.lan> <20191007183206.GA13589@rani.riverdale.lan> <20191007184754.GB31345@lst.de> <20191007221054.GA409402@rani.riverdale.lan> <20191007235401.GA608824@rani.riverdale.lan> <20191008073210.GB9452@lst.de> <20191008115103.GA463127@rani.riverdale.lan> <20191008154731.GA616259@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191008154731.GA616259@rani.riverdale.lan> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 08, 2019 at 11:47:31AM -0400, Arvind Sankar wrote: > Ok, I see that almost nothing actually uses dma_get_required_mask. So if > something did need >4Gb space, the IOMMU would allocate it anyway > regardless of dma_get_required_mask. Yes. And with the direct mapping it also isn't an issue. > I'm thinking this means that we actually only needed to change > dma_get_required_mask to dma_direct_get_required_mask in > iommu_need_mapping, and the rest of the change is unnecessary? > > Below is list of stuff calling dma_get_required_mask currently: I guess that would actually work ok, but I prefer the more verbose version as it explain what is going on, and will lead people to do the right thing if we split the iommu vs passthrough case into different ops (we already had a patch for that out on the list). > For the drivers that do currently use dma_get_required_mask, I believe > we will need to replace most of them with dma_direct_get_required_mask > as well to maintain passthrough functionality -- the fusion, scsi, and > infinband drivers all seem to be using this call to determine whether to > expose the device's 64-bit DMA capability or not. With the change they > will think they only need 32-bit DMA, which in turn will disable > passthrough on them. At least for some of the legacy SCSI drivers that is intentional, and the reason why dma_get_required_mask was originally added. On actual PCI (and PCI-X, but not PCIe which everyone uses now) the 64-bit addressing even if supported is not very efficient as it needs two bus cycles. So we prefer to just use the iommu. > The etnaviv driver is doing something funky that I'm not sure about, but > I *think* that one might want the real physical range as well. The mmc > driver I think might be ok with the 32-bit range. etnaviv is never used on systems with the intel iommu anyway. > The vmd controller one not sure about. That just passes through the dma ops to work around really stupid intel chipsets. > In dma-mapping.h, the function is used in dma_addressing_limited, which > in turn is used in a couple of amd drm drivers, again not sure about > these. ---end quoted text---