Open tom-cosgrove-arm opened 11 months ago
It seems that GCC doesn't align variables of uint32x4_t type. If they are replaced with __uint128_t, then alignment will be set automatically.
https://gcc.gnu.org/bugzilla//show_bug.cgi?id=111555 looks relevant.
When alignment check is enabled on AArch64 (e.g. in TF-A RMM) we see
mbedtls_internal_sha256_process_many_a64_crypto()
generates alignment fault exception for instructionbecause
X0 = 0x00000000fee2bb78
is not 16 bytes aligned. This is because ofwhich is defined by "state" offset of 8:
To get this to work required aligning
state
and all variables of typeuint32x4_t
type inmbedtls_internal_sha256_process_many_a64_crypto()
& defining aligned array to copy msg into it: