mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-07-30 16:26:33 +08:00
Merge cfcda0a095b8e2a17077a82110b4e6d47c437d4d into f4a1aceb8ca7198b11447d6e1885ce70feb2dcc6
This commit is contained in:
commit
08b8c063ec
8
ChangeLog.d/fix-tricore-muladdc-clobber.txt
Normal file
8
ChangeLog.d/fix-tricore-muladdc-clobber.txt
Normal file
@ -0,0 +1,8 @@
|
||||
Bugfix
|
||||
* Fix the TriCore MULADDC inline assembly in library/bn_mul.h which was
|
||||
missing register d5 (the high half of the e4 carry-in pair) from its
|
||||
clobber list. On TriCore 1.8 (AURIX TC4xx) the compiler could allocate
|
||||
a live value in d5 across the asm block, which the asm then overwrote,
|
||||
corrupting the carry chain. This produced wrong results in
|
||||
mbedtls_mpi_core_mla, making mbedtls_mpi_mod_mpi loop forever. Declare
|
||||
all data registers the asm writes so the compiler does not reuse them.
|
||||
@ -653,7 +653,8 @@
|
||||
"st.a %2, %%a2 \n\t" \
|
||||
: "=m" (c), "=m" (d), "=m" (s) \
|
||||
: "m" (s), "m" (d), "m" (c), "m" (b) \
|
||||
: "d0", "d1", "e2", "d4", "a2", "a3" \
|
||||
: "d0", "d1", "d2", "d3", "d4", "d5", \
|
||||
"a2", "a3" \
|
||||
);
|
||||
|
||||
#endif /* TriCore */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user