Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5478003ybl; Tue, 27 Aug 2019 05:26:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7jkxEZXIiIl7KkuxtEPyPhCf75sWTn8Woxk5/s0shCYgDejh7chG5gExvqpnvpkq56tOe X-Received: by 2002:a62:5501:: with SMTP id j1mr25387196pfb.166.1566908770414; Tue, 27 Aug 2019 05:26:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566908770; cv=none; d=google.com; s=arc-20160816; b=SnOhcyw0RK0DHt80F3IjfvBpY1IZHUB2V51QjBAWfp+CsFidlCVhkgkfGouPpDYdo1 WpVCaUuEBUTDM13SFz0dm6mRybOzgZb1g6A9zqKYAatN4fOD7+owQFrwpu+38oMYKOXA Ud4LUgx1b48Np0FyuGTpuYO/33Us9c1IhsXyFicySGFzBL8F7gl5wrVpAnz9J2aoRzrD fx5zOnRmVnDJyzcZrJTHdHOrsiN6O8uzPOGojWcJZyDeIbQhGOmO6EDl0W//hp3qW2Xk HBtjV7bKLA+mFSmFbwpYPaOdATaTq+zrhmGIIAp6Ir0of8WqY3Uhp3z6gBxMwwI3vi3O 7urA== 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=XhC+hqjYttEg4Jjqyek6HQGsecPot47Cdi3Q8ec4OMs=; b=qUI4cECG4mPDMA+vKftcVdmzFpla77swZMtQjgoWqdnsom31gSmG/cNkPFkslhXKSJ XJ1UER2+z4dbD7TuIxZ8rNB8qk/Ky3JpkHmBol6gYgQHzeOnICQISqiuPbpmnCHcejZC 9YnPOJAZecQE0R3YhyCPmsmPd18X5pddQiZRfN1Hq4aRA/J7ik5QVXRhOqu0I3VsrxOF CVI0P7dtX4yt/9xvN8wqm2LYScWncp/1aDaTOVrdf00YAH/8jFEcpQ+VQCR9pYojnlw1 fmu3dwN622cii2+/vkqSmYTj8oGDOoo0irPQq6X8qfFpuefimIec2FP9ulKZv760fpJs gDnQ== 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 i11si12047447pgc.65.2019.08.27.05.25.54; Tue, 27 Aug 2019 05:26:10 -0700 (PDT) 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 S1727138AbfH0MX1 (ORCPT + 99 others); Tue, 27 Aug 2019 08:23:27 -0400 Received: from foss.arm.com ([217.140.110.172]:43770 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725850AbfH0MX1 (ORCPT ); Tue, 27 Aug 2019 08:23:27 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5D8E228; Tue, 27 Aug 2019 05:23:26 -0700 (PDT) Received: from [10.1.197.57] (e110467-lin.cambridge.arm.com [10.1.197.57]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4D4633F718; Tue, 27 Aug 2019 05:23:25 -0700 (PDT) Subject: Re: [PATCH] arm: xen: mm: use __GPF_DMA32 for arm64 To: Peng Fan , "sstabellini@kernel.org" , "linux@armlinux.org.uk" Cc: "linux-kernel@vger.kernel.org" , dl-linux-imx , "van.freenix@gmail.com" , "xen-devel@lists.xenproject.org" , "linux-arm-kernel@lists.infradead.org" References: <20190709083729.11135-1-peng.fan@nxp.com> From: Robin Murphy Message-ID: Date: Tue, 27 Aug 2019 13:23:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190709083729.11135-1-peng.fan@nxp.com> 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 09/07/2019 09:22, Peng Fan wrote: > arm64 shares some code under arch/arm/xen, including mm.c. > However ZONE_DMA is removed by commit > ad67f5a6545("arm64: replace ZONE_DMA with ZONE_DMA32"). > So to ARM64, need use __GFP_DMA32. > > Signed-off-by: Peng Fan > --- > arch/arm/xen/mm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c > index e1d44b903dfc..a95e76d18bf9 100644 > --- a/arch/arm/xen/mm.c > +++ b/arch/arm/xen/mm.c > @@ -27,7 +27,7 @@ unsigned long xen_get_swiotlb_free_pages(unsigned int order) > > for_each_memblock(memory, reg) { > if (reg->base < (phys_addr_t)0xffffffff) { > - flags |= __GFP_DMA; > + flags |= __GFP_DMA | __GFP_DMA32; Given the definition of GFP_ZONE_BAD, I'm not sure this combination of flags is strictly valid, but rather is implicitly reliant on only one of those zones ever actually existing. As such, it seems liable to blow up if the plans to add ZONE_DMA to arm64[1] go ahead. Robin. [1] https://lore.kernel.org/linux-arm-kernel/20190820145821.27214-1-nsaenzjulienne@suse.de/ > break; > } > } >