
[ Upstream commit e025ab842ec35225b1a8e163d1f311beb9e38ce9 ] 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 as there is no need for kern_addr_valid(), let's remove it. Link: https://lkml.kernel.org/r/20221018074014.185687-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [m68k] Acked-by: Heiko Carstens <hca@linux.ibm.com> [s390] Acked-by: Christoph Hellwig <hch@lst.de> Acked-by: Helge Deller <deller@gmx.de> [parisc] Acked-by: Michael Ellerman <mpe@ellerman.id.au> [powerpc] Acked-by: Guo Ren <guoren@kernel.org> [csky] Acked-by: Catalin Marinas <catalin.marinas@arm.com> [arm64] Cc: Alexander Gordeev <agordeev@linux.ibm.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com> Cc: <aou@eecs.berkeley.edu> Cc: Borislav Petkov <bp@alien8.de> Cc: Christian Borntraeger <borntraeger@linux.ibm.com> Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: Chris Zankel <chris@zankel.net> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: David S. Miller <davem@davemloft.net> Cc: Dinh Nguyen <dinguyen@kernel.org> Cc: Greg Ungerer <gerg@linux-m68k.org> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Huacai Chen <chenhuacai@kernel.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: Jonas Bonn <jonas@southpole.se> Cc: Matt Turner <mattst88@gmail.com> Cc: Max Filippov <jcmvbkbc@gmail.com> Cc: Michal Simek <monstr@monstr.eu> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Palmer Dabbelt <palmer@rivosinc.com> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Richard Henderson <richard.henderson@linaro.org> Cc: Richard Weinberger <richard@nod.at> Cc: Rich Felker <dalias@libc.org> Cc: Russell King <linux@armlinux.org.uk> Cc: Stafford Horne <shorne@gmail.com> Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi> Cc: Sven Schnelle <svens@linux.ibm.com> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Vineet Gupta <vgupta@kernel.org> Cc: Will Deacon <will@kernel.org> Cc: Xuerui Wang <kernel@xen0n.name> Cc: Yoshinori Sato <ysato@users.osdn.me> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Stable-dep-of: 3d5854d75e31 ("fs/proc/kcore.c: allow translation of physical memory addresses") Signed-off-by: Sasha Levin <sashal@kernel.org>
90 lines
1.9 KiB
C
90 lines
1.9 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* arch/arm/include/asm/pgtable-nommu.h
|
|
*
|
|
* Copyright (C) 1995-2002 Russell King
|
|
* Copyright (C) 2004 Hyok S. Choi
|
|
*/
|
|
#ifndef _ASMARM_PGTABLE_NOMMU_H
|
|
#define _ASMARM_PGTABLE_NOMMU_H
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#include <linux/slab.h>
|
|
#include <asm/processor.h>
|
|
#include <asm/page.h>
|
|
|
|
/*
|
|
* Trivial page table functions.
|
|
*/
|
|
#define pgd_present(pgd) (1)
|
|
#define pgd_none(pgd) (0)
|
|
#define pgd_bad(pgd) (0)
|
|
#define pgd_clear(pgdp)
|
|
/*
|
|
* PMD_SHIFT determines the size of the area a second-level page table can map
|
|
* PGDIR_SHIFT determines what a third-level page table entry can map
|
|
*/
|
|
#define PGDIR_SHIFT 21
|
|
|
|
#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
|
|
#define PGDIR_MASK (~(PGDIR_SIZE-1))
|
|
/* FIXME */
|
|
|
|
#define PAGE_NONE __pgprot(0)
|
|
#define PAGE_SHARED __pgprot(0)
|
|
#define PAGE_COPY __pgprot(0)
|
|
#define PAGE_READONLY __pgprot(0)
|
|
#define PAGE_KERNEL __pgprot(0)
|
|
|
|
#define swapper_pg_dir ((pgd_t *) 0)
|
|
|
|
|
|
typedef pte_t *pte_addr_t;
|
|
|
|
/*
|
|
* Mark the prot value as uncacheable and unbufferable.
|
|
*/
|
|
#define pgprot_noncached(prot) (prot)
|
|
#define pgprot_writecombine(prot) (prot)
|
|
#define pgprot_device(prot) (prot)
|
|
|
|
|
|
/*
|
|
* These would be in other places but having them here reduces the diffs.
|
|
*/
|
|
extern unsigned int kobjsize(const void *objp);
|
|
|
|
/*
|
|
* All 32bit addresses are effectively valid for vmalloc...
|
|
* Sort of meaningless for non-VM targets.
|
|
*/
|
|
#define VMALLOC_START 0UL
|
|
#define VMALLOC_END 0xffffffffUL
|
|
|
|
#define FIRST_USER_ADDRESS 0UL
|
|
|
|
#else
|
|
|
|
/*
|
|
* dummy tlb and user structures.
|
|
*/
|
|
#define v3_tlb_fns (0)
|
|
#define v4_tlb_fns (0)
|
|
#define v4wb_tlb_fns (0)
|
|
#define v4wbi_tlb_fns (0)
|
|
#define v6wbi_tlb_fns (0)
|
|
#define v7wbi_tlb_fns (0)
|
|
|
|
#define v3_user_fns (0)
|
|
#define v4_user_fns (0)
|
|
#define v4_mc_user_fns (0)
|
|
#define v4wb_user_fns (0)
|
|
#define v4wt_user_fns (0)
|
|
#define v6_user_fns (0)
|
|
#define xscale_mc_user_fns (0)
|
|
|
|
#endif /*__ASSEMBLY__*/
|
|
|
|
#endif /* _ASMARM_PGTABLE_H */
|