[PATCH] riscv: fix load_unaligned_zeropad() fixup for RV32

patchwork-bot+linux-riscv at kernel.org patchwork-bot+linux-riscv at kernel.org
Wed Oct 7 19:40:06 PDT 2026


Hello:

This patch was applied to riscv/linux.git (fixes)
by Paul Walmsley <pjw at kernel.org>:

On Mon,  7 Sep 2026 21:07:50 +0200 you wrote:
> The fixup for load_unaligned_zeropad() runs when REG_L crosses into an
> unmapped page. REG_L is lw on RV32 and ld on RV64, but the fixup assumes
> an 8-byte load: it rounds the address down to 8 bytes and derives the
> shift from three address bits.
> 
> On RV32, a load starting in the last three bytes of a mapped page selects
> the word four bytes earlier and shifts it by 40, 48, or 56 bits, more than
> the register width. The caller gets earlier bytes instead of the string
> tail followed by zeroes. This affects RV32 MMU kernels built with
> RISCV_EFFICIENT_UNALIGNED_ACCESS=y, which selects DCACHE_WORD_ACCESS
> and lets dcache name hashing and comparison and strscpy() use this
> path.
> 
> [...]

Here is the summary with links:
  - riscv: fix load_unaligned_zeropad() fixup for RV32
    https://git.kernel.org/riscv/c/d4f25b097e46

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html





More information about the linux-riscv mailing list