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

um: Always set up AT_HWCAP and AT_PLATFORM

Historically the code to set up AT_HWCAP and AT_PLATFORM was only built
for 32bit x86 as it was intermingled with the vDSO passthrough code.

Now that vDSO passthrough has been removed, always pass through AT_HWCAP
and AT_PLATFORM.

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

authored by

Thomas Weißschuh and committed by
Johannes Berg
293f7143 117e796f

+11 -14
+1 -3
arch/um/os-Linux/Makefile
··· 6 6 # Don't instrument UML-specific code 7 7 KCOV_INSTRUMENT := n 8 8 9 - obj-y = execvp.o file.o helper.o irq.o main.o mem.o process.o \ 9 + obj-y = elf_aux.o execvp.o file.o helper.o irq.o main.o mem.o process.o \ 10 10 registers.o sigio.o signal.o start_up.o time.o tty.o \ 11 11 umid.o user_syms.o util.o skas/ 12 12 13 13 CFLAGS_signal.o += -Wframe-larger-than=4096 14 14 15 15 CFLAGS_main.o += -Wno-frame-larger-than 16 - 17 - obj-$(CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA) += elf_aux.o 18 16 19 17 obj-$(CONFIG_SMP) += smp.o 20 18
+6 -1
arch/um/os-Linux/elf_aux.c
··· 14 14 #include <elf_user.h> 15 15 #include <mem_user.h> 16 16 #include "internal.h" 17 + #include <linux/swab.h> 17 18 19 + #if __BITS_PER_LONG == 64 20 + typedef Elf64_auxv_t elf_auxv_t; 21 + #else 18 22 typedef Elf32_auxv_t elf_auxv_t; 23 + #endif 19 24 20 25 /* These are initialized very early in boot and never changed */ 21 26 char * elf_aux_platform; 22 - extern long elf_aux_hwcap; 27 + long elf_aux_hwcap; 23 28 24 29 __init void scan_elf_aux( char **envp) 25 30 {
-4
arch/um/os-Linux/main.c
··· 21 21 22 22 #define STACKSIZE (8 * 1024 * 1024) 23 23 24 - long elf_aux_hwcap; 25 - 26 24 static void __init set_stklim(void) 27 25 { 28 26 struct rlimit lim; ··· 147 149 install_fatal_handler(SIGINT); 148 150 install_fatal_handler(SIGTERM); 149 151 150 - #ifdef CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA 151 152 scan_elf_aux(envp); 152 - #endif 153 153 154 154 change_sig(SIGPIPE, 0); 155 155 ret = linux_main(argc, argv, envp);
-3
arch/x86/um/Kconfig
··· 34 34 config ARCH_HAS_SC_SIGNALS 35 35 def_bool !64BIT 36 36 37 - config ARCH_REUSE_HOST_VSYSCALL_AREA 38 - def_bool !64BIT 39 - 40 37 config GENERIC_HWEIGHT 41 38 def_bool y
+4 -3
arch/x86/um/asm/elf.h
··· 68 68 pr_reg[16] = PT_REGS_SS(regs); \ 69 69 } while (0); 70 70 71 - extern char * elf_aux_platform; 72 71 #define ELF_PLATFORM_FALLBACK "i586" 73 - #define ELF_PLATFORM (elf_aux_platform ?: ELF_PLATFORM_FALLBACK) 74 72 75 73 #else 76 74 ··· 149 151 (pr_reg)[25] = 0; \ 150 152 (pr_reg)[26] = 0; 151 153 152 - #define ELF_PLATFORM "x86_64" 154 + #define ELF_PLATFORM_FALLBACK "x86_64" 153 155 154 156 #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 155 157 struct linux_binprm; ··· 177 179 178 180 extern long elf_aux_hwcap; 179 181 #define ELF_HWCAP (elf_aux_hwcap) 182 + 183 + extern char *elf_aux_platform; 184 + #define ELF_PLATFORM (elf_aux_platform ?: ELF_PLATFORM_FALLBACK) 180 185 181 186 #define SET_PERSONALITY(ex) do {} while(0) 182 187