Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9554170imu; Wed, 5 Dec 2018 06:42:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/UCEQnczcMUg9N1eQMeUNg4fHOKvyqxteMCtMRfUmYO6r5nyZBplC3/kG7oJMxGJZdsBZwe X-Received: by 2002:a17:902:6b83:: with SMTP id p3mr24259072plk.118.1544020957555; Wed, 05 Dec 2018 06:42:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544020957; cv=none; d=google.com; s=arc-20160816; b=OfByzcpUH55mOAMa8oD61O6AHSQ+tS91s/3f2Me9AQJePPI3m1Mp0HO4CErwoX6m80 snVSsKj2FhbssQRSEyzVkwWRAJWZtuu5azUr1Ec0LXr1hWWKb/ZjDCb4M82b/hMctYFh mufi6GX8zvQLS0tmCIiQpIRPQjW39pzcRjpSZ8XACP9U2gfYkNQI4s379RfTxrI4OsYw WhvczfYRsyeP5NKx59TEYFT3TID89KRSyUI0sx81yfcx4whnV7Vv5fkuYdFpZl2jUFkF lT/vRlUlsxoYdb6cIh7AaOAUsrZguxt5n6cYZEqAgz6UkuG84y/37e1EWf6WJ6RcpiLP f62g== 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=5dB/kA+e/cRODdfkkaz2h5SjmpfPv0YMgP7fEISNgFY=; b=kehZUvNgPZp4g54EI3748W3VjIRlAVxs9g8BncUksBIIwEtaI7ljDz73slXE+9NwlO RcrHcm48KnYmyjVWKYj/tJvEJZp16djkUfs0d5ZgcpeIOe6rpJe0MYExzByFb3V2WtJo Tr+/B8TChRVr5demPys/BK84zzKZhdeJHHRBX+0hKuzDJ90gGQto5UW0I+/VmaXKILg3 IvnY7OTFH9Go7ak4IzSUyELoZHgmpStbnR8vyfswzZorxhrVwsNxVa3EiSgphNb5NzIH WBquKNcb+y+ImXjonRYMs45UyTTj+/CY9FZUCQnPsch+MBDN2NDONmChnokaNkX3tFmq awnA== 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 n5si16649267pgl.485.2018.12.05.06.42.22; Wed, 05 Dec 2018 06:42:37 -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; 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 S1727772AbeLEOkN (ORCPT + 99 others); Wed, 5 Dec 2018 09:40:13 -0500 Received: from foss.arm.com ([217.140.101.70]:55752 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726918AbeLEOkN (ORCPT ); Wed, 5 Dec 2018 09:40:13 -0500 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 6FD2380D; Wed, 5 Dec 2018 06:40:12 -0800 (PST) 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 8E4E63F59C; Wed, 5 Dec 2018 06:40:08 -0800 (PST) Subject: Re: [PATCH v4 3/3] iommu/io-pgtable-arm-v7s: Request DMA32 memory, and improve debugging To: Christoph Hellwig , Nicolas Boichat Cc: Will Deacon , 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, Matthew Wilcox References: <20181205054828.183476-1-drinkcat@chromium.org> <20181205054828.183476-4-drinkcat@chromium.org> <20181205135406.GA29031@infradead.org> From: Robin Murphy Message-ID: <1d211576-9153-cca1-5cd0-8c9881bd3fa4@arm.com> Date: Wed, 5 Dec 2018 14:40:06 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181205135406.GA29031@infradead.org> 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 05/12/2018 13:54, Christoph Hellwig wrote: > 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. 32-bit Arm doesn't have ZONE_DMA32, but has (or at least had at the time) a 2GB ZONE_DMA. Whether we actually need that or not depends on how this all interacts with LPAE and highmem, but I'm not sure of those details off-hand. Robin.