From patchwork Fri Jun 2 07:34:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 102340 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp849622vqr; Fri, 2 Jun 2023 00:25:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6qyTM2Q5eCsBOlOt9R38zzQu2BklgfMQbytRsSxkehdQui+O0jsZW+5ssVEF48G7VJ+8BP X-Received: by 2002:a17:90a:ce8f:b0:253:510e:130a with SMTP id g15-20020a17090ace8f00b00253510e130amr1552256pju.19.1685690707259; Fri, 02 Jun 2023 00:25:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685690707; cv=none; d=google.com; s=arc-20160816; b=n9Xk8KjRYTcukasxfVUkGeTKbTzyjkj6glqWdvfmFlNepsix4nsJHp+xBj9ynH2vGB uMOB+GwHPxW5M8hNdBZFUtqoUXyaEREE6sCU6yzidEEaZGjXM0yFoCtdLVEQaDxtCoAT Dk74tEPLXv7p+071zm8A1I7F8OoawT3+n8ACh2Ncp2T071cov/mJM9wZWAsZjs03izwU 7cE9Ij+McodcPhsJttyWFlXh3s63/0hXz8qlshfhadR2OuLtaAeeMiJt5uvh3YOJfxkA nzFKdOzy7nj5PmBGElKEvX4vDhXDRlo5eEPoDh0rJf3X+pUvJ9yvtvz+4RzfIBG9TTu+ pX/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=MSC9L74MehK7OOPuh1v55ass/ezVlrxG41k0UO8ioDc=; b=nIXkXZoDw0sNp/uryIW1dijzjArEwoU1h93XLVpTFm9QKCaei4kWWlYeqU6cMj96YW lYcoY25LGMV/iegPROQXA5FlBbk5qwf0uKwKxOyANrqBWCCmY5oXgCb0+Cc4trHi4GXC iAsmZ1p5NjIDHEGc0Ncu4fjTbrgW38hM1lq4fas6/wuKYiY3p9ewvHQgZUafKE9pQo5Y pGzNzrvorVpwZ+G+7L09t47/9ySLCkdbStE13NqbK+mXOW5kcsmEpKmnXSC8qCtmUKU0 s9Rv63lOD5x7MtR7K8fjSJSPCam2HJ2Zha5V0acpUo2f5TkpyOWCCpnMqw//AXzx03vr 5XrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 190-20020a6300c7000000b0053fc757bb04si560252pga.545.2023.06.02.00.24.55; Fri, 02 Jun 2023 00:25:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234143AbjFBHTT (ORCPT + 99 others); Fri, 2 Jun 2023 03:19:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233609AbjFBHTR (ORCPT ); Fri, 2 Jun 2023 03:19:17 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 530E1C0 for ; Fri, 2 Jun 2023 00:19:15 -0700 (PDT) Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4QXZ4n00bcz18LsP; Fri, 2 Jun 2023 15:14:32 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 2 Jun 2023 15:19:13 +0800 From: Kefeng Wang To: Catalin Marinas , Will Deacon , CC: , , , Kefeng Wang Subject: [PATCH] arm64: mm: move _PAGE_IOREMAP into pgtable-prot.h Date: Fri, 2 Jun 2023 15:34:45 +0800 Message-ID: <20230602073445.150273-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767574818988342236?= X-GMAIL-MSGID: =?utf-8?q?1767574818988342236?= Szőke Kálmán Benjamin reported to me a build issue on an out-of-tree module(from Xilinx[1]), which directly include , "undefined reference" error for _PAGE_IOREMAP In general, the module shouldn't include the low-level header file, it should be fixed, but _PAGE_IOREMAP definination is kind of pgtable prot, let's move it into pgtable-prot.h to put togethor with other prot. [1] https://github.com/Xilinx/XilinxVirtualCable/blob/master/zynqMP/src/driver/xvc_driver.c Signed-off-by: Kefeng Wang --- arch/arm64/include/asm/io.h | 2 -- arch/arm64/include/asm/pgtable-prot.h | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h index 877495a0fd0c..0b0b12a95051 100644 --- a/arch/arm64/include/asm/io.h +++ b/arch/arm64/include/asm/io.h @@ -142,8 +142,6 @@ extern void __memset_io(volatile void __iomem *, int, size_t); bool ioremap_allowed(phys_addr_t phys_addr, size_t size, unsigned long prot); #define ioremap_allowed ioremap_allowed -#define _PAGE_IOREMAP PROT_DEVICE_nGnRE - #define ioremap_wc(addr, size) \ ioremap_prot((addr), (size), PROT_NORMAL_NC) #define ioremap_np(addr, size) \ diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/include/asm/pgtable-prot.h index 9b165117a454..f79afbad26a0 100644 --- a/arch/arm64/include/asm/pgtable-prot.h +++ b/arch/arm64/include/asm/pgtable-prot.h @@ -64,6 +64,7 @@ extern bool arm64_use_ng_mappings; #define PROT_SECT_NORMAL_EXEC (PROT_SECT_DEFAULT | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL)) #define _PAGE_DEFAULT (_PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL)) +#define _PAGE_IOREMAP PROT_DEVICE_nGnRE #define PAGE_KERNEL __pgprot(PROT_NORMAL) #define PAGE_KERNEL_RO __pgprot((PROT_NORMAL & ~PTE_WRITE) | PTE_RDONLY)