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

x86/um: Drop gate area handling

With the removal of the vDSO passthrough from the host,
FIXADDR_USER_START is always 0 and the gate area setup code is dead.

Remove it.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://patch.msgid.link/20251028-uml-remove-32bit-pseudo-vdso-v1-5-e930063eff5f@weissschuh.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Thomas Weißschuh and committed by
Johannes Berg
dbd7cf40 70d52694

+2 -56
-4
arch/um/include/asm/page.h
··· 96 96 97 97 #endif /* __ASSEMBLER__ */ 98 98 99 - #ifdef CONFIG_X86_32 100 - #define __HAVE_ARCH_GATE_AREA 1 101 - #endif 102 - 103 99 #endif /* __UM_PAGE_H */
+2 -2
arch/x86/um/Makefile
··· 13 13 ptrace.o ptrace_$(BITS).o ptrace_user.o setjmp_$(BITS).o signal.o \ 14 14 stub_segv.o \ 15 15 sys_call_table_$(BITS).o sysrq_$(BITS).o tls_$(BITS).o \ 16 - mem_$(BITS).o subarch.o os-Linux/ 16 + subarch.o os-Linux/ 17 17 18 18 ifeq ($(CONFIG_X86_32),y) 19 19 ··· 26 26 27 27 else 28 28 29 - obj-y += syscalls_64.o vdso/ 29 + obj-y += mem_64.o syscalls_64.o vdso/ 30 30 31 31 subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o \ 32 32 ../lib/memmove_64.o ../lib/memset_64.o
-50
arch/x86/um/mem_32.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * Copyright (C) 2011 Richard Weinberger <richrd@nod.at> 4 - */ 5 - 6 - #include <linux/mm.h> 7 - #include <asm/elf.h> 8 - 9 - static struct vm_area_struct gate_vma; 10 - 11 - static int __init gate_vma_init(void) 12 - { 13 - if (!FIXADDR_USER_START) 14 - return 0; 15 - 16 - vma_init(&gate_vma, NULL); 17 - gate_vma.vm_start = FIXADDR_USER_START; 18 - gate_vma.vm_end = FIXADDR_USER_END; 19 - vm_flags_init(&gate_vma, VM_READ | VM_MAYREAD | VM_EXEC | VM_MAYEXEC); 20 - gate_vma.vm_page_prot = PAGE_READONLY; 21 - 22 - return 0; 23 - } 24 - __initcall(gate_vma_init); 25 - 26 - struct vm_area_struct *get_gate_vma(struct mm_struct *mm) 27 - { 28 - return FIXADDR_USER_START ? &gate_vma : NULL; 29 - } 30 - 31 - int in_gate_area_no_mm(unsigned long addr) 32 - { 33 - if (!FIXADDR_USER_START) 34 - return 0; 35 - 36 - if ((addr >= FIXADDR_USER_START) && (addr < FIXADDR_USER_END)) 37 - return 1; 38 - 39 - return 0; 40 - } 41 - 42 - int in_gate_area(struct mm_struct *mm, unsigned long addr) 43 - { 44 - struct vm_area_struct *vma = get_gate_vma(mm); 45 - 46 - if (!vma) 47 - return 0; 48 - 49 - return (addr >= vma->vm_start) && (addr < vma->vm_end); 50 - }