Re: [PATCH] mm: remove kern_addr_valid() completely
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, linux-alpha@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-csky@xxxxxxxxxxxxxxx, linux-hexagon@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, loongarch@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, openrisc@xxxxxxxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-um@xxxxxxxxxxxxxxxxxxx, linux-xtensa@xxxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx
- Subject: Re: [PATCH] mm: remove kern_addr_valid() completely
- From: WANG Xuerui <kernel@xxxxxxxxxx>
- Date: Tue, 18 Oct 2022 17:20:19 +0800
- Cc: Richard Henderson <richard.henderson@xxxxxxxxxx>, Ivan Kokshaysky <ink@xxxxxxxxxxxxxxxxxxxx>, Matt Turner <mattst88@xxxxxxxxx>, Vineet Gupta <vgupta@xxxxxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, Will Deacon <will@xxxxxxxxxx>, Guo Ren <guoren@xxxxxxxxxx>, Huacai Chen <chenhuacai@xxxxxxxxxx>, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>, Greg Ungerer <gerg@xxxxxxxxxxxxxx>, Michal Simek <monstr@xxxxxxxxx>, Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>, Dinh Nguyen <dinguyen@xxxxxxxxxx>, Jonas Bonn <jonas@xxxxxxxxxxxx>, Stefan Kristiansson <stefan.kristiansson@xxxxxxxxxxxxx>, Stafford Horne <shorne@xxxxxxxxx>, "James E . J . Bottomley" <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>, Helge Deller <deller@xxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Nicholas Piggin <npiggin@xxxxxxxxx>, Christophe Leroy <christophe.leroy@xxxxxxxxxx>, Paul Walmsley <paul.walmsley@xxxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, Albert Ou <aou@xxxxxxxxxxxxxxxxx>, Heiko Carstens <hca@xxxxxxxxxxxxx>, Vasily Gorbik <gor@xxxxxxxxxxxxx>, Alexander Gordeev <agordeev@xxxxxxxxxxxxx>, Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>, Sven Schnelle <svens@xxxxxxxxxxxxx>, Yoshinori Sato <ysato@xxxxxxxxxxxxx>, Rich Felker <dalias@xxxxxxxx>, "David S . Miller" <davem@xxxxxxxxxxxxx>, Richard Weinberger <richard@xxxxxx>, Anton Ivanov <anton.ivanov@xxxxxxxxxxxxxxxxxx>, Johannes Berg <johannes@xxxxxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, x86@xxxxxxxxxx, "H . Peter Anvin" <hpa@xxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Chris Zankel <chris@xxxxxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>
- In-reply-to: <20221018074014.185687-1-wangkefeng.wang@huawei.com>
- References: <20221018074014.185687-1-wangkefeng.wang@huawei.com>
- User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:107.0) Gecko/20100101 Thunderbird/107.0a1
On 2022/10/18 15:40, Kefeng Wang wrote:
Most architectures(except arm64/x86/sparc) simply return 1 for
one space before the opening parens
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(),
minor grammatical nit:
"... which already checks whether the address is a valid kernel address.
So kern_addr_valid is unnecessary, let's remove it."
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 ----
arch/riscv/include/asm/pgtable.h | 2 -
arch/s390/include/asm/pgtable.h | 2 -
arch/sh/include/asm/pgtable.h | 2 -
arch/sparc/include/asm/pgtable_32.h | 6 ---
arch/sparc/mm/init_32.c | 3 +-
arch/sparc/mm/init_64.c | 1 -
arch/um/include/asm/pgtable.h | 2 -
arch/x86/include/asm/pgtable_32.h | 9 -----
arch/x86/include/asm/pgtable_64.h | 1 -
arch/x86/mm/init_64.c | 41 --------------------
arch/xtensa/include/asm/pgtable.h | 2 -
fs/proc/kcore.c | 26 +++++--------
31 files changed, 11 insertions(+), 210 deletions(-)
diff --git a/arch/loongarch/include/asm/pgtable.h b/arch/loongarch/include/asm/pgtable.h
index 946704bee599..fc70b7041b76 100644
--- a/arch/loongarch/include/asm/pgtable.h
+++ b/arch/loongarch/include/asm/pgtable.h
@@ -421,8 +421,6 @@ static inline void update_mmu_cache_pmd(struct vm_area_struct *vma,
__update_tlb(vma, address, (pte_t *)pmdp);
}
-#define kern_addr_valid(addr) (1)
-
static inline unsigned long pmd_pfn(pmd_t pmd)
{
return (pmd_val(pmd) & _PFN_MASK) >> _PFN_SHIFT;
Acked-by: WANG Xuerui <git@xxxxxxxxxx> # loongarch
Thanks!
--
WANG "xen0n" Xuerui
Linux/LoongArch mailing list: https://lore.kernel.org/loongarch/
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]