diff options
| author | Xi Ruoyao <[email protected]> | 2025-06-06 09:24:44 +0000 |
|---|---|---|
| committer | Palmer Dabbelt <[email protected]> | 2025-06-12 19:13:57 +0000 |
| commit | 2b9518684f8558cd61a7c608cc03a27822cf7b03 (patch) | |
| tree | 202541799c0991c1551b8ce071baa08b4d12a5bf /lib/crypto/mpi/mpi-cmp.c | |
| parent | riscv: vector: Fix context save/restore with xtheadvector (diff) | |
| download | kernel-2b9518684f8558cd61a7c608cc03a27822cf7b03.tar.gz kernel-2b9518684f8558cd61a7c608cc03a27822cf7b03.zip | |
RISC-V: vDSO: Correct inline assembly constraints in the getrandom syscall wrapper
As recently pointed out by Thomas, if a register is forced for two
different register variables, among them one is used as "+" (both input
and output) and another is only used as input, Clang would treat the
conflicting input parameters as undefined behaviour and optimize away
the argument assignment.
Instead use "=r" (only output) for the output parameter and "r" (only
input) for the input parameter.
While the example from the GCC documentation uses "0" for the input
parameter, this is not necessary as confirmed by the GCC developers and "r"
matches what the other architectures' vDSO implementations are using.
[ alex: Update log to match v2 (Thomas) ]
Link: https://lore.kernel.org/all/[email protected]/
Link: https://gcc.gnu.org/onlinedocs/gcc-15.1.0/gcc/Local-Register-Variables.html
Link: https://gcc.gnu.org/pipermail/gcc-help/2025-June/144266.html
Cc: Thomas Weißschuh <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Signed-off-by: Xi Ruoyao <[email protected]>
Reviewed-by: Thomas Weißschuh <[email protected]>
Fixes: ee0d03053e70 ("RISC-V: vDSO: Wire up getrandom() vDSO")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Ghiti <[email protected]>
Signed-off-by: Palmer Dabbelt <[email protected]>
Diffstat (limited to 'lib/crypto/mpi/mpi-cmp.c')
0 files changed, 0 insertions, 0 deletions
