From: Christoph Hellwig <hch@lst.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-snps-arc@lists.infradead.org,
linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org,
linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev,
linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org,
linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org,
linux-s390@vger.kernel.org, linux-sh@vger.kernel.org,
sparclinux@vger.kernel.org, linux-um@lists.infradead.org,
linux-arch@vger.kernel.org
Subject: provide generic page_to_phys and phys_to_page implementations v2
Date: Mon, 14 Oct 2024 16:44:57 +0200 [thread overview]
Message-ID: <20241014144506.51754-1-hch@lst.de> (raw)
page_to_phys is duplicated by all architectures, and from some strange
reason placed in <asm/io.h> where it doesn't fit at all.
phys_to_page is only provided by a few architectures despite having a lot
of open coded users.
Provide generic versions in <asm-generic/memory_model.h> to make these
helpers more easily usable.
Changes since v1:
- use slightly less nested macros
- port a debug check from the old powerpc version to the generic code
Diffstat:
arch/alpha/include/asm/io.h | 1 -
arch/arc/include/asm/io.h | 3 ---
arch/arm/include/asm/memory.h | 6 ------
arch/arm64/include/asm/memory.h | 6 ------
arch/csky/include/asm/page.h | 3 ---
arch/hexagon/include/asm/page.h | 6 ------
arch/loongarch/include/asm/page.h | 3 ---
arch/m68k/include/asm/virtconvert.h | 3 ---
arch/microblaze/include/asm/page.h | 1 -
arch/mips/include/asm/io.h | 5 -----
arch/nios2/include/asm/io.h | 3 ---
arch/openrisc/include/asm/page.h | 2 --
arch/parisc/include/asm/page.h | 1 -
arch/powerpc/include/asm/io.h | 12 ------------
arch/riscv/include/asm/page.h | 3 ---
arch/s390/include/asm/page.h | 2 --
arch/sh/include/asm/page.h | 1 -
arch/sparc/include/asm/page.h | 2 --
arch/um/include/asm/pgtable.h | 2 --
arch/x86/include/asm/io.h | 5 -----
arch/xtensa/include/asm/page.h | 1 -
include/asm-generic/memory_model.h | 13 +++++++++++++
22 files changed, 13 insertions(+), 71 deletions(-)
next reply other threads:[~2024-10-14 14:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 14:44 Christoph Hellwig [this message]
2024-10-14 14:44 ` [PATCH 1/2] asm-generic: provide generic page_to_phys and phys_to_page implementations Christoph Hellwig
2024-10-14 14:44 ` [PATCH 2/2] asm-generic: add an optional pfn_valid check to pfn_valid Christoph Hellwig
2024-10-15 5:44 ` Thomas Huth
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=20241014144506.51754-1-hch@lst.de \
--to=hch@lst.de \
--cc=arnd@arndb.de \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-csky@vger.kernel.org \
--cc=linux-hexagon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-openrisc@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=linux-um@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=loongarch@lists.linux.dev \
--cc=sparclinux@vger.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;
as well as URLs for NNTP newsgroup(s).