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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED 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 D3D7FC433E2 for ; Fri, 26 Mar 2021 16:01:51 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 4015B61938 for ; Fri, 26 Mar 2021 16:01:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4015B61938 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xs4all.nl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:Subject:In-Reply-To:Cc:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bRsP2vL75ITp5A4aS1JXpeC7PQ2LThy/k14yckhwEMQ=; b=pQfr38ZS/LANGRH0N1u61CyDts arzhmqQrpth409s8gSGIBjUPM4/+CbKiWbA7bRM6+R8ANLFXuNmFT51grFKfskZdyC5JoG3wrOLma VAn6EQdcz+Q+s7Cta4wUjTamQ2qedir2HwbMmCNm9JCMvxbC2WhjOlbfW+VmklRsTlP9KipaKtS7w t/L71PoDHqzH5g8rV//ki9Y/q5mxip5D8h1A9kJyjvqD7lpcoMx8QScx0Opti07hv4YEXLNYqiQkF BY1AcjvLrhsRRovGjC5dk36/iJWGriSfs6bE4dZnwTJt9r5XyDdJpbtb5LaKePKOcZyzSIurUtJev ff5vgs7A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPosS-003vr1-Jg; Fri, 26 Mar 2021 16:00:00 +0000 Received: from sibelius.xs4all.nl ([83.163.83.176]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lPosN-003vpi-Kd for linux-arm-kernel@lists.infradead.org; Fri, 26 Mar 2021 15:59:57 +0000 Received: from localhost (bloch.sibelius.xs4all.nl [local]) by bloch.sibelius.xs4all.nl (OpenSMTPD) with ESMTPA id ff3d25fc; Fri, 26 Mar 2021 16:59:46 +0100 (CET) Date: Fri, 26 Mar 2021 16:59:46 +0100 (CET) From: Mark Kettenis To: Arnd Bergmann Cc: sven@svenpeter.dev, robh@kernel.org, iommu@lists.linux-foundation.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, marcan@marcan.st, maz@kernel.org, mohamed.mediouni@caramail.com, stan@corellium.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org In-Reply-To: (message from Arnd Bergmann on Thu, 25 Mar 2021 22:41:09 +0100) Subject: Re: [PATCH 0/3] Apple M1 DART IOMMU driver References: <20210320151903.60759-1-sven@svenpeter.dev> <20210323205346.GA1283560@robh.at.kernel.org> <43685c67-6d9c-4e72-b320-0462c2273bf0@www.fastmail.com> Message-ID: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210326_155955_794419_0CAFB6CB X-CRM114-Status: GOOD ( 21.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > From: Arnd Bergmann > Date: Thu, 25 Mar 2021 22:41:09 +0100 > > On Thu, Mar 25, 2021 at 8:53 AM Sven Peter wrote: > > On Tue, Mar 23, 2021, at 21:53, Rob Herring wrote: > > > > I'm probably just confused or maybe the documentation is outdated but I don't > > see how I could specify "this device can only use DMA addresses from > > 0x00100000...0x3ff00000 but can map these via the iommu to any physical > > address" using 'dma-ranges'. > > It sounds like this is a holdover from the original powerpc iommu, > which also had a limited set of virtual addresses in the iommu. > > I would think it's sufficient to describe it in the iommu itself, > since the limitation is more "addresses coming into the iommu must > be this range" than "this device must use that address range for > talking to the iommu". > > If the addresses are allocated by the iommu driver, and each iommu > only has one DMA master attached to it, having a simple range > property in the iommu node should do the trick here. If there might > be multiple devices on the same iommu but with different address > ranges (which I don't think is the case), then it could be part of > the reference to the iommu. The ADT has properties on the iommu node that describe the adresses it accepts for translation ("vm-base" and "vm-size"). So I think we can safely assume that the same limits apply to all DMA masters that are attached to it. We don't know if the range limit is baked into the silicon or whether it is related to how the firmware sets things up. Having the properties on the iommu node makes it easy for m1n1 to update the properties with the right values if necessary. Some of the DARTs provide a bypass facility. That code make using the standard "dma-ranges" property tricky. That property would need to contain the bypass address range. But that would mean that if the DART driver needs to look at that property to figure out the address range that supports translation it will need to be able to distinguish between the translatable address range and the bypass address range. Cheers, Mark _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel