riscv: uaccess: Allow the last potential unrolled copy
authorXiao Wang <xiao.w.wang@intel.com>
Wed, 13 Mar 2024 10:33:34 +0000 (18:33 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 22 May 2024 23:12:54 +0000 (16:12 -0700)
When the dst buffer pointer points to the last accessible aligned addr, we
could still run another iteration of unrolled copy.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20240313103334.4036554-1-xiao.w.wang@intel.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/lib/uaccess.S

index bc22c078aba81a8170506eddb8642d3353ac461c..64792a7ae72e8ae229f34b2d9bfd3e35dd137fc2 100644 (file)
@@ -103,7 +103,7 @@ SYM_FUNC_START(fallback_scalar_usercopy)
        fixup REG_S   t4,  7*SZREG(a0), 10f
        addi    a0, a0, 8*SZREG
        addi    a1, a1, 8*SZREG
-       bltu    a0, t0, 2b
+       bleu    a0, t0, 2b
 
        addi    t0, t0, 8*SZREG /* revert to original value */
        j       .Lbyte_copy_tail