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

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


  • To: "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "linux@xxxxxxxxxxxxxxx" <linux@xxxxxxxxxxxxxxx>, "catalin.marinas@xxxxxxx" <catalin.marinas@xxxxxxx>, "will@xxxxxxxxxx" <will@xxxxxxxxxx>, "robin.murphy@xxxxxxx" <robin.murphy@xxxxxxx>
  • From: Peng Fan <peng.fan@xxxxxxx>
  • Date: Fri, 30 Aug 2019 02:28:41 +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=XG0rWLhe7eNDoZpMeoGrKroXqtpjwdJE3AtA5mD/wiY=; b=HT3fvlaB0TcTU6e2ggEbeISFp0OvWqrWXYeCgRnlq5SUOcU84C+8Lcy8npoT2/GR2iSUdm7s5mA0I1rgfbfDmDIpjGRRHevsKyOH7kV39+FiX8gx7Q2I4pscroFxo9c+xGSVpT4r5r4Xt1O67Vy7AtCZkW/mSLpPZ0ROyKHFQj9pMn7nPIRBWNyisF8JbmS4dGtMK7U6+h0RY9NEtO1GOO292Mf20ca+cQ1NkaPM21xFvrFDCjp/RuRt+rHeUUlxANxPWGyskG6kq1kfQSZtv9C6VFDVEwNxFJmOkiXkMji7wDazstBe8KR/WeE4CsWUTDYjvgex2ofE5C7i5fWoWw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IV1nuaGbeX4EPMKY1an+ImXugJLAjAEJ1dehoyAbT9OvDS1yDbz9h7O2f+tu7enreGOIzC5gqRm7Xr8POpuGFdCUluXQPGiWMivDJWsU4bVGmk6qPdJP6R7JzwwRkEwIRV67uO0k5b0fK0DZPT3nwOcdrf4zLtBmVxg9I3iqma05kKMkTPXALsZl0I588y7N+t6Wu1fjWJdO4YqOWyyaOE7nhiEChKExtDG6r72JSo4zI1e2qiMiK4vxQFUCjV4Vi1YCwEgjVtnXfSUUl3STpjpmh6DsciwChE/WbRvvkpT1UkC0wAsC2oAAa/btxm6Bgv4WmNBBb8kN36tmHPPGng==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@xxxxxxx;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Peng Fan <peng.fan@xxxxxxx>, dl-linux-imx <linux-imx@xxxxxxx>, "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx" <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 30 Aug 2019 02:28:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVXtqjidV/KwEkYkeguLx++Vlcnw==
  • Thread-topic: [PATCH V2] arm: xen: mm: use __GPF_DMA32 for arm64

From: Peng Fan <peng.fan@xxxxxxx>

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 introduce xen_set_gfp_dma for arm32/arm64 and using __GFP_DMA
for the former and __GFP_DMA32 for the latter.

Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
---

V2:
 Follow suggestion from Stefano,
 introduce static inline void xen_set_gfp_dma(gfp_t *flags) for arm32/arm64, and
 for arm64 using __GFP_DMA for the former and __GFP_DMA32 for the latter.

 arch/arm/include/asm/xen/page.h   | 5 +++++
 arch/arm/xen/mm.c                 | 2 +-
 arch/arm64/include/asm/xen/page.h | 5 +++++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/xen/page.h b/arch/arm/include/asm/xen/page.h
index 31bbc803cecb..d08309c45e6c 100644
--- a/arch/arm/include/asm/xen/page.h
+++ b/arch/arm/include/asm/xen/page.h
@@ -1 +1,6 @@
 #include <xen/arm/page.h>
+
+static inline void xen_set_gfp_dma(gfp_t *flags)
+{
+       *flags |= __GFP_DMA;
+}
diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
index d33b77e9add3..828f49dc95f9 100644
--- a/arch/arm/xen/mm.c
+++ b/arch/arm/xen/mm.c
@@ -28,7 +28,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;
+                       xen_set_gfp_dma(&flags);
                        break;
                }
        }
diff --git a/arch/arm64/include/asm/xen/page.h 
b/arch/arm64/include/asm/xen/page.h
index 31bbc803cecb..5eeabf2c6494 100644
--- a/arch/arm64/include/asm/xen/page.h
+++ b/arch/arm64/include/asm/xen/page.h
@@ -1 +1,6 @@
 #include <xen/arm/page.h>
+
+static inline void xen_set_gfp_dma(gfp_t *flags)
+{
+       *flags |= __GFP_DMA32;
+}
-- 
2.16.4


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