Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4553681yba; Tue, 9 Apr 2019 23:14:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtgjLL8P8RbAclmveYLQqU48Dm44V1Hc0uroBiUDo+5kue/uJWWkFCdLLy7Yal1569C2v+ X-Received: by 2002:a17:902:8609:: with SMTP id f9mr42080050plo.32.1554876861766; Tue, 09 Apr 2019 23:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554876861; cv=none; d=google.com; s=arc-20160816; b=txawWNT6yBiSFB1ZnJRZpBUeEdiOCXUXspOLZ0Ahk7jzlsNNYMhQoY5nBwRYDXE8Vp kBY3lIo81Q47LHWF7T7yZ3kzpi5B9pdfRuvJi11ozHt7A+3MGtuxhg0pLvll7FhOVbmW R9BdgknviVHs67tECdMRkrB3mkb/Yt1Lo8UKM46b8TZhWMFzsWWA+gVbYuJwVHS7AzN+ nNFmaK2WEdEOlrKVA4vdryXhiPjvsLLqw/NcZrOQRG/hUy7g51rgzrJ3Z6dcqf9ixbK1 pMd57KqqABb8MPqciUqw9TkTvhc2RTUov7mki73CbV6tIfdI4vMk+9YiGerK0CezJPd0 dY8g== 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=jT0wDZnNiPYjPUvpwWCNhTeTMVDnfCuctqOLQZRzorE=; b=k/51Lao1nzygzGM/k7MaTliCixbf3LYlwuxEReDMKnV5sstpyeJoLK1i+bRxeluBTy x5B3aGAFPs4SS4ICNzvr0LXUUXEWnjP3+yf+nvBCTvPruKaoMwjK0w+QKmQ/TNktBZuQ UbchiCZGlpCqoZ0OlUKjJ45Ded58i5n5CnOromRh285eU179XM7ZGXwxDq0yaVwrDmBW +XbDFNDbM1yWB495TPU1BAIxQlf7Zmmg0BNGkyhZfoaSenhetNkm/cS2VfSWeLI3Zkju XbC3TqOMQqmu93bWcgvLATDKmqxXOMSHAKIXhH8e7Bf17XhMPfChbiBxdZaht6/AnDr4 3gaw== 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 s83si31137349pgs.420.2019.04.09.23.14.05; Tue, 09 Apr 2019 23:14:21 -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 S1727364AbfDJGML (ORCPT + 99 others); Wed, 10 Apr 2019 02:12:11 -0400 Received: from verein.lst.de ([213.95.11.211]:55014 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbfDJGML (ORCPT ); Wed, 10 Apr 2019 02:12:11 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 7047968B05; Wed, 10 Apr 2019 08:11:58 +0200 (CEST) Date: Wed, 10 Apr 2019 08:11:58 +0200 From: Christoph Hellwig To: Robin Murphy Cc: Christoph Hellwig , Joerg Roedel , Catalin Marinas , Will Deacon , Tom Lendacky , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 12/21] dma-iommu: factor atomic pool allocations into helpers Message-ID: <20190410061157.GA5278@lst.de> References: <20190327080448.5500-1-hch@lst.de> <20190327080448.5500-13-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, Apr 09, 2019 at 06:59:32PM +0100, Robin Murphy wrote: > On 27/03/2019 08:04, Christoph Hellwig wrote: >> This keeps the code together and will simplify compiling the code >> out on architectures that are always dma coherent. > > And this is where things take a turn in the direction I just can't get on > with - I'm looking at the final result and the twisty maze of little > disjoint helpers all overlapping each other in functionality is really > difficult to follow. And I would *much* rather have things rely on > compile-time constant optimisation than spend the future having to fix the > #ifdefed parts for arm64 whenever x86-centric changes fail to test them. Can you draft up a patch on top of my series to show me what you want? I can take care of finishing it up and moving the changes into the right patches in the series. > Conceptually, everything except the iommu_dma_alloc_remap() case is more or > less just dma_direct_alloc() with an IOMMU mapping on top - if we could > pass that an internal flag to say "don't fail or bounce because of masks" > it seems like that approach could end up being quite a bit simpler (I did > once have lofty plans to refactor the old arm64 code in such a way...) I've been wanting to share more code between DMA direct and the iommu allocators. But this series already is huge and has been pending far too long. I'll eventually get to it..