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: 13264780 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 29FF7C7EE29 for ; Fri, 2 Jun 2023 07:20:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=7Jqby/eA19ik2rjWM4rHNjYWvXKvOYlFOwGqpMxLVck=; b=mU4En8A73R06g1 34sqtL6JXsirEy2HagTJ/yvkAIGlc3SmmhFSgWfvoBXzhhrZEc0MO4q7YSeCW9kfA0E5nHSlZqYX9 5R9lAOYkxQeQ03xLR70ZesdNM9Yil1eWu9FJ1BlJ5w8wz1tc9NoIvghNtorm6PskaT6T/Ubr76lk1 i8REwbRWiGvUTrtAYFSto5k+bDeccDPwrf7R+VXirNES0na2H006+Clira37Rc21aiawAGQUMXz5w qjCOPL2blmVXW1+dETJdB473j5HnKuAinCGP0sdpsHVs9uSM8IseZCA1GGTIn+eA1RzfqZHFze5Q1 lYagJM87eZvQBoDAbl0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q4z4M-005zlq-00; Fri, 02 Jun 2023 07:19:30 +0000 Received: from szxga08-in.huawei.com ([45.249.212.255]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q4z4I-005zkD-0u for linux-arm-kernel@lists.infradead.org; Fri, 02 Jun 2023 07:19:28 +0000 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230602_001926_525777_0A80CD1D X-CRM114-Status: GOOD ( 10.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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)