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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 7CB6EC433FF for ; Tue, 30 Jul 2019 06:30:34 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (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 562952064A for ; Tue, 30 Jul 2019 06:30:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 562952064A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 2DFE02473; Tue, 30 Jul 2019 06:30:34 +0000 (UTC) Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 92A672467 for ; Tue, 30 Jul 2019 06:26:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 2BF7FA8 for ; Tue, 30 Jul 2019 06:26:57 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 221D568AEF; Tue, 30 Jul 2019 08:26:52 +0200 (CEST) Date: Tue, 30 Jul 2019 08:26:51 +0200 From: Christoph Hellwig To: Geert Uytterhoeven Subject: Re: [PATCH 4/5] dma-mapping: provide a better default ->get_required_mask Message-ID: <20190730062651.GA29518@lst.de> References: <20190725063401.29904-1-hch@lst.de> <20190725063401.29904-5-hch@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Cc: linux-xtensa@linux-xtensa.org, Michal Simek , Parisc List , Linux-sh list , Takashi Iwai , linuxppc-dev , the arch/x86 maintainers , linux-m68k , Linux Kernel Mailing List , Linux IOMMU , Robin Murphy , Christoph Hellwig , Linux ARM X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: iommu-bounces@lists.linux-foundation.org Errors-To: iommu-bounces@lists.linux-foundation.org On Mon, Jul 29, 2019 at 11:57:19AM +0200, Geert Uytterhoeven wrote: > Hi Christoph, > > On Thu, Jul 25, 2019 at 8:35 AM Christoph Hellwig wrote: > > Most dma_map_ops instances are IOMMUs that work perfectly fine in 32-bits > > of IOVA space, and the generic direct mapping code already provides its > > own routines that is intelligent based on the amount of memory actually > > present. Wire up the dma-direct routine for the ARM direct mapping code > > as well, and otherwise default to the constant 32-bit mask. This way > > we only need to override it for the occasional odd IOMMU that requires > > 64-bit IOVA support, or IOMMU drivers that are more efficient if they > > can fall back to the direct mapping. > > As I know you like diving into cans of worms ;-) > > Does 64-bit IOVA support actually work in general? Or only on 64-bit > platforms, due to dma_addr_t to unsigned long truncation on 32-bit? Most IOMMUs use 32-bit IOVAs, and thus we default to the 32-bit mask because it is common and failsafe vs the normal linux assumptions. However the ia64 SGI SN2 platform, and the powerpc IBM ebus implementations seem to require a 64-bit mask already, so we keep that behavior as is. _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 B98A3C0650F for ; Tue, 30 Jul 2019 06:26:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D3292064A for ; Tue, 30 Jul 2019 06:26:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728897AbfG3G05 (ORCPT ); Tue, 30 Jul 2019 02:26:57 -0400 Received: from verein.lst.de ([213.95.11.211]:48085 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726128AbfG3G05 (ORCPT ); Tue, 30 Jul 2019 02:26:57 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 221D568AEF; Tue, 30 Jul 2019 08:26:52 +0200 (CEST) Date: Tue, 30 Jul 2019 08:26:51 +0200 From: Christoph Hellwig To: Geert Uytterhoeven Cc: Christoph Hellwig , Linux IOMMU , Marek Szyprowski , Takashi Iwai , Robin Murphy , Michal Simek , Linux ARM , linux-m68k , Parisc List , Linux-sh list , linux-xtensa@linux-xtensa.org, linuxppc-dev , the arch/x86 maintainers , Linux Kernel Mailing List Subject: Re: [PATCH 4/5] dma-mapping: provide a better default ->get_required_mask Message-ID: <20190730062651.GA29518@lst.de> References: <20190725063401.29904-1-hch@lst.de> <20190725063401.29904-5-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-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org On Mon, Jul 29, 2019 at 11:57:19AM +0200, Geert Uytterhoeven wrote: > Hi Christoph, > > On Thu, Jul 25, 2019 at 8:35 AM Christoph Hellwig wrote: > > Most dma_map_ops instances are IOMMUs that work perfectly fine in 32-bits > > of IOVA space, and the generic direct mapping code already provides its > > own routines that is intelligent based on the amount of memory actually > > present. Wire up the dma-direct routine for the ARM direct mapping code > > as well, and otherwise default to the constant 32-bit mask. This way > > we only need to override it for the occasional odd IOMMU that requires > > 64-bit IOVA support, or IOMMU drivers that are more efficient if they > > can fall back to the direct mapping. > > As I know you like diving into cans of worms ;-) > > Does 64-bit IOVA support actually work in general? Or only on 64-bit > platforms, due to dma_addr_t to unsigned long truncation on 32-bit? Most IOMMUs use 32-bit IOVAs, and thus we default to the 32-bit mask because it is common and failsafe vs the normal linux assumptions. However the ia64 SGI SN2 platform, and the powerpc IBM ebus implementations seem to require a 64-bit mask already, so we keep that behavior as is. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Date: Tue, 30 Jul 2019 06:26:51 +0000 Subject: Re: [PATCH 4/5] dma-mapping: provide a better default ->get_required_mask Message-Id: <20190730062651.GA29518@lst.de> List-Id: References: <20190725063401.29904-1-hch@lst.de> <20190725063401.29904-5-hch@lst.de> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Geert Uytterhoeven Cc: linux-xtensa@linux-xtensa.org, Michal Simek , Parisc List , Linux-sh list , Takashi Iwai , linuxppc-dev , the arch/x86 maintainers , linux-m68k , Linux Kernel Mailing List , Linux IOMMU , Robin Murphy , Christoph Hellwig , Linux ARM , Marek Szyprowski On Mon, Jul 29, 2019 at 11:57:19AM +0200, Geert Uytterhoeven wrote: > Hi Christoph, > > On Thu, Jul 25, 2019 at 8:35 AM Christoph Hellwig wrote: > > Most dma_map_ops instances are IOMMUs that work perfectly fine in 32-bits > > of IOVA space, and the generic direct mapping code already provides its > > own routines that is intelligent based on the amount of memory actually > > present. Wire up the dma-direct routine for the ARM direct mapping code > > as well, and otherwise default to the constant 32-bit mask. This way > > we only need to override it for the occasional odd IOMMU that requires > > 64-bit IOVA support, or IOMMU drivers that are more efficient if they > > can fall back to the direct mapping. > > As I know you like diving into cans of worms ;-) > > Does 64-bit IOVA support actually work in general? Or only on 64-bit > platforms, due to dma_addr_t to unsigned long truncation on 32-bit? Most IOMMUs use 32-bit IOVAs, and thus we default to the 32-bit mask because it is common and failsafe vs the normal linux assumptions. However the ia64 SGI SN2 platform, and the powerpc IBM ebus implementations seem to require a 64-bit mask already, so we keep that behavior as is. 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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 11980C0650F for ; Tue, 30 Jul 2019 06:29:03 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 66C652064A for ; Tue, 30 Jul 2019 06:29:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 66C652064A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45yRTl4ZcDzDqT9 for ; Tue, 30 Jul 2019 16:28:59 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lst.de (client-ip=213.95.11.211; helo=verein.lst.de; envelope-from=hch@lst.de; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=lst.de Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 45yRRV6ljJzDqL4 for ; Tue, 30 Jul 2019 16:26:59 +1000 (AEST) Received: by verein.lst.de (Postfix, from userid 2407) id 221D568AEF; Tue, 30 Jul 2019 08:26:52 +0200 (CEST) Date: Tue, 30 Jul 2019 08:26:51 +0200 From: Christoph Hellwig To: Geert Uytterhoeven Subject: Re: [PATCH 4/5] dma-mapping: provide a better default ->get_required_mask Message-ID: <20190730062651.GA29518@lst.de> References: <20190725063401.29904-1-hch@lst.de> <20190725063401.29904-5-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) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-xtensa@linux-xtensa.org, Michal Simek , Parisc List , Linux-sh list , Takashi Iwai , linuxppc-dev , the arch/x86 maintainers , linux-m68k , Linux Kernel Mailing List , Linux IOMMU , Robin Murphy , Christoph Hellwig , Linux ARM , Marek Szyprowski Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, Jul 29, 2019 at 11:57:19AM +0200, Geert Uytterhoeven wrote: > Hi Christoph, > > On Thu, Jul 25, 2019 at 8:35 AM Christoph Hellwig wrote: > > Most dma_map_ops instances are IOMMUs that work perfectly fine in 32-bits > > of IOVA space, and the generic direct mapping code already provides its > > own routines that is intelligent based on the amount of memory actually > > present. Wire up the dma-direct routine for the ARM direct mapping code > > as well, and otherwise default to the constant 32-bit mask. This way > > we only need to override it for the occasional odd IOMMU that requires > > 64-bit IOVA support, or IOMMU drivers that are more efficient if they > > can fall back to the direct mapping. > > As I know you like diving into cans of worms ;-) > > Does 64-bit IOVA support actually work in general? Or only on 64-bit > platforms, due to dma_addr_t to unsigned long truncation on 32-bit? Most IOMMUs use 32-bit IOVAs, and thus we default to the 32-bit mask because it is common and failsafe vs the normal linux assumptions. However the ia64 SGI SN2 platform, and the powerpc IBM ebus implementations seem to require a 64-bit mask already, so we keep that behavior as is. 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=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 E5141C0650F for ; Tue, 30 Jul 2019 06:27:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 B6B0B2064A for ; Tue, 30 Jul 2019 06:27:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cGaLKRHH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B6B0B2064A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject: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=aG+l3QrJFc7dA4epWK9PLlNULvN+DSYw2hAJTPWz3CM=; b=cGaLKRHH3dJNff aGu7oh0NLfdesg37bHRisrAbvM+8ZC1ItI/XDLeAazSzHwkqDrrvdtdL9DeO3/uYqMVFhGi9PlBMp eKseEtq4wU4PsMq7rLN42kN6icKkjoofGtwsT61FgQQNbs1RkwErH8LFH5Mmz45MnxopJg8a4RXM9 NoASvM3DNkgqMJ3MCuWMGM6mv7Ht6MRhg+ipz7FKMQFeIUuS3FH5pfzX5Lyh3+wRViw1JEOzkj9P4 8VFM6fdnNpKeueEaezxghsWyQ6FBE0xcR23aMZ1Z91Yu1mkfDYfIPuPfB4VBLvUMmsdknNVHT1ajm yCi7RHwYG01VtIAeIrJw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hsLbF-0001wA-44; Tue, 30 Jul 2019 06:27:05 +0000 Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hsLbB-0001v3-G4 for linux-arm-kernel@lists.infradead.org; Tue, 30 Jul 2019 06:27:03 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id 221D568AEF; Tue, 30 Jul 2019 08:26:52 +0200 (CEST) Date: Tue, 30 Jul 2019 08:26:51 +0200 From: Christoph Hellwig To: Geert Uytterhoeven Subject: Re: [PATCH 4/5] dma-mapping: provide a better default ->get_required_mask Message-ID: <20190730062651.GA29518@lst.de> References: <20190725063401.29904-1-hch@lst.de> <20190725063401.29904-5-hch@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190729_232701_689265_5F6AE1F4 X-CRM114-Status: GOOD ( 12.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-xtensa@linux-xtensa.org, Michal Simek , Parisc List , Linux-sh list , Takashi Iwai , linuxppc-dev , the arch/x86 maintainers , linux-m68k , Linux Kernel Mailing List , Linux IOMMU , Robin Murphy , Christoph Hellwig , Linux ARM , Marek Szyprowski Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jul 29, 2019 at 11:57:19AM +0200, Geert Uytterhoeven wrote: > Hi Christoph, > > On Thu, Jul 25, 2019 at 8:35 AM Christoph Hellwig wrote: > > Most dma_map_ops instances are IOMMUs that work perfectly fine in 32-bits > > of IOVA space, and the generic direct mapping code already provides its > > own routines that is intelligent based on the amount of memory actually > > present. Wire up the dma-direct routine for the ARM direct mapping code > > as well, and otherwise default to the constant 32-bit mask. This way > > we only need to override it for the occasional odd IOMMU that requires > > 64-bit IOVA support, or IOMMU drivers that are more efficient if they > > can fall back to the direct mapping. > > As I know you like diving into cans of worms ;-) > > Does 64-bit IOVA support actually work in general? Or only on 64-bit > platforms, due to dma_addr_t to unsigned long truncation on 32-bit? Most IOMMUs use 32-bit IOVAs, and thus we default to the 32-bit mask because it is common and failsafe vs the normal linux assumptions. However the ia64 SGI SN2 platform, and the powerpc IBM ebus implementations seem to require a 64-bit mask already, so we keep that behavior as is. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel