Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit a29a9c2

Browse files
xhackerustcgregkh
authored andcommitted
riscv: avoid Imbalance in RAS
[ Upstream commit 8f1534e ] Inspired by[1], modify the code to remove the code of modifying ra to avoid imbalance RAS (return address stack) which may lead to incorret predictions on return. Link: https://lore.kernel.org/linux-riscv/[email protected]/ [1] Signed-off-by: Jisheng Zhang <[email protected]> Reviewed-by: Cyril Bur <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 50c4307 commit a29a9c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/riscv/kernel/entry.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ SYM_CODE_START(ret_from_fork)
219219
jalr s0
220220
1:
221221
move a0, sp /* pt_regs */
222-
la ra, ret_from_exception
223-
tail syscall_exit_to_user_mode
222+
call syscall_exit_to_user_mode
223+
j ret_from_exception
224224
SYM_CODE_END(ret_from_fork)
225225

226226
/*

0 commit comments

Comments
 (0)