arch/riscv: add dual vdso creation logic and select vdso based on hwShadow stack instructions are taken from the Zimop ISA extension,which is mandated on RVA23. Any userspace with shadow stackins
arch/riscv: add dual vdso creation logic and select vdso based on hwShadow stack instructions are taken from the Zimop ISA extension,which is mandated on RVA23. Any userspace with shadow stackinstructions in it will fault on hardware that doesn't have supportfor Zimop. Thus, a shadow stack-enabled userspace can't be run onhardware that doesn't support Zimop.It's not known how Linux userspace providers will respond to this kindof binary fragmentation. In order to keep kernel portable acrossdifferent hardware, 'arch/riscv/kernel/vdso_cfi' is created which hasMakefile logic to compile 'arch/riscv/kernel/vdso' sources with CFIflags, and 'arch/riscv/kernel/vdso.c' is modified to select theappropriate vdso depending on whether the underlying CPU implementsthe Zimop extension. Since the offset of vdso symbols will change dueto having two different vdso binaries, there is added logic to includea new generated vdso offset header and dynamically select the offset(like for rt_sigreturn).Signed-off-by: Deepak Gupta <debug@rivosinc.com>Acked-by: Charles Mirabile <cmirabil@redhat.com>Tested-by: Andreas Korb <andreas.korb@aisec.fraunhofer.de> # QEMU, custom CVA6Tested-by: Valentin Haudiquet <valentin.haudiquet@canonical.com>Link: https://patch.msgid.link/20251112-v5_user_cfi_series-v23-24-b55691eacf4f@rivosinc.com[pjw@kernel.org: cleaned up patch description]Signed-off-by: Paul Walmsley <pjw@kernel.org>
show more ...