From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by kanga.kvack.org (Postfix) with ESMTP id 8935A8E0018 for ; Mon, 10 Dec 2018 10:35:04 -0500 (EST) Received: by mail-ot1-f71.google.com with SMTP id s12so4741183otc.12 for ; Mon, 10 Dec 2018 07:35:04 -0800 (PST) Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id g63si4674532oia.256.2018.12.10.07.35.03 for ; Mon, 10 Dec 2018 07:35:03 -0800 (PST) Date: Mon, 10 Dec 2018 15:35:24 +0000 From: Will Deacon Subject: Re: [PATCH v6 2/3] iommu/io-pgtable-arm-v7s: Request DMA32 memory, and improve debugging Message-ID: <20181210153524.GB24554@edgewater-inn.cambridge.arm.com> References: <20181210011504.122604-1-drinkcat@chromium.org> <20181210011504.122604-3-drinkcat@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181210011504.122604-3-drinkcat@chromium.org> Sender: owner-linux-mm@kvack.org List-ID: To: Nicolas Boichat Cc: 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 , hsinyi@chromium.org, stable@vger.kernel.org On Mon, Dec 10, 2018 at 09:15:03AM +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. > > For level 1/2 pages, ensure GFP_DMA32 is used if CONFIG_ZONE_DMA32 > is defined (e.g. on arm64 platforms). > > For level 2 pages, allocate a slab cache in SLAB_CACHE_DMA32. Note > that we do not explicitly pass GFP_DMA[32] to kmem_cache_zalloc, > as this is not strictly necessary, and would cause a warning > in mm/sl*b.c, as we did not update GFP_SLAB_BUG_MASK. > > Also, print an error when the physical address does not fit in > 32-bit, to make debugging easier in the future. > > Cc: stable@vger.kernel.org > Fixes: ad67f5a6545f ("arm64: replace ZONE_DMA with ZONE_DMA32") > Signed-off-by: Nicolas Boichat > --- Acked-by: Will Deacon Will