diff options
author | Niels Möller <nisse@lysator.liu.se> | 2022-08-14 20:53:10 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2022-08-14 20:53:10 +0200 |
commit | d618864183ccfdcd0d1b5443111fbaf9a5934517 (patch) | |
tree | 77fa8cdf41185a2b610332591e9edf7062eaf845 | |
parent | 9830fe90540616bc7392fc95213383c47969514b (diff) | |
download | nettle-d618864183ccfdcd0d1b5443111fbaf9a5934517.tar.gz |
Workaround for qemu bug affecting the ppc intruction vmsumudm
Introduce overriding environment variable NETTLE_FAT_DISABLE_POWER9
that disables use of power9 code. This makes poly1305 tests under qemu
pass. See https://gitlab.com/qemu-project/qemu/-/issues/1156.
-rw-r--r-- | .gitlab-ci.yml | 4 | ||||
-rw-r--r-- | fat-ppc.c | 5 | ||||
-rw-r--r-- | fat-setup.h | 1 |
3 files changed, 8 insertions, 2 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ed15456f..b206873e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -158,8 +158,8 @@ Debian.cross.x86: - ./.bootstrap - ./configure --disable-static --disable-documentation $EXTRA_CONFIGURE_FLAGS --build=$build --host=$host - make -j$(nproc) - - NETTLE_TEST_SEED=0 make -j$(nproc) check - - NETTLE_TEST_SEED=0 make -j$(nproc) check-fat + - NETTLE_TEST_SEED=0 NETTLE_FAT_DISABLE_POWER9=1 make -j$(nproc) check + - NETTLE_TEST_SEED=0 NETTLE_FAT_DISABLE_POWER9=1 make -j$(nproc) check-fat tags: - shared - linux @@ -153,6 +153,11 @@ get_ppc_features (struct ppc_features *features) == (PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_VSX)); #endif } + /* NETTLE_FAT_DISABLE_POWER9 can be set to disable code that fails + in qemu, due to + https://gitlab.com/qemu-project/qemu/-/issues/1156. */ + if (secure_getenv (ENV_DISABLE_POWER9)) + features->have_power9 = 0; } DECLARE_FAT_FUNC(_nettle_aes_encrypt, aes_crypt_internal_func) diff --git a/fat-setup.h b/fat-setup.h index ad3c10f0..a35b8b8c 100644 --- a/fat-setup.h +++ b/fat-setup.h @@ -92,6 +92,7 @@ #define ENV_VERBOSE "NETTLE_FAT_VERBOSE" #define ENV_OVERRIDE "NETTLE_FAT_OVERRIDE" +#define ENV_DISABLE_POWER9 "NETTLE_FAT_DISABLE_POWER9" struct chacha_ctx; struct salsa20_ctx; |