From b64517ac777d0d8eee661e17aeee21b4ad41123c Mon Sep 17 00:00:00 2001 From: dan pittman Date: Thu, 2 Nov 2023 14:49:28 -0700 Subject: [PATCH] fix disallowed interaction with `OPENSSL_ia32_cap_P` in fips mode The fipstool delocation only allows the use of `lea` when interacting with this symbol. This commit uses `lea` and `r11` as required by the delocation process. --- crypto/fipsmodule/bn/asm/rsaz-2k-avx512.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crypto/fipsmodule/bn/asm/rsaz-2k-avx512.pl b/crypto/fipsmodule/bn/asm/rsaz-2k-avx512.pl index 1ecbf757792..4e805a68b27 100644 --- a/crypto/fipsmodule/bn/asm/rsaz-2k-avx512.pl +++ b/crypto/fipsmodule/bn/asm/rsaz-2k-avx512.pl @@ -83,11 +83,12 @@ .type ossl_rsaz_avx512ifma_eligible,\@abi-omnipotent .align 32 ossl_rsaz_avx512ifma_eligible: - mov OPENSSL_ia32cap_P+8(%rip), %ecx + leaq OPENSSL_ia32cap_P(%rip),%r11 + mov 8(%r11),%r11d xor %eax,%eax - and \$`1<<31|1<<21|1<<17|1<<16`, %ecx # avx512vl + avx512ifma + avx512dq + avx512f - cmp \$`1<<31|1<<21|1<<17|1<<16`, %ecx - cmove %ecx,%eax + and \$`1<<31|1<<21|1<<17|1<<16`, %r11d # avx512vl + avx512ifma + avx512dq + avx512f + cmp \$`1<<31|1<<21|1<<17|1<<16`, %r11d + cmove %r11d,%eax ret .size ossl_rsaz_avx512ifma_eligible, .-ossl_rsaz_avx512ifma_eligible ___