RISC-V: selftests: cbo: Ensure asm operands match constraints, take 2
authorAndrew Jones <ajones@ventanamicro.com>
Fri, 22 Mar 2024 13:47:28 +0000 (14:47 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Fri, 26 Apr 2024 17:21:56 +0000 (10:21 -0700)
commit49408400d683ae4f41e414dfcb615166cc93be5c
tree0207f9fcdcaafebd27c246aeb194d088b3351f73
parent9c49085d69ec8ca4eea254d0f426676232549f84
RISC-V: selftests: cbo: Ensure asm operands match constraints, take 2

Commit 0de65288d75f ("RISC-V: selftests: cbo: Ensure asm operands
match constraints") attempted to ensure MK_CBO() would always
provide to a compile-time constant when given a constant, but
cpu_to_le32() isn't necessarily going to do that. Switch to manually
shifting the bytes, when needed, to finally get this right.

Reported-by: Woodrow Shen <woodrow.shen@sifive.com>
Closes: https://lore.kernel.org/all/CABquHATcBTUwfLpd9sPObBgNobqQKEAZ2yxk+TWSpyO5xvpXpg@mail.gmail.com/
Fixes: a29e2a48afe3 ("RISC-V: selftests: Add CBO tests")
Fixes: 0de65288d75f ("RISC-V: selftests: cbo: Ensure asm operands match constraints")
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20240322134728.151255-2-ajones@ventanamicro.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
tools/testing/selftests/riscv/hwprobe/cbo.c
tools/testing/selftests/riscv/hwprobe/hwprobe.h