Re: [PATCH] mm: remove kern_addr_valid() completely
From: Michael Ellerman
Date: Tue Oct 18 2022 - 05:46:07 EST
Kefeng Wang <wangkefeng.wang@xxxxxxxxxx> writes:
> Most architectures(except arm64/x86/sparc) simply return 1 for
> kern_addr_valid(), which is only used in read_kcore(), and it
> calls copy_from_kernel_nofault() which could check whether the
> address is a valid kernel address, so no need kern_addr_valid(),
> let's remove unneeded kern_addr_valid() completely.
>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>
> ---
> arch/alpha/include/asm/pgtable.h | 2 -
> arch/arc/include/asm/pgtable-bits-arcv2.h | 2 -
> arch/arm/include/asm/pgtable-nommu.h | 2 -
> arch/arm/include/asm/pgtable.h | 4 --
> arch/arm64/include/asm/pgtable.h | 2 -
> arch/arm64/mm/mmu.c | 47 -----------------------
> arch/arm64/mm/pageattr.c | 3 +-
> arch/csky/include/asm/pgtable.h | 3 --
> arch/hexagon/include/asm/page.h | 7 ----
> arch/ia64/include/asm/pgtable.h | 16 --------
> arch/loongarch/include/asm/pgtable.h | 2 -
> arch/m68k/include/asm/pgtable_mm.h | 2 -
> arch/m68k/include/asm/pgtable_no.h | 1 -
> arch/microblaze/include/asm/pgtable.h | 3 --
> arch/mips/include/asm/pgtable.h | 2 -
> arch/nios2/include/asm/pgtable.h | 2 -
> arch/openrisc/include/asm/pgtable.h | 2 -
> arch/parisc/include/asm/pgtable.h | 15 --------
> arch/powerpc/include/asm/pgtable.h | 7 ----
Acked-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx> (powerpc)
cheers