Skip to content

Commit 293f714

Browse files
t-8chjmberg-intel
authored andcommitted
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>
1 parent 117e796 commit 293f714

5 files changed

Lines changed: 11 additions & 14 deletions

File tree

arch/um/os-Linux/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@
66
# Don't instrument UML-specific code
77
KCOV_INSTRUMENT := n
88

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 \
1010
registers.o sigio.o signal.o start_up.o time.o tty.o \
1111
umid.o user_syms.o util.o skas/
1212

1313
CFLAGS_signal.o += -Wframe-larger-than=4096
1414

1515
CFLAGS_main.o += -Wno-frame-larger-than
1616

17-
obj-$(CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA) += elf_aux.o
18-
1917
obj-$(CONFIG_SMP) += smp.o
2018

2119
USER_OBJS := $(user-objs-y) elf_aux.o execvp.o file.o helper.o irq.o \

arch/um/os-Linux/elf_aux.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@
1414
#include <elf_user.h>
1515
#include <mem_user.h>
1616
#include "internal.h"
17+
#include <linux/swab.h>
1718

19+
#if __BITS_PER_LONG == 64
20+
typedef Elf64_auxv_t elf_auxv_t;
21+
#else
1822
typedef Elf32_auxv_t elf_auxv_t;
23+
#endif
1924

2025
/* These are initialized very early in boot and never changed */
2126
char * elf_aux_platform;
22-
extern long elf_aux_hwcap;
27+
long elf_aux_hwcap;
2328

2429
__init void scan_elf_aux( char **envp)
2530
{

arch/um/os-Linux/main.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
#define STACKSIZE (8 * 1024 * 1024)
2323

24-
long elf_aux_hwcap;
25-
2624
static void __init set_stklim(void)
2725
{
2826
struct rlimit lim;
@@ -149,9 +147,7 @@ int __init main(int argc, char **argv, char **envp)
149147
install_fatal_handler(SIGINT);
150148
install_fatal_handler(SIGTERM);
151149

152-
#ifdef CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA
153150
scan_elf_aux(envp);
154-
#endif
155151

156152
change_sig(SIGPIPE, 0);
157153
ret = linux_main(argc, argv, envp);

arch/x86/um/Kconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,5 @@ config X86_64
3434
config ARCH_HAS_SC_SIGNALS
3535
def_bool !64BIT
3636

37-
config ARCH_REUSE_HOST_VSYSCALL_AREA
38-
def_bool !64BIT
39-
4037
config GENERIC_HWEIGHT
4138
def_bool y

arch/x86/um/asm/elf.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@
6868
pr_reg[16] = PT_REGS_SS(regs); \
6969
} while (0);
7070

71-
extern char * elf_aux_platform;
7271
#define ELF_PLATFORM_FALLBACK "i586"
73-
#define ELF_PLATFORM (elf_aux_platform ?: ELF_PLATFORM_FALLBACK)
7472

7573
#else
7674

@@ -151,7 +149,7 @@ extern char * elf_aux_platform;
151149
(pr_reg)[25] = 0; \
152150
(pr_reg)[26] = 0;
153151

154-
#define ELF_PLATFORM "x86_64"
152+
#define ELF_PLATFORM_FALLBACK "x86_64"
155153

156154
#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
157155
struct linux_binprm;
@@ -180,6 +178,9 @@ struct task_struct;
180178
extern long elf_aux_hwcap;
181179
#define ELF_HWCAP (elf_aux_hwcap)
182180

181+
extern char *elf_aux_platform;
182+
#define ELF_PLATFORM (elf_aux_platform ?: ELF_PLATFORM_FALLBACK)
183+
183184
#define SET_PERSONALITY(ex) do {} while(0)
184185

185186
#endif

0 commit comments

Comments
 (0)