]> git.baikalelectronics.ru Git - kernel.git/commit
riscv: __asm_copy_to-from_user: Fix: fail on RV32
authorAkira Tsukamoto <akira.tsukamoto@gmail.com>
Tue, 20 Jul 2021 08:51:45 +0000 (17:51 +0900)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Sat, 24 Jul 2021 00:49:01 +0000 (17:49 -0700)
commitd32eab89e8ef1d9775c0af115c2f17ff6dd12ffc
treebea1759072fae25d84958e39380549875bdbc553
parent2a0103b311534f46695089b34f964825cf8b3781
riscv: __asm_copy_to-from_user: Fix: fail on RV32

Had a bug when converting bytes to bits when the cpu was rv32.

The a3 contains the number of bytes and multiple of 8
would be the bits. The LGREG is holding 2 for RV32 and 3 for
RV32, so to achieve multiple of 8 it must always be constant 3.
The 2 was mistakenly used for rv32.

Signed-off-by: Akira Tsukamoto <akira.tsukamoto@gmail.com>
Fixes: 014115b0f2e3 ("riscv: __asm_copy_to-from_user: Optimize unaligned memory access and pipeline stall")
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/lib/uaccess.S