Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9501475imu; Wed, 5 Dec 2018 05:56:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/UUvmc0lVebQGIMU8Qns9oG6r8HS5jBj1OGBqoQgzeZU6KW89DqB79xc/eZz2t/hU2UUoyq X-Received: by 2002:a63:a112:: with SMTP id b18mr20722027pgf.440.1544018179877; Wed, 05 Dec 2018 05:56:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544018179; cv=none; d=google.com; s=arc-20160816; b=ruNzeSB+0Wt49406hz+keNY0CUY4KO8I7o64YLUWyPAYRrmGx8+KlKmGrvP0f4vojA Bojty4nWYdROFBhAAQjgzyblfTnJLkTygJEcRpJWmcKNjQTA+pajXVSz83g2O1y19Iua zLz1MhPleHawjBIgNKTVFzpgXEuQH30p0qrEZWZ6QU+hzfzTybUQY2FeZzli4xFgHTx4 tZOyxZSPoRhXegiydCe8YvE75p29ld2NgHGxmjIMXTC0TBfSklx+9jdHEFjX8vB/lElw SpEQlS0dGvtueBtWuAeOSeJVvh5M0QOWK1YaZHzOxFbEjBLzgbOxFYLb2VemqrjDYRaW r5Dw== 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:dkim-signature; bh=tX4Y9yN01q44Qpvl+qeo/BASivX6y01jxRNqPm4MzZU=; b=a2918GmK2ZTBbqQlFBFCcJPGcJkcl6qtxcQ/xD4OcVjA8tbDQ32CT/0NEpJ7dKP6Ib PJDDFI3bCe1mn5vxHMhcoxbjltQAzuqKwnz9lp6W7cfNabuKOXSf9qLTtFwrht6F2kLK AX/pjVO8kwVSL0h+C4pi7MjDxy+pZoiD3vLvozDlVTpexeM+L6jLeWuve24udd8maesj jJAzReA7XAvNWBhOvORFkVngnH5LmZ/HA3UMd04zxXHjGAGoVCTeL6JBQ2NHGpryCosA 8IkUSXCbOxh6lBJMwozNHfp19XiWFHiX3CiKZqltfHzFBDK98r1Zpl6m9BEumj1aMcRR Czqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=DuTlMrV5; 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 4si19599215pfg.280.2018.12.05.05.56.04; Wed, 05 Dec 2018 05:56:19 -0800 (PST) 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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=DuTlMrV5; 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 S1727475AbeLENyp (ORCPT + 99 others); Wed, 5 Dec 2018 08:54:45 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:45532 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727025AbeLENyo (ORCPT ); Wed, 5 Dec 2018 08:54:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tX4Y9yN01q44Qpvl+qeo/BASivX6y01jxRNqPm4MzZU=; b=DuTlMrV5pCd8Fm6+Hm+0C2lHq m79KlL9ccjF22q+tUCTUq7igAnC3kbv9snkDjoGEtJIDxztoBNNco2HcwAzNvSCG6JO8pCRgdlBo2 Weqym8geC2GV93P9yw0RzjwRYc02fpfGFmXcWSsCN56fDgBmU/EtgA0WKs1a4ExKCxPg5hZEmBYfo PUvwdBqhsYkqh+AJLCrmo+xQ6EOxvPLN2H4NtX6Y2YAGUxPSlcAYmL8tDL6oWI5WYr/waFt2hsR6d QgeAs/tdkuYf6BAifMLwjOzqKoXRXKqGGBML/wRkptZS69NkiKKt8aZUouUFX1F0n5MIb13x2KIWR mGnrcgurQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUXcs-0007xk-Bb; Wed, 05 Dec 2018 13:54:06 +0000 Date: Wed, 5 Dec 2018 05:54:06 -0800 From: Christoph Hellwig To: Nicolas Boichat Cc: Will Deacon , Robin Murphy , Joerg Roedel , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Michal Hocko , Mel Gorman , Levin Alexander , Huaisheng Ye , Mike Rapoport , linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Yong Wu , Matthias Brugger , Tomasz Figa , yingjoe.chen@mediatek.com, hch@infradead.org, Matthew Wilcox Subject: Re: [PATCH v4 3/3] iommu/io-pgtable-arm-v7s: Request DMA32 memory, and improve debugging Message-ID: <20181205135406.GA29031@infradead.org> References: <20181205054828.183476-1-drinkcat@chromium.org> <20181205054828.183476-4-drinkcat@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181205054828.183476-4-drinkcat@chromium.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 05, 2018 at 01:48:28PM +0800, Nicolas Boichat wrote: > IOMMUs using ARMv7 short-descriptor format require page tables > (level 1 and 2) to be allocated within the first 4GB of RAM, even > on 64-bit systems. > +#ifdef CONFIG_ZONE_DMA32 > +#define ARM_V7S_TABLE_GFP_DMA GFP_DMA32 > +#define ARM_V7S_TABLE_SLAB_CACHE SLAB_CACHE_DMA32 > +#else > +#define ARM_V7S_TABLE_GFP_DMA GFP_DMA > +#define ARM_V7S_TABLE_SLAB_CACHE SLAB_CACHE_DMA > +#endif How does using GFP_DMA make sense based on the above? If the system has more than 32-bits worth of RAM it should be using GFP_DMA32, else GFP_KERNEL, not GFP_DMA for an arch defined small addressability pool.