From: Christoph Hellwig <hch@infradead.org>
To: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
linux-arm-kernel@lists.infradead.org, anshuman.khandual@arm.com,
egyszeregy@freemail.hu, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: mm: move _PAGE_IOREMAP into pgtable-prot.h
Date: Mon, 5 Jun 2023 07:08:47 -0700 [thread overview]
Message-ID: <ZH3sb1o8Q4lPFrU0@infradead.org> (raw)
In-Reply-To: <20230602073445.150273-1-wangkefeng.wang@huawei.com>
On Fri, Jun 02, 2023 at 03:34:45PM +0800, Kefeng Wang wrote:
> Szőke Kálmán Benjamin reported to me a build issue on an out-of-tree
> module(from Xilinx[1]), which directly include <asm-generic/io.h>,
Err. Not one should do that, and we certainly should not cater to such
crap.
NAK.
>
> "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 <wangkefeng.wang@huawei.com>
> ---
> 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)
> --
> 2.35.3
>
---end quoted text---
prev parent reply other threads:[~2023-06-05 14:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-02 7:34 Kefeng Wang
2023-06-05 14:08 ` Christoph Hellwig [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZH3sb1o8Q4lPFrU0@infradead.org \
--to=hch@infradead.org \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=egyszeregy@freemail.hu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wangkefeng.wang@huawei.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®