From: Feng Lee <379943137@qq.com> Date: Fri, 9 May 2025 06:32:30 +0000 (+0800) Subject: mm: remove obsolete pgd_offset_gate() X-Git-Tag: v6.16-rc1~92^2~53 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0cad6736f4b9bbe8129f367ed5818fa4aef6c2b5;p=thirdparty%2Fkernel%2Flinux.git mm: remove obsolete pgd_offset_gate() Remove pgd_offset_gate() completely and simply make the single caller use pgd_offset(). It appears that the gate area resides in the kernel-mapped segment exclusively on IA64. Therefore, removing pgd_offset_k is safe since IA64 is now obsolete. Link: https://lkml.kernel.org/r/tencent_503130C3CD56569191396268CF4D12F09A06@qq.com Signed-off-by: Feng Lee <379943137@qq.com> Reviewed-by: Barry Song Acked-by: David Hildenbrand Cc: Anshuman Khandual Cc: bibo mao Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: John Hubbard Cc: Lance Yang Cc: Peter Xu Signed-off-by: Andrew Morton --- diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index b50447ef1c921..f1e890b604609 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -1164,10 +1164,6 @@ static inline void arch_swap_restore(swp_entry_t entry, struct folio *folio) } #endif -#ifndef __HAVE_ARCH_PGD_OFFSET_GATE -#define pgd_offset_gate(mm, addr) pgd_offset(mm, addr) -#endif - #ifndef __HAVE_ARCH_MOVE_PTE #define move_pte(pte, old_addr, new_addr) (pte) #endif diff --git a/mm/gup.c b/mm/gup.c index d3aac58862c04..329c5f7acc7a0 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1102,10 +1102,7 @@ static int get_gate_page(struct mm_struct *mm, unsigned long address, /* user gate pages are read-only */ if (gup_flags & FOLL_WRITE) return -EFAULT; - if (address > TASK_SIZE) - pgd = pgd_offset_k(address); - else - pgd = pgd_offset_gate(mm, address); + pgd = pgd_offset(mm, address); if (pgd_none(*pgd)) return -EFAULT; p4d = p4d_offset(pgd, address);