mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 01:13:11 +00:00
User mode tasks compiled with Zicfilp may call indirectly into the vdso (like hwprobe indirect calls). Add support for compiling landing pads into the vdso. Landing pad instructions in the vdso will be no-ops for tasks which have not enabled landing pads. Furthermore, add support for the C sources of the vdso to be compiled with shadow stack and landing pads enabled as well. Landing pad and shadow stack instructions are emitted only when the VDSO_CFI cflags option is defined during compile. Signed-off-by: Jim Shu <[email protected]> Reviewed-by: Zong Li <[email protected]> Signed-off-by: Deepak Gupta <[email protected]> Tested-by: Andreas Korb <[email protected]> # QEMU, custom CVA6 Tested-by: Valentin Haudiquet <[email protected]> Link: https://patch.msgid.link/[email protected] [[email protected]: cleaned up patch description, issues reported by checkpatch] Signed-off-by: Paul Walmsley <[email protected]>
23 lines
431 B
ArmAsm
23 lines
431 B
ArmAsm
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (C) 2017 SiFive
|
|
*/
|
|
|
|
#include <linux/linkage.h>
|
|
#include <asm/unistd.h>
|
|
#include <asm/assembler.h>
|
|
|
|
.text
|
|
/* int __vdso_getcpu(unsigned *cpu, unsigned *node, void *unused); */
|
|
SYM_FUNC_START(__vdso_getcpu)
|
|
.cfi_startproc
|
|
vdso_lpad
|
|
/* For now, just do the syscall. */
|
|
li a7, __NR_getcpu
|
|
ecall
|
|
ret
|
|
.cfi_endproc
|
|
SYM_FUNC_END(__vdso_getcpu)
|
|
|
|
emit_riscv_feature_1_and
|