Skip to content

Commit 0cad673

Browse files
Feng Leeakpm00
authored andcommitted
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>
1 parent 3c06ee7 commit 0cad673

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

include/linux/pgtable.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,10 +1164,6 @@ static inline void arch_swap_restore(swp_entry_t entry, struct folio *folio)
11641164
}
11651165
#endif
11661166

1167-
#ifndef __HAVE_ARCH_PGD_OFFSET_GATE
1168-
#define pgd_offset_gate(mm, addr) pgd_offset(mm, addr)
1169-
#endif
1170-
11711167
#ifndef __HAVE_ARCH_MOVE_PTE
11721168
#define move_pte(pte, old_addr, new_addr) (pte)
11731169
#endif

mm/gup.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,10 +1102,7 @@ static int get_gate_page(struct mm_struct *mm, unsigned long address,
11021102
/* user gate pages are read-only */
11031103
if (gup_flags & FOLL_WRITE)
11041104
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);
11091106
if (pgd_none(*pgd))
11101107
return -EFAULT;
11111108
p4d = p4d_offset(pgd, address);

0 commit comments

Comments
 (0)