From: Niels Möller Date: Sun, 14 Aug 2022 18:53:10 +0000 (+0200) Subject: Workaround for qemu bug affecting the ppc intruction vmsumudm X-Git-Tag: nettle_3.9_release_20230514~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d618864183ccfdcd0d1b5443111fbaf9a5934517;p=thirdparty%2Fnettle.git 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. --- 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 diff --git a/fat-ppc.c b/fat-ppc.c index 7569e44d..b0412e5a 100644 --- a/fat-ppc.c +++ b/fat-ppc.c @@ -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;