Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2490969imu; Wed, 21 Nov 2018 12:29:21 -0800 (PST) X-Google-Smtp-Source: AJdET5ekeKlutuwDhticuWULpWKtoibKZlWkWUdeFq4BtOOkkiiEXnl8X2bzNdT//IyBbpnrpoaa X-Received: by 2002:a62:1bd7:: with SMTP id b206mr8302297pfb.213.1542832161334; Wed, 21 Nov 2018 12:29:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542832161; cv=none; d=google.com; s=arc-20160816; b=NFIQqv/rxUfFq4y9P630SvY6OApReUCcwUIndwd/1/VLqZcxQTNGIF/Yee1HvrlShq phW5ZDhZuvWsHixLwcEXG1Lhft6gclBJ0PC+sFZMHQFY9hpRB9vuC7ifwHwclnb9+OkI So/IyHgazliMNMemeHmho26LtByXkHsd7jr0sWVdc/tYqfpPfp/EFPUCfH0EyFJj2Pmj KbndGcTgTE+sWFtAx7NtmhxPGjx3kDt704u+3XQDuBr8AwyfzWjn7EObdVG7Jqq9U8Qb EqtPPdjrWpZ8ctkBQ3Pd0wU6DikzOU2XyZgjKUZkR4ghjoJexmpsi1uJrXUMrhLLpTg6 G3EQ== 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; bh=I5WBb6KzRLVERDdHJlnpbU0ZzzoTm+XxELhmizpFpPQ=; b=F5fEyfJEN2WB8frvVV5bnrN/VJcn+6cEmCApFCIqyzkIgig5ov4shxkrsHSM1gv9nP waL4q2Fae3LBT2W5vDXnlap+VANQtmoHLaWxIQ++0a+09Jt5CBwPawNjtfDNIHWO/zuf V/1gZjiCsVGATII19rd5YmylU5NAlIoOkmkDDQCMtOPs1ayM3cdQOL/j9AYGrDDVL6qs k2P18HutHOn72BxO4WVtkssBQgjfknTKHO/LiWb0c3WDDSM6//HS389E28KmNRNSLSoN ZxnpVy5FROD4BMOPUWGxvXcaxh03yWcFbaWqn2U5YagxmaTShBF9X1jxWyyiN9Wn8w4B kIlg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cd16si20736049plb.47.2018.11.21.12.29.05; Wed, 21 Nov 2018 12:29:21 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732943AbeKVEhs (ORCPT + 99 others); Wed, 21 Nov 2018 23:37:48 -0500 Received: from mx2.suse.de ([195.135.220.15]:52342 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732935AbeKVEhr (ORCPT ); Wed, 21 Nov 2018 23:37:47 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8C812AD49; Wed, 21 Nov 2018 18:02:22 +0000 (UTC) Date: Wed, 21 Nov 2018 19:02:20 +0100 From: Michal Hocko To: Will Deacon Cc: Nicolas Boichat , Robin Murphy , Joerg Roedel , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , 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 Subject: Re: [PATCH v2 3/3] iommu/io-pgtable-arm-v7s: Request DMA32 memory, and improve debugging Message-ID: <20181121180000.GU12932@dhcp22.suse.cz> References: <20181111090341.120786-1-drinkcat@chromium.org> <20181111090341.120786-4-drinkcat@chromium.org> <20181121164638.GD24883@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181121164638.GD24883@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 21-11-18 16:46:38, Will Deacon wrote: > On Sun, Nov 11, 2018 at 05:03:41PM +0800, Nicolas Boichat wrote: > > 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. > > > > Also, print an error when the physical address does not fit in > > 32-bit, to make debugging easier in the future. > > > > Fixes: ad67f5a6545f ("arm64: replace ZONE_DMA with ZONE_DMA32") > > Signed-off-by: Nicolas Boichat > > --- > > > > Changes since v1: > > - Changed approach to use SLAB_CACHE_DMA32 added by the previous > > commit. > > - Use DMA or DMA32 depending on the architecture (DMA for arm, > > DMA32 for arm64). > > > > drivers/iommu/io-pgtable-arm-v7s.c | 20 ++++++++++++++++---- > > 1 file changed, 16 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c > > index 445c3bde04800c..996f7b6d00b44a 100644 > > --- a/drivers/iommu/io-pgtable-arm-v7s.c > > +++ b/drivers/iommu/io-pgtable-arm-v7s.c > > @@ -161,6 +161,14 @@ > > > > #define ARM_V7S_TCR_PD1 BIT(5) > > > > +#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 > > It's a bit grotty that GFP_DMA32 doesn't just map to GFP_DMA on 32-bit > architectures, since then we wouldn't need this #ifdeffery afaict. But GFP_DMA32 should map to GFP_KERNEL on 32b, no? Or what exactly is going on in here? -- Michal Hocko SUSE Labs