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

[Xen-devel] [PATCH V3] 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: Mon, 16 Sep 2019 09:51:33 +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=S8F5CzEJ/age1CHHHPqTMUHg6wLBT35cM6qcA/wKMQA=; b=KYFcb5BoA3Qer+mVYvhXLgEQL+H4SljhmErNxmtDpLYZCNrh4bAFdEAir9MV/akGqXlsXR6kMkfv0BOvIGO7iKfBxdNXYZySTT52EVZtGGxECOlNHg+KGC7ayze7pCQhqCgeshGQE5Z9DNps4rtGMaOSWlG7PDr4EE58qFHU1YnLRadgp7vlPI7wVMv/TUdIZrr3YEz9uEfrfCXXqPMKb65W4TbIZIOWMeHdwMq4i2ljYu+zrNtw/T2BrU9eyj8qsIAKsYqSHRVaQRPzZpYRmyQqH+LgodasmScQEujN45zAVHtrrHxqSRcvmfLWVH4Xvvk5u1nAebGvONJUoxnQ2A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OrPJnOpTBkVylyJtRpsRntiLtvIWd3Cz9EfihoRQHLP2d/2kQr58nfSIr0F5THakU5GbLyAXdg7hUvQQHpYjiY/zVbXVRdEvoTp5hsKIQ2fTgu8XXyWNTlOuzwDav9FDKAXpR3X+Uirk+ViG4SvL7U8sZ1eyhKvHqobqOd9whBcCyTtHnwaLn52vBGW++jjl175IaUNSATeMLuuMmnT8GbbCFm5jXtkMYIjSioyHsCxmnnGRXRGXkGodBK2upJPkouRauy7o7M5z4qcCyuiIU1FYXh/HPC5l7zrjrWUObob/BdKXWz5OVklErWUzryUauhby3jA1XMy+W74Yf6MLeQ==
  • 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: Mon, 16 Sep 2019 09:51:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVbHRSaJ8nL5OcZUKnpAnuiJ+Vsw==
  • Thread-topic: [PATCH V3] 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 add a check if CONFIG_ZONE_DMA32 is enabled use __GFP_DMA32.

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

V3:
 Use IS_ENABLED(CONFIG_ZONE_DMA32) and drop xen_set_gfp_dma.

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/xen/mm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
index 2b2c208408bb..38fa917c8585 100644
--- a/arch/arm/xen/mm.c
+++ b/arch/arm/xen/mm.c
@@ -28,7 +28,10 @@ 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;
+                       if (IS_ENABLED(CONFIG_ZONE_DMA32))
+                               flags |= __GFP_DMA32;
+                       else
+                               flags |= __GFP_DMA;
                        break;
                }
        }
-- 
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®.