From 84a457c6c08aedff2a1d66edd967e24007b6648c Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sat, 10 Aug 2019 15:53:42 +0000 Subject: [PATCH] tests/sys/opencrypto: enable armv8crypto on aarch64 This change makes required modifications in runtests to also only require the aesni module on Intel (i386/amd64) platforms, as it is an Intel specific module. MFC after: 1 month MFC to: ^/stable/12 (support not present on ^/stable/11) Submitted by: Greg V Differential Revision: https://reviews.freebsd.org/D21018 --- tests/sys/opencrypto/cryptotest.py | 5 +++-- tests/sys/opencrypto/runtests.sh | 14 +++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/sys/opencrypto/cryptotest.py b/tests/sys/opencrypto/cryptotest.py index ecf9552e1f32..2a0a7f5c3b84 100644 --- a/tests/sys/opencrypto/cryptotest.py +++ b/tests/sys/opencrypto/cryptotest.py @@ -50,9 +50,9 @@ def katg(base, glob): raise unittest.SkipTest("Missing %s test vectors" % (base)) return iglob(os.path.join(katdir, base, glob)) -aesmodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0' ] +aesmodules = [ 'cryptosoft0', 'aesni0', 'armv8crypto0', 'ccr0', 'ccp0' ] desmodules = [ 'cryptosoft0', ] -shamodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0' ] +shamodules = [ 'cryptosoft0', 'aesni0', 'armv8crypto0', 'ccr0', 'ccp0' ] def GenTestCase(cname): try: @@ -500,6 +500,7 @@ def runSHA1HMACWithParser(self, parser): cryptosoft = GenTestCase('cryptosoft0') aesni = GenTestCase('aesni0') +armv8crypto = GenTestCase('armv8crypto0') ccr = GenTestCase('ccr0') ccp = GenTestCase('ccp0') diff --git a/tests/sys/opencrypto/runtests.sh b/tests/sys/opencrypto/runtests.sh index 3f38a18d3d63..680173610a00 100644 --- a/tests/sys/opencrypto/runtests.sh +++ b/tests/sys/opencrypto/runtests.sh @@ -60,7 +60,19 @@ cleanup_tests() } trap cleanup_tests EXIT INT TERM -for required_module in nexus/aesni cryptodev; do +cpu_type="$(uname -p)" +cpu_module= + +case ${cpu_type} in +aarch64) + cpu_module=nexus/armv8crypto + ;; +amd64|i386) + cpu_module=nexus/aesni + ;; +esac + +for required_module in $cpu_module cryptodev; do if ! kldstat -q -m $required_module; then module_to_load=${required_module#nexus/} if ! kldload ${module_to_load}; then