Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport 2.x: Fix aarch64 assembly for bignum multiplication #4978

Conversation

davidhorstmann-arm
Copy link
Contributor

@davidhorstmann-arm davidhorstmann-arm commented Sep 24, 2021

Backport of #4968. Fixes #4962

Add missing memory constraint in aarch64 bignum multiplication code to remedy Clang 12+ issues. Fixes #4962.
Part of the larger super-issue #4943.

Tested with the following steps:

mkdir build && cd build
CC=clang CFLAGS="--target=aarch64-linux-gnu" cmake -DCMAKE_BUILD_TYPE=Release ..
make -j8
cd tests
qemu-aarch64 -L /usr/aarch64-linux-gnu ./test_suite_mpi

Status

READY

Add memory constraints to the aarch64 inline assembly in MULADDC_STOP.
This fixes an issue where Clang 12 and 13 were generating
non-functional code on aarch64 platforms. See Mbed-TLS#4962, Mbed-TLS#4943
for further details.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
@daverodgman daverodgman added bug component-crypto Crypto primitives and low-level interfaces size-s Estimated task size: small (~2d) labels Sep 24, 2021
xffbai
xffbai previously approved these changes Sep 24, 2021
Copy link
Contributor

@xffbai xffbai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Combine the changelog entries for the memory constraints fix on
aarch64 and amd64, since these are essentially fixing the same
issue.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
@gilles-peskine-arm gilles-peskine-arm added the single-reviewer This PR qualifies for having only one reviewer label Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Design and code approved - may be waiting for CI or backports bug component-crypto Crypto primitives and low-level interfaces single-reviewer This PR qualifies for having only one reviewer size-s Estimated task size: small (~2d)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants