]> git.baikalelectronics.ru Git - kernel.git/commit
RISC-V: Add support for restartable sequence
authorVincent Chen <vincent.chen@sifive.com>
Tue, 8 Mar 2022 08:32:52 +0000 (16:32 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Tue, 22 Mar 2022 21:45:14 +0000 (14:45 -0700)
commitc7599954dcf3ed40d071913e29a107c34e9c90ff
treee723a4f00f052273f81a94723e0664443590f1d0
parent991a5e519c2aa1f4ed2bf6e2139997d7e7967cb3
RISC-V: Add support for restartable sequence

Add calls to rseq_signal_deliver() and rseq_syscall() to introduce RSEQ
support.

1. Call the rseq_signal_deliver() function to fixup on the pre-signal
   frame when a signal is delivered on top of a restartable sequence
   critical section.

2. Check that system calls are not invoked from within rseq critical
   sections by invoking rseq_signal() from ret_from_syscall(). With
   CONFIG_DEBUG_RSEQ, such behavior results in termination of the
   process with SIGSEGV.

Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/Kconfig
arch/riscv/kernel/entry.S
arch/riscv/kernel/signal.c