|
|
Subscribe / Log in / New account

mm, arch: add generic implementation of pfn_valid() for FLATMEM

From:  Mike Rapoport <rppt-AT-kernel.org>
To:  Andrew Morton <akpm-AT-linux-foundation.org>
Subject:  [PATCH v2 0/4] mm, arch: add generic implementation of pfn_valid() for FLATMEM
Date:  Sun, 29 Jan 2023 14:42:31 +0200
Message-ID:  <20230129124235.209895-1-rppt@kernel.org>
Cc:  Arnd Bergmann <arnd-AT-arndb.de>, Brian Cain <bcain-AT-quicinc.com>, "David S. Miller" <davem-AT-davemloft.net>, Dinh Nguyen <dinguyen-AT-kernel.org>, Geert Uytterhoeven <geert-AT-linux-m68k.org>, Greg Ungerer <gerg-AT-linux-m68k.org>, Guo Ren <guoren-AT-kernel.org>, Helge Deller <deller-AT-gmx.de>, Huacai Chen <chenhuacai-AT-kernel.org>, Matt Turner <mattst88-AT-gmail.com>, Max Filippov <jcmvbkbc-AT-gmail.com>, Michael Ellerman <mpe-AT-ellerman.id.au>, Michal Simek <monstr-AT-monstr.eu>, Palmer Dabbelt <palmer-AT-dabbelt.com>, Rich Felker <dalias-AT-libc.org>, Richard Weinberger <richard-AT-nod.at>, Russell King <linux-AT-armlinux.org.uk>, Stafford Horne <shorne-AT-gmail.com>, Thomas Bogendoerfer <tsbogend-AT-alpha.franken.de>, Vineet Gupta <vgupta-AT-kernel.org>, WANG Xuerui <kernel-AT-xen0n.name>, Yoshinori Sato <ysato-AT-users.sourceforge.jp>, linux-alpha-AT-vger.kernel.org, linux-arch-AT-vger.kernel.org, linux-arm-kernel-AT-lists.infradead.org, linux-csky-AT-vger.kernel.org, linux-hexagon-AT-vger.kernel.org, linux-ia64-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, linux-m68k-AT-lists.linux-m68k.org, linux-mips-AT-vger.kernel.org, linux-mm-AT-kvack.org, linux-parisc-AT-vger.kernel.org, linux-riscv-AT-lists.infradead.org, linux-sh-AT-vger.kernel.org, linux-snps-arc-AT-lists.infradead.org, linux-um-AT-lists.infradead.org, linux-xtensa-AT-linux-xtensa.org, linuxppc-dev-AT-lists.ozlabs.org, loongarch-AT-lists.linux.dev, openrisc-AT-lists.librecores.org, sparclinux-AT-vger.kernel.org, x86-AT-kernel.org, "Mike Rapoport (IBM)" <rppt-AT-kernel.org>
Archive-link:  Article

From: "Mike Rapoport (IBM)" <rppt@kernel.org>

Hi,

Every architecture that supports FLATMEM memory model defines its own
version of pfn_valid() that essentially compares a pfn to max_mapnr.

Use mips/powerpc version implemented as static inline as a generic
implementation of pfn_valid() and drop its per-architecture definitions

v2:
* fix build on ARM and xtensa
* add Acked- and Reviewed-by, thanks everybody

v1: https://lore.kernel.org/all/20230125190757.22555-1-rppt@k...

Mike Rapoport (IBM) (4):
  arm: include asm-generic/memory_model.h from page.h rather than
    memory.h
  m68k: use asm-generic/memory_model.h for both MMU and !MMU
  mips: drop definition of pfn_valid() for DISCONTIGMEM
  mm, arch: add generic implementation of pfn_valid() for FLATMEM

 arch/alpha/include/asm/page.h      |  4 ----
 arch/arc/include/asm/page.h        |  1 -
 arch/arm/include/asm/memory.h      |  2 --
 arch/arm/include/asm/page.h        |  2 ++
 arch/csky/include/asm/page.h       |  1 -
 arch/hexagon/include/asm/page.h    |  1 -
 arch/ia64/include/asm/page.h       |  4 ----
 arch/loongarch/include/asm/page.h  | 13 -------------
 arch/m68k/include/asm/page.h       |  6 +-----
 arch/m68k/include/asm/page_mm.h    |  1 -
 arch/m68k/include/asm/page_no.h    |  4 ----
 arch/microblaze/include/asm/page.h |  1 -
 arch/mips/include/asm/page.h       | 28 ----------------------------
 arch/nios2/include/asm/page.h      |  9 ---------
 arch/openrisc/include/asm/page.h   |  2 --
 arch/parisc/include/asm/page.h     |  4 ----
 arch/powerpc/include/asm/page.h    |  9 ---------
 arch/riscv/include/asm/page.h      |  5 -----
 arch/sh/include/asm/page.h         |  3 ---
 arch/sparc/include/asm/page_32.h   |  1 -
 arch/um/include/asm/page.h         |  1 -
 arch/x86/include/asm/page_32.h     |  4 ----
 arch/x86/include/asm/page_64.h     |  4 ----
 arch/xtensa/include/asm/page.h     |  4 ++--
 include/asm-generic/memory_model.h | 12 ++++++++++++
 include/asm-generic/page.h         |  2 --
 26 files changed, 17 insertions(+), 111 deletions(-)


base-commit: 2241ab53cbb5cdb08a6b2d4688feb13971058f65
-- 
2.35.1



Copyright © 2023, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds