From patchwork Fri Aug 30 02:28:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11122825 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6654414D5 for ; Fri, 30 Aug 2019 02:30:48 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 404F72189D for ; Fri, 30 Aug 2019 02:30:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="A3T4KAee" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 404F72189D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i3Wed-00026x-NS; Fri, 30 Aug 2019 02:28:47 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i3Wec-00026s-42 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2019 02:28:46 +0000 X-Inumbo-ID: e2d59b50-cacd-11e9-b95f-bc764e2007e4 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:fe0e::602]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id e2d59b50-cacd-11e9-b95f-bc764e2007e4; Fri, 30 Aug 2019 02:28:44 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IV1nuaGbeX4EPMKY1an+ImXugJLAjAEJ1dehoyAbT9OvDS1yDbz9h7O2f+tu7enreGOIzC5gqRm7Xr8POpuGFdCUluXQPGiWMivDJWsU4bVGmk6qPdJP6R7JzwwRkEwIRV67uO0k5b0fK0DZPT3nwOcdrf4zLtBmVxg9I3iqma05kKMkTPXALsZl0I588y7N+t6Wu1fjWJdO4YqOWyyaOE7nhiEChKExtDG6r72JSo4zI1e2qiMiK4vxQFUCjV4Vi1YCwEgjVtnXfSUUl3STpjpmh6DsciwChE/WbRvvkpT1UkC0wAsC2oAAa/btxm6Bgv4WmNBBb8kN36tmHPPGng== 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-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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XG0rWLhe7eNDoZpMeoGrKroXqtpjwdJE3AtA5mD/wiY=; b=A3T4KAeeBq77ovOm4k8dtp0QJ/lRVeGgQt8PFLs50cRGXR9AeiZAC4xZ56TsEFgPZ/WwNc7hu5Ogj3KeGVgLM1nm/KBZDhmdYn2WUVOQey3qCq54XYO4+Qt7Cr7KtpexBPhCraFr7fv37DS7qaCAmK5u2dgvq+wIg6TY8Gd3lzs= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB6291.eurprd04.prod.outlook.com (20.179.33.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2199.21; Fri, 30 Aug 2019 02:28:41 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::5d98:e1f4:aa72:16b4]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::5d98:e1f4:aa72:16b4%4]) with mapi id 15.20.2178.023; Fri, 30 Aug 2019 02:28:41 +0000 From: Peng Fan To: "sstabellini@kernel.org" , "linux@armlinux.org.uk" , "catalin.marinas@arm.com" , "will@kernel.org" , "robin.murphy@arm.com" Thread-Topic: [PATCH V2] arm: xen: mm: use __GPF_DMA32 for arm64 Thread-Index: AQHVXtqjidV/KwEkYkeguLx++Vlcnw== Date: Fri, 30 Aug 2019 02:28:41 +0000 Message-ID: <1567175255-1798-1-git-send-email-peng.fan@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK2PR02CA0187.apcprd02.prod.outlook.com (2603:1096:201:21::23) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3ee84b63-a69a-4742-4102-08d72cf1c5c2 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:AM0PR04MB6291; x-ms-traffictypediagnostic: AM0PR04MB6291: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:372; x-forefront-prvs: 0145758B1D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(346002)(39860400002)(136003)(396003)(366004)(189003)(199004)(8676002)(5660300002)(8936002)(186003)(81156014)(81166006)(99286004)(386003)(305945005)(6116002)(3846002)(7736002)(54906003)(256004)(14444005)(6506007)(102836004)(52116002)(64756008)(66446008)(71200400001)(71190400001)(66476007)(66556008)(66946007)(66066001)(486006)(50226002)(110136005)(86362001)(26005)(2201001)(6512007)(2906002)(316002)(36756003)(478600001)(6436002)(25786009)(6486002)(14454004)(4326008)(53936002)(44832011)(2501003)(2616005)(476003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB6291; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: duFuzaG8BXU1w9kvD1sB/VxKZd2tdZLi8Vpk11QXgy3x7NbdXAI431GwYvlY1Rps3uMl/T7+QOTSll4qkuaPRZ+/X7myFvNHUIo9vMv2aru0IcKb/QQHGEjCCl4M5gw+kjhw3Ws+vREUwn9lvE6Ms+dj79EhtcIgJVZZMXKbjwR6cCDfo/ai6R/A669U8956xXozSb+GVLUIWjpJCveB/BJfVBzKJi56DcQ7wKC8gGIWqEG022lMN8ZDc45Ky0D80vmzTu8ALM915n5xUXTUPHVbTteSKJBZJhSMOstVOnuiuhlOwGEI0OyxHdZ7rZqtIkjv1FQ2NsjeWycMJPqFwICtgXqlttnNGMsOGU5IWn2HN4k9WVe53mEDHy+nwjXsPrdFvbYFGB5h9qJzjDCaebIPgy8ku5ubGguXElyvwD4= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ee84b63-a69a-4742-4102-08d72cf1c5c2 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Aug 2019 02:28:41.5335 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: OhnWXYbjB7mW7NrJOCXPTqWe5Oc7ZC65iD3r3bd8OswenBirSpNZnTWLvGBK6ADNX7981PRV223XgyV/ZRcWPg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6291 Subject: [Xen-devel] [PATCH V2] arm: xen: mm: use __GPF_DMA32 for arm64 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: "xen-devel@lists.xenproject.org" , Peng Fan , dl-linux-imx , "linux-arm-kernel@lists.infradead.org" Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Peng Fan 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 --- 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 + +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 + +static inline void xen_set_gfp_dma(gfp_t *flags) +{ + *flags |= __GFP_DMA32; +}