Commit 9850e73e authored by Xiao Wang's avatar Xiao Wang Committed by Palmer Dabbelt

riscv: uaccess: Relax the threshold for fast path

The bytes copy for unaligned head would cover at most SZREG-1 bytes, so
it's better to set the threshold as >= (SZREG-1 + word_copy stride size)
which equals to 9*SZREG-1.
Signed-off-by: default avatarXiao Wang <xiao.w.wang@intel.com>
Reviewed-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20240313091929.4029960-1-xiao.w.wang@intel.comSigned-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent f1905946
...@@ -44,7 +44,7 @@ SYM_FUNC_START(fallback_scalar_usercopy) ...@@ -44,7 +44,7 @@ SYM_FUNC_START(fallback_scalar_usercopy)
* Use byte copy only if too small. * Use byte copy only if too small.
* SZREG holds 4 for RV32 and 8 for RV64 * SZREG holds 4 for RV32 and 8 for RV64
*/ */
li a3, 9*SZREG /* size must be larger than size in word_copy */ li a3, 9*SZREG-1 /* size must >= (word_copy stride + SZREG-1) */
bltu a2, a3, .Lbyte_copy_tail bltu a2, a3, .Lbyte_copy_tail
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment