linux/tools/testing/selftests/riscv
Andrew Jones 0de65288d7
RISC-V: selftests: cbo: Ensure asm operands match constraints
The 'i' constraint expects a constant operand, which fn and its
constant derivative MK_CBO(fn) are, but passing fn through a function
as a parameter and using a local variable for MK_CBO(fn) allow the
compiler to lose sight of that when no optimization is done. Use
a macro instead of a function and skip the local variable to ensure
the compiler uses constants, matching the asm constraints.

Reported-by: Yunhui Cui <cuiyunhui@bytedance.com>
Closes: https://lore.kernel.org/all/20240117082514.42967-1-cuiyunhui@bytedance.com
Fixes: a29e2a48af ("RISC-V: selftests: Add CBO tests")
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20240117130933.57514-2-ajones@ventanamicro.com
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2024-01-17 17:46:55 -08:00
..
hwprobe RISC-V: selftests: cbo: Ensure asm operands match constraints 2024-01-17 17:46:55 -08:00
mm tools: selftests: riscv: Fix compile warnings in mm tests 2024-01-11 08:02:51 -08:00
vector Merge patch series "tools: selftests: riscv: Fix compiler warnings" 2024-01-11 08:02:55 -08:00
Makefile RISC-V Patches for the 6.6 Merge Window, Part 1 2023-09-01 08:09:48 -07:00