[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: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Peng Fan <peng.fan@xxxxxxx>
  • Date: Thu, 29 Aug 2019 02:46:19 +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=7yWf7L2gQzxVkG10y4VJ/kAw1LB+1I9uUe7/qn1cW9k=; b=MVrKqjI4WnYfsRjbXxK/pwI/fo0UV0hpnYdZb7SHoVYRkSVG0UrznuvB07BNiiWtfy16pTOzT71kgtDTgNsgbpO7TRJWl1Djhy87UI4YDb63txaQkYTRjs8b9aY0HDZ7gQaFDmKri96ldPqLBy4CI5p/fOuk7Eje/JLY6U1saKj7aSn+ObO0c3Cbyh5Lufwq6Y1VgvyLiudBWaSQfveSzOnAvzrHxUgZDLQp2Lg1B7E3HiAPMp1O1R/9lyxbdP4BCn6d9gDB2JJEkE4Cfg7XBIOrbs1t0oJUzc+SYZ12PCvSuL5+9f8B+4hgdN/A4qihsNqj6+16QV5pZRQrfDYUaQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cqCu8U1A+GXYYZpOYMCDpqB2hyLinidfIqmhnhr2jSanMqYheCvkZWxtcjeKzKPiIGGnykwOIIfsPC/fIPlm9JiS636uNbXruUpbYjt8w5fL15wnAn0Z2MlRIExkFvtbRqegVx37B6kLxhxMFY0L5+oaidRXhVmKtCYpKSNvj3gp7A4d3jI8ug/Wlr1fmez7ftVDVTbS40bKyV1ORF4u+45Cvsk6K/vG0Z9YbkAep/SypytdL/0qaZwxixXSzmLosWtS8xSl0HP5XmoL1ivwGDYiL9BvApvd2eWWLldRtL2Zqqc1vQ9YZiS9drLs/enlhsCzraQXXPLYMd+jIf5kSg==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@xxxxxxx;
  • Cc: "linux@xxxxxxxxxxxxxxx" <linux@xxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, dl-linux-imx <linux-imx@xxxxxxx>, "van.freenix@xxxxxxxxx" <van.freenix@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Robin Murphy <robin.murphy@xxxxxxx>, "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx" <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 29 Aug 2019 02:46:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVNi9zmpVhxJk2Z0aPUBEkePn3c6cPOA8AgADZ48CAARk7AIAAkAzw
  • Thread-topic: [PATCH] arm: xen: mm: use __GPF_DMA32 for arm64

Hi Stefano,

> Subject: RE: [PATCH] arm: xen: mm: use __GPF_DMA32 for arm64
> 
> On Wed, 28 Aug 2019, Peng Fan wrote:
> > 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.
> 
> Hi Peng,
> 
> Sorry for being so late in replying, this email got lost in the noise.
> 
> 
> > > > 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;
> >                 }
> >         }
> 
> Yes I think this is the way to go, but we are trying not to add any #ifdef
> CONFIG_ARM64 under arch/arm. Maybe you could introduce a static inline
> function to set GFP_DMA:
> 
>   static inline void xen_set_gfp_dma(gfp_t *flags)
> 
> it could be implemented under arch/arm/include/asm/xen/page.h for arm
> and under arch/arm64/include/asm/xen/page.h for arm64 using __GFP_DMA
> for the former and __GFP_DMA32 for the latter.

Thanks for your suggestion. I'll use this in V2.

Thanks,
Peng.


_______________________________________________
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®.