diff options
| author | Thomas Weißschuh <thomas.weissschuh@linutronix.de> | 2026-08-07 19:24:33 -0600 |
|---|---|---|
| committer | Paul Walmsley <pjw@kernel.org> | 2026-08-07 19:24:33 -0600 |
| commit | 7f2a7bbcd992735a8ef0b042d8ce36cb5f7698ce (patch) | |
| tree | 813ffb3265cb76acb5c1151602b935dc899cfa2d | |
| parent | f61959a3a8b5522eb43cf71f293e091417bbf11c (diff) | |
riscv: vdso: Add symbols for the alternative section boundaries
Currently the alternative sections are extracted from the vDSO
binaries at runtime. This has runtime overhead and also doesn't
work for the compat vDSO.
Extract the offsets of the alternative section during the build with the
existing symbol extraction machinery.
Also add dummy symbols as fallback.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Nam Cao <namcao@linutronix.de>
Link: https://patch.msgid.link/20260630-riscv-vdso32-alternative-v1-1-a32fd89b7b1c@linutronix.de
Signed-off-by: Paul Walmsley <pjw@kernel.org>
| -rw-r--r-- | arch/riscv/include/asm/vdso.h | 6 | ||||
| -rw-r--r-- | arch/riscv/kernel/vdso/vdso.lds.S | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/vdso.h b/arch/riscv/include/asm/vdso.h index f7998d9ad9b2..0259bbc98e93 100644 --- a/arch/riscv/include/asm/vdso.h +++ b/arch/riscv/include/asm/vdso.h @@ -19,10 +19,14 @@ #ifdef CONFIG_MMU #include <generated/vdso-offsets.h> +#else +extern size_t __vdso_alternatives_start_offset, __vdso_alternatives_end_offset; #endif #ifdef CONFIG_RISCV_USER_CFI #include <generated/vdso-cfi-offsets.h> +#else +extern size_t __vdso_alternatives_start_cfi_offset, __vdso_alternatives_end_cfi_offset; #endif #ifdef CONFIG_RISCV_USER_CFI @@ -41,6 +45,8 @@ #define COMPAT_VDSO_SYMBOL(base, name) \ (void __user *)((unsigned long)(base) + compat__vdso_##name##_offset) +#else +extern size_t compat__vdso_alternatives_start_offset, compat__vdso_alternatives_end_offset; #endif /* CONFIG_COMPAT */ extern char vdso_start[], vdso_end[]; diff --git a/arch/riscv/kernel/vdso/vdso.lds.S b/arch/riscv/kernel/vdso/vdso.lds.S index c29ef12a63bb..5e9424df932b 100644 --- a/arch/riscv/kernel/vdso/vdso.lds.S +++ b/arch/riscv/kernel/vdso/vdso.lds.S @@ -45,9 +45,11 @@ SECTIONS .text : { *(.text .text.*) } :text . = ALIGN(4); + __vdso_alternatives_start = .; .alternative : { *(.alternative) } + __vdso_alternatives_end = .; } /* |
