Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <baohua@kernel.org>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: bibo mao <maobibo@loongson.cn>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Peter Xu <peterx@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Feng Lee and committed by
Andrew Morton
0cad6736 3c06ee7c

+1 -8
-4
include/linux/pgtable.h
··· 1164 1164 } 1165 1165 #endif 1166 1166 1167 - #ifndef __HAVE_ARCH_PGD_OFFSET_GATE 1168 - #define pgd_offset_gate(mm, addr) pgd_offset(mm, addr) 1169 - #endif 1170 - 1171 1167 #ifndef __HAVE_ARCH_MOVE_PTE 1172 1168 #define move_pte(pte, old_addr, new_addr) (pte) 1173 1169 #endif
+1 -4
mm/gup.c
··· 1102 1102 /* user gate pages are read-only */ 1103 1103 if (gup_flags & FOLL_WRITE) 1104 1104 return -EFAULT; 1105 - if (address > TASK_SIZE) 1106 - pgd = pgd_offset_k(address); 1107 - else 1108 - pgd = pgd_offset_gate(mm, address); 1105 + pgd = pgd_offset(mm, address); 1109 1106 if (pgd_none(*pgd)) 1110 1107 return -EFAULT; 1111 1108 p4d = p4d_offset(pgd, address);