summaryrefslogtreecommitdiffstats
path: root/sys/modules/aesni
diff options
context:
space:
mode:
authorjmg <jmg@FreeBSD.org>2013-09-03 18:31:23 +0000
committerjmg <jmg@FreeBSD.org>2013-09-03 18:31:23 +0000
commit8ec798134a6d611c2af470ec8576cfe300cef5e7 (patch)
tree70163365566d769ffe148062c84abb56725f25e7 /sys/modules/aesni
parente10c4e2adb9090fc2fe5c150e4c8dcd7b5e360ac (diff)
downloadFreeBSD-src-8ec798134a6d611c2af470ec8576cfe300cef5e7.zip
FreeBSD-src-8ec798134a6d611c2af470ec8576cfe300cef5e7.tar.gz
Use the fact that the AES-NI instructions can be pipelined to improve
performance... Use SSE2 instructions for calculating the XTS tweek factor... Let the compiler do more work and handle register allocation by using intrinsics, now only the key schedule is in assembly... Replace .byte hard coded instructions w/ the proper instructions now that both clang and gcc support them... On my machine, pulling the code to userland I saw performance go from ~150MB/sec to 2GB/sec in XTS mode. GELI on GNOP saw a more modest increase of about 3x due to other system overhead (geom and opencrypto)... These changes allow almost full disk io rate w/ geli... Reviewed by: -current, -security Thanks to: Mike Hamburg for the XTS tweek algorithm
Diffstat (limited to 'sys/modules/aesni')
-rw-r--r--sys/modules/aesni/Makefile13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/modules/aesni/Makefile b/sys/modules/aesni/Makefile
index 9e25a46..26dbedc 100644
--- a/sys/modules/aesni/Makefile
+++ b/sys/modules/aesni/Makefile
@@ -3,8 +3,17 @@
.PATH: ${.CURDIR}/../../crypto/aesni
KMOD= aesni
-SRCS= aesni.c aesni_wrap.c
-SRCS+= aesencdec_${MACHINE_CPUARCH}.S aeskeys_${MACHINE_CPUARCH}.S
+SRCS= aesni.c
+SRCS+= aeskeys_${MACHINE_CPUARCH}.S
SRCS+= device_if.h bus_if.h opt_bus.h cryptodev_if.h
+OBJS+= aesni_wrap.o
+
+# Remove -nostdinc so we can get the intrinsics.
+aesni_wrap.o: aesni_wrap.c
+ ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \
+ -mmmx -msse -maes ${.IMPSRC}
+ ${CTFCONVERT_CMD}
+
.include <bsd.kmod.mk>
+
OpenPOWER on IntegriCloud