Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src-draft/trunk]: src/sys Wire up the ARM NEON AES implementation on armv7.



details:   https://anonhg.NetBSD.org/src-all/rev/cd5bb502d348
branches:  trunk
changeset: 935280:cd5bb502d348
user:      Taylor R Campbell <riastradh%NetBSD.org@localhost>
date:      Sun Jun 28 15:25:29 2020 +0000

description:
Wire up the ARM NEON AES implementation on armv7.

diffstat:

 sys/arch/arm/conf/files.arm             |   2 +-
 sys/arch/arm/vfp/vfp_init.c             |  10 ++++++++--
 sys/crypto/aes/arch/arm/aes_armv8.c     |   3 ++-
 sys/crypto/aes/arch/arm/aes_neon_impl.c |   5 ++---
 4 files changed, 13 insertions(+), 7 deletions(-)

diffs (69 lines):

diff -r d809834adc86 -r cd5bb502d348 sys/arch/arm/conf/files.arm
--- a/sys/arch/arm/conf/files.arm       Sun Jun 28 15:25:10 2020 +0000
+++ b/sys/arch/arm/conf/files.arm       Sun Jun 28 15:25:29 2020 +0000
@@ -265,4 +265,4 @@
 
 # vpaes with ARM NEON -- disabled for now pending arm32 kernel fpu
 # support and ctf
-#include "crypto/aes/arch/arm/files.aesneon"
+include "crypto/aes/arch/arm/files.aesneon"
diff -r d809834adc86 -r cd5bb502d348 sys/arch/arm/vfp/vfp_init.c
--- a/sys/arch/arm/vfp/vfp_init.c       Sun Jun 28 15:25:10 2020 +0000
+++ b/sys/arch/arm/vfp/vfp_init.c       Sun Jun 28 15:25:29 2020 +0000
@@ -50,6 +50,9 @@
 
 #include <uvm/uvm_extern.h>            /* for pmap.h */
 
+#include <crypto/aes/aes.h>
+#include <crypto/aes/arch/arm/aes_neon.h>
+
 #ifdef FPU_VFP
 
 #ifdef CPU_CORTEX
@@ -402,8 +405,11 @@
                install_coproc_handler(VFP_COPROC, vfp_handler);
                install_coproc_handler(VFP_COPROC2, vfp_handler);
 #ifdef CPU_CORTEX
-               if (cpu_neon_present)
-                       install_coproc_handler(CORE_UNKNOWN_HANDLER, neon_handler);
+               if (cpu_neon_present) {
+                       install_coproc_handler(CORE_UNKNOWN_HANDLER,
+                           neon_handler);
+                       aes_md_init(&aes_neon_impl);
+               }
 #endif
        }
 }
diff -r d809834adc86 -r cd5bb502d348 sys/crypto/aes/arch/arm/aes_armv8.c
--- a/sys/crypto/aes/arch/arm/aes_armv8.c       Sun Jun 28 15:25:10 2020 +0000
+++ b/sys/crypto/aes/arch/arm/aes_armv8.c       Sun Jun 28 15:25:29 2020 +0000
@@ -36,8 +36,9 @@
 #include <crypto/aes/aes.h>
 #include <crypto/aes/arch/arm/aes_armv8.h>
 
+#include <arm/fpu.h>
+
 #include <aarch64/armreg.h>
-#include <aarch64/fpu.h>
 
 static void
 aesarmv8_setenckey(struct aesenc *enc, const uint8_t key[static 16],
diff -r d809834adc86 -r cd5bb502d348 sys/crypto/aes/arch/arm/aes_neon_impl.c
--- a/sys/crypto/aes/arch/arm/aes_neon_impl.c   Sun Jun 28 15:25:10 2020 +0000
+++ b/sys/crypto/aes/arch/arm/aes_neon_impl.c   Sun Jun 28 15:25:29 2020 +0000
@@ -35,13 +35,12 @@
 #include <crypto/aes/aes.h>
 #include <crypto/aes/arch/arm/aes_neon.h>
 
+#include <arm/fpu.h>
+
 #ifdef __aarch64__
 #include <aarch64/armreg.h>
-#include <aarch64/fpu.h>
 #else
 #include <arm/locore.h>
-#define        fpu_kern_enter()        ((void)0)
-#define        fpu_kern_leave()        ((void)0)
 #endif
 
 #include "aes_neon_subr.h"



Home | Main Index | Thread Index | Old Index