[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] arm: xen: mm: use __GPF_DMA32 for arm64


  • To: Robin Murphy <robin.murphy@xxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "linux@xxxxxxxxxxxxxxx" <linux@xxxxxxxxxxxxxxx>
  • From: Peng Fan <peng.fan@xxxxxxx>
  • Date: Wed, 28 Aug 2019 01:48:16 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JB1ctoAauEct+yvK04W06MWvXhpMKF606kLZW0/mdL0=; b=SrgxD3Gb8Da1JnVkiaZU8yxUw1Yjqu74lBlv2a348Bp2oCwYKgMxK/Vxb4CbT/4/nTCnOifgIlgHQNrSnsBnd5Nb90CDpoYm7PYNMhasoL+fWaS4SgSEJtRudFnTYW7gRsyKx3t8NjQZNoFK2rQwjDLDztpYOe7cpu9uKJqXNSrrVmp0TNgy5qJ264A674+8CLES7yCgdN/qiqJ4NUlBcdSMNxGsxv9qdPnFe1l/bfP/0NS1mrmxwR9AWe54PyqGRfrlb4RFBKDkhr9gyZsuP+dpb870OwuQXraPx+kDvhF9oERKbrKYGmwbB1vEs/PjVWOBSvQ0Ihp+pfyStbSmvQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HGvYCXbKRmhZu7dUOmXaeIJqQcF9kqzvDsMNBdEJGVY6rBzCfQHNs6IiOg/30UxDflKHB4YaGLrhaJme6og6fHRT4djsTuYbdyfNuuDzIoEvVaRoRQWoQYH2Sl5Bz7alywiIlP7nzIoMeCFOVuWOCn/QQSh2bpl/k2yrz8chRtA7YzX7IcVOp5/RudbJeD7ntdmpI57BCP3+SYb8GqivBTROIshbC41W1ufYCTbNoHX46KjMTlzE8X3dzzq/Miyi2xFagGZNZ9sPwr1Sz8WiswyCcJB9FXPNYaE29IM3JYPyH0A9EpLF9ZDUB/u7AHKYUgziGI/plJc/qBWVMVvMaw==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@xxxxxxx;
  • Cc: "van.freenix@xxxxxxxxx" <van.freenix@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx" <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, dl-linux-imx <linux-imx@xxxxxxx>
  • Delivery-date: Wed, 28 Aug 2019 01:48:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVNi9zmpVhxJk2Z0aPUBEkePn3c6cPOA8AgADZ48A=
  • Thread-topic: [PATCH] arm: xen: mm: use __GPF_DMA32 for arm64

Hi Robin,

> Subject: Re: [PATCH] arm: xen: mm: use __GPF_DMA32 for arm64
> 
> 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 <peng.fan@xxxxxxx>
> > ---
> >   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.

How about this, or do you have any suggestions?
diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
index d33b77e9add3..f61c29a4430f 100644
--- a/arch/arm/xen/mm.c
+++ b/arch/arm/xen/mm.c
@@ -28,7 +28,11 @@ unsigned long xen_get_swiotlb_free_pages(unsigned int order)

        for_each_memblock(memory, reg) {
                if (reg->base < (phys_addr_t)0xffffffff) {
+#ifdef CONFIG_ARM64
+                       flags |= __GFP_DMA32;
+#else
                        flags |= __GFP_DMA;
+#endif
                        break;
                }
        }

Thanks,
Peng.

> 
> Robin.
> 
> [1]
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.ke
> rnel.org%2Flinux-arm-kernel%2F20190820145821.27214-1-nsaenzjulienne%
> 40suse.de%2F&amp;data=02%7C01%7Cpeng.fan%40nxp.com%7C5d2a641b1
> e3f449562f908d72ae95d85%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0
> %7C0%7C637025054169859035&amp;sdata=1ZPGH0gZnvgmlMpX7VrjUNME
> XbEjiv4%2FZ9pYwTQTWxY%3D&amp;reserved=0
> 
> >                     break;
> >             }
> >     }
> >
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.