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

Configure Feed

Select the types of activity you want to include in your feed.

um: vdso: Remove getcpu support on x86

We are going to support SMP on UML/x86, so we can't hard code
the CPU and NUMA node in __vdso_getcpu() anymore. Let's just
remove it and let applications fall back to the syscall.

Suggested-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Link: https://patch.msgid.link/20251027001815.1666872-7-tiwei.bie@linux.dev
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Tiwei Bie and committed by
Johannes Berg
37f847b7 1e4ee513

-24
-22
arch/x86/um/vdso/um_vdso.c
··· 11 11 12 12 #include <vdso/gettime.h> 13 13 #include <linux/time.h> 14 - #include <linux/getcpu.h> 15 14 #include <asm/unistd.h> 16 - 17 - /* workaround for -Wmissing-prototypes warnings */ 18 - long __vdso_getcpu(unsigned int *cpu, unsigned int *node, struct getcpu_cache *unused); 19 15 20 16 int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts) 21 17 { ··· 52 56 return secs; 53 57 } 54 58 __kernel_old_time_t time(__kernel_old_time_t *t) __attribute__((weak, alias("__vdso_time"))); 55 - 56 - long 57 - __vdso_getcpu(unsigned int *cpu, unsigned int *node, struct getcpu_cache *unused) 58 - { 59 - /* 60 - * UML does not support SMP, we can cheat here. :) 61 - */ 62 - 63 - if (cpu) 64 - *cpu = 0; 65 - if (node) 66 - *node = 0; 67 - 68 - return 0; 69 - } 70 - 71 - long getcpu(unsigned int *cpu, unsigned int *node, struct getcpu_cache *tcache) 72 - __attribute__((weak, alias("__vdso_getcpu")));
-2
arch/x86/um/vdso/vdso.lds.S
··· 22 22 __vdso_clock_gettime; 23 23 gettimeofday; 24 24 __vdso_gettimeofday; 25 - getcpu; 26 - __vdso_getcpu; 27 25 time; 28 26 __vdso_time; 29 27 local: *;