Revert "riscv: misaligned: fix sleeping function called during misaligned access...
authorNam Cao <namcao@linutronix.de>
Fri, 20 Jun 2025 11:09:39 +0000 (13:09 +0200)
committerPalmer Dabbelt <palmer@dabbelt.com>
Mon, 23 Jun 2025 22:38:09 +0000 (15:38 -0700)
commit2f73c62d4e13df67380ff6faca39eec2bf08dd93
tree74326bdb91466f49859c16e9c6699a6dbae63787
parent850f0e2433cdd38f36d80a4c1ab59f82029bef74
Revert "riscv: misaligned: fix sleeping function called during misaligned access handling"

This reverts commit 61a74ad25462 ("riscv: misaligned: fix sleeping function
called during misaligned access handling"). The commit addresses a sleeping
in atomic context problem, but it is not the correct fix as explained by
Clément:

"Using nofault would lead to failure to read from user memory that is paged
out for instance. This is not really acceptable, we should handle user
misaligned access even at an address that would generate a page fault."

This bug has been properly fixed by commit 453805f0a28f ("riscv:
misaligned: enable IRQs while handling misaligned accesses").

Revert this improper fix.

Link: https://lore.kernel.org/linux-riscv/b779beed-e44e-4a5e-9551-4647682b0d21@rivosinc.com/
Signed-off-by: Nam Cao <namcao@linutronix.de>
Cc: stable@vger.kernel.org
Reviewed-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Fixes: 61a74ad25462 ("riscv: misaligned: fix sleeping function called during misaligned access handling")
Link: https://lore.kernel.org/r/20250620110939.1642735-1-namcao@linutronix.de
Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
arch/riscv/kernel/traps_misaligned.c