Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934869AbcKJQRf (ORCPT ); Thu, 10 Nov 2016 11:17:35 -0500 Received: from foss.arm.com ([217.140.101.70]:52752 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934058AbcKJQRd (ORCPT ); Thu, 10 Nov 2016 11:17:33 -0500 Subject: Re: [PATCH] iommu/dma-iommu: properly respect configured address space size To: Joerg Roedel References: <1478523973-8828-1-git-send-email-m.szyprowski@samsung.com> <68e7a18b-739e-b73e-eacf-3cb6c1bd279a@arm.com> <20161110155938.GI2078@8bytes.org> Cc: Marek Szyprowski , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org From: Robin Murphy Message-ID: <9d239c5c-a4ed-f177-319f-7c467a6059ba@arm.com> Date: Thu, 10 Nov 2016 16:17:30 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161110155938.GI2078@8bytes.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1091 Lines: 23 On 10/11/16 15:59, Joerg Roedel wrote: > On Tue, Nov 08, 2016 at 11:37:23AM +0000, Robin Murphy wrote: >> TBH I've been pondering ripping the size stuff out of dma-iommu, as it >> all stems from me originally failing to understand what dma_32bit_pfn is >> actually for. > > The point of dma_32bit_pfn is to allocate dma-address below 4G by > default. This is a performance optimization so that even devices capable > of 64bit DMA are using SAC by default instead of DAC. > > Since it is the goal to share a dma-iommu implemenation between > architectures, I would rather prefer not to rip this stuff out. Oh, I didn't mean rip it out entirely, just get rid of the bogus assumption that it's the "size" of the domain, especially when given a >32-bit DMA mask, since that defeats the very optimisation I do now understand (although it might still be OK for platform devices where SAC/DAC doesn't apply, to avoid the rb_last() overhead every time). >From the patch I've started, "rip it out" turns out to actually be mostly "rewrite the comments" anyway - I'll post something soon. Robin.