Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp800270yba; Thu, 18 Apr 2019 09:44:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOLcEYzp9gKuWOM++oNGmNYatRbe8Ha7q2dYc82O/3n/Xosp0GgqC9RJwyjm4TtdePKUav X-Received: by 2002:a17:902:163:: with SMTP id 90mr67610008plb.34.1555605845089; Thu, 18 Apr 2019 09:44:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555605845; cv=none; d=google.com; s=arc-20160816; b=OYa3GhtYutcZ06aRjscmdV5IO0VsAxNloxo6Ik1cWoS7Qdo86OFp4lRRESZFF75N5F 5yAGcIaGaY94njgqJZNkan9lzq7qnjKSbwPzeqkHmwAJd4rV/GHrvx9+lqZJO7Kob8D/ 17LobRa0aE6Gy1hKjgsQolwX8lXIll20VF29jlMs9w/5Gh6eYjIcPUMShYfu8Sf2fRuu jRFJ4HpNoa4tE4CwLp/JNbM8gYO4LnHk5CFD9HCf6J3dXq4q5KZov0WzXTuERtLgMU3p HDIgZVUBLYIgksbkZrCg/DOjQNDrcvyAXKfXsPO4Ji6kZvGHZAqUy8Dr088mF7nHZlTc rXRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Kl1gOlLvmL1bLY+1kE9/xbVr7b68uXPJTLPEZ5eae/8=; b=bOSMR+IRxZ9okc3nups5jFc+tyryOpx4585NJYobZEyUAXK5YPZgjroxJff3ry6uSu ykoRp310ApoF6F8zG+RIF38jUbmDGYOoIQ0CQKXwn1uhGyj3CeLUXIXZ4Ef6x7IuG/4N siQzJz0lk6qV45byaO2bNt3vVXfxMVbEnGs6HjR9pVAjlCc6iVdTX7GU+Bw1QGduZQ1c NoXpdXqplh3nR7jthLNch5sw3mgPh0P3MiD1Vj8UgmS398Qa0w1BPw5g2JUMwF3TPkFT eh02SDNJ5QCioahnLwTPfg4qcFseZ8PmJYBWPgUcr3/O7wDYlDGlONRErKNcXfsN3kDQ G5Tw== 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 j30si1647501pgb.176.2019.04.18.09.43.48; Thu, 18 Apr 2019 09:44:05 -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 S2389619AbfDRQlF (ORCPT + 99 others); Thu, 18 Apr 2019 12:41:05 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:37476 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731317AbfDRQlE (ORCPT ); Thu, 18 Apr 2019 12:41:04 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5302380D; Thu, 18 Apr 2019 09:41:04 -0700 (PDT) Received: from [10.1.196.75] (e110467-lin.cambridge.arm.com [10.1.196.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0132E3F557; Thu, 18 Apr 2019 09:41:01 -0700 (PDT) Subject: Re: [PATCH 12/21] dma-iommu: factor atomic pool allocations into helpers To: Christoph Hellwig Cc: Joerg Roedel , Catalin Marinas , Will Deacon , Tom Lendacky , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20190327080448.5500-1-hch@lst.de> <20190327080448.5500-13-hch@lst.de> <20190410061157.GA5278@lst.de> <20190417063358.GA24139@lst.de> <83615173-a8b4-e0eb-bac3-1a58d61ea4ef@arm.com> <20190418163512.GA25347@lst.de> From: Robin Murphy Message-ID: <433dec64-ef15-b31d-ace4-4c72b81d2942@arm.com> Date: Thu, 18 Apr 2019 17:41:00 +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: <20190418163512.GA25347@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/04/2019 17:35, Christoph Hellwig wrote: > On Thu, Apr 18, 2019 at 04:06:56PM +0100, Robin Murphy wrote: >> OK, I'm still looking at mmap and get_sgtable, but for now I've pushed out >> a partial branch that consolidates alloc and free in a way which makes >> sense to me: >> >> git://linux-arm.org/linux-rm dma/rework >> >> Please let me know what you think. > > From a very high level POV this looks ok, but sometimes a bit to > convoluted to me. The major issue why I went with the version I posted > is that I can cleanly ifdef out the remap code in just a few sections. > In this version it is spread out a lot more, and the use of IS_ENABLED > means that we'd need a lot more stubs for functionality that won't > ever be called but needs to be compilable. What functionality do you have planned in that regard? I did do a quick build test of my arm64 config with DMA_DIRECT_REMAP hacked out, and dma-iommu.o appeared to link OK (although other bits of arm64 and dma-direct didn't, as expected). I will try x86 with IOMMU_DMA to make sure, though. Robin.