From patchwork Mon Sep 16 09:51:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11146661 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 C4C171745 for ; Mon, 16 Sep 2019 09:53:38 +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 A0137206A4 for ; Mon, 16 Sep 2019 09:53:38 +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="oKdwZU3z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0137206A4 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 1i9nfX-0005oz-2E; Mon, 16 Sep 2019 09:51:39 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i9nfV-0005ou-N5 for xen-devel@lists.xenproject.org; Mon, 16 Sep 2019 09:51:37 +0000 X-Inumbo-ID: 91cb3452-d867-11e9-978d-bc764e2007e4 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:fe1e::61f]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 91cb3452-d867-11e9-978d-bc764e2007e4; Mon, 16 Sep 2019 09:51:35 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OrPJnOpTBkVylyJtRpsRntiLtvIWd3Cz9EfihoRQHLP2d/2kQr58nfSIr0F5THakU5GbLyAXdg7hUvQQHpYjiY/zVbXVRdEvoTp5hsKIQ2fTgu8XXyWNTlOuzwDav9FDKAXpR3X+Uirk+ViG4SvL7U8sZ1eyhKvHqobqOd9whBcCyTtHnwaLn52vBGW++jjl175IaUNSATeMLuuMmnT8GbbCFm5jXtkMYIjSioyHsCxmnnGRXRGXkGodBK2upJPkouRauy7o7M5z4qcCyuiIU1FYXh/HPC5l7zrjrWUObob/BdKXWz5OVklErWUzryUauhby3jA1XMy+W74Yf6MLeQ== 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-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=S8F5CzEJ/age1CHHHPqTMUHg6wLBT35cM6qcA/wKMQA=; b=oKdwZU3zDYX9Dy2TCF7VDy7nRB4A1mXtto4MzWFYRlsnKtWlA0iksceR/uvaxkjf+Va7BWRucsVUodAXCK+s2Eb4ltTCdIzVVR+g/EQSxEpXX6m6K3ROLHv4qJdWx4mTPRtINnXZW9lCoCdDGOYh/QohNFd3fB8P5EsYIA1pKow= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB5186.eurprd04.prod.outlook.com (20.176.215.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2263.14; Mon, 16 Sep 2019 09:51:34 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::6ca2:ec08:2b37:8ab8]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::6ca2:ec08:2b37:8ab8%6]) with mapi id 15.20.2263.023; Mon, 16 Sep 2019 09:51:34 +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 V3] arm: xen: mm: use __GPF_DMA32 for arm64 Thread-Index: AQHVbHRSaJ8nL5OcZUKnpAnuiJ+Vsw== Date: Mon, 16 Sep 2019 09:51:33 +0000 Message-ID: <1568627400-21335-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: HK2PR02CA0189.apcprd02.prod.outlook.com (2603:1096:201:21::25) 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: 0dde092f-4dc9-47c8-17f2-08d73a8b7522 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600167)(711020)(4605104)(1401327)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:AM0PR04MB5186; x-ms-traffictypediagnostic: AM0PR04MB5186:|AM0PR04MB5186: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:133; x-forefront-prvs: 0162ACCC24 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(366004)(376002)(39860400002)(136003)(396003)(199004)(189003)(7736002)(86362001)(25786009)(8676002)(54906003)(81166006)(26005)(2501003)(81156014)(8936002)(2906002)(102836004)(110136005)(6506007)(486006)(256004)(2201001)(53936002)(386003)(44832011)(6486002)(14444005)(14454004)(36756003)(50226002)(99286004)(305945005)(6436002)(66066001)(478600001)(71200400001)(5660300002)(71190400001)(4326008)(6512007)(6116002)(186003)(476003)(66476007)(66556008)(52116002)(2616005)(64756008)(66446008)(3846002)(66946007)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5186; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: GhFLTZUam2svVQUPfjTqJv8m65Dws5Irh+w2L39xjcuMTVdubiAYjtwT2WQKVVU8D2+kHmSaevnpE3jJc4lPnMoG8i3WKRx2Ow5tOeSRI47Q7qzoKGC1PZb5IsELH+tdaBRO9VKjLK6V9kIlHhZIlv7Hwmd/dJUEidO+ST8vyYQbyZ0ZQjonStJohxsxTDkos8R/yvg5Tl+s+P/Ctsn6vV9W5ydKWHYuT0Fgj6pYRxnumcc9IwGHLtz4VxZqqyeLoZU2KPzIQPzeLPiY5A9FfhUw+OzN5E+uVW71KavCG4WIOnBFhF6wDETw5HjSakweBONA2oAm8EjeCOFqptF4ZypqQqxWtKiGafebOAuR3RYlNcX3755D5BcDc7F/VLMI3fFhPKMAA3BSjXlG7fj7K4GmR5KDJFjUVLhL/OZfI/Q= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0dde092f-4dc9-47c8-17f2-08d73a8b7522 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Sep 2019 09:51:34.0156 (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: aZul6er8FMN9aOpYNr+i019whEoXmd9DgIzfC5geVUjcschdPUlhGkHT6jldF2wMNuybY6gTW7DCDBnUsUGWag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5186 Subject: [Xen-devel] [PATCH V3] 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 add a check if CONFIG_ZONE_DMA32 is enabled use __GFP_DMA32. Signed-off-by: Peng Fan Acked-by: Stefano Stabellini --- 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; } }