aboutsummaryrefslogtreecommitdiffstats
path: root/config/toolchain-simd.m4
diff options
context:
space:
mode:
authorNathan Lewis <[email protected]>2018-08-02 11:59:24 -0700
committerBrian Behlendorf <[email protected]>2018-08-02 11:59:24 -0700
commit010d12474cb1572c0c9b729615fa45cf43f59d14 (patch)
tree90decc0e3097d799852e8befeb7d6b8a1a5f4be8 /config/toolchain-simd.m4
parent3d503a76e890d7711d5e906e025e092d0e244211 (diff)
Add support for selecting encryption backend
- Add two new module parameters to icp (icp_aes_impl, icp_gcm_impl) that control the crypto implementation. At the moment there is a choice between generic and aesni (on platforms that support it). - This enables support for AES-NI and PCLMULQDQ-NI on AMD Family 15h (bulldozer) and newer CPUs (zen). - Modify aes_key_t to track what implementation it was generated with as key schedules generated with various implementations are not necessarily interchangable. Reviewed by: Gvozden Neskovic <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tom Caputi <[email protected]> Reviewed-by: Richard Laager <[email protected]> Signed-off-by: Nathaniel R. Lewis <[email protected]> Closes #7102 Closes #7103
Diffstat (limited to 'config/toolchain-simd.m4')
-rw-r--r--config/toolchain-simd.m442
1 files changed, 42 insertions, 0 deletions
diff --git a/config/toolchain-simd.m4 b/config/toolchain-simd.m4
index 29abbbb5b..37627b813 100644
--- a/config/toolchain-simd.m4
+++ b/config/toolchain-simd.m4
@@ -21,6 +21,8 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_TOOLCHAIN_SIMD], [
ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512PF
ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512ER
ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512VL
+ ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AES
+ ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_PCLMULQDQ
;;
esac
])
@@ -359,3 +361,43 @@ AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512VL], [
AC_MSG_RESULT([no])
])
])
+
+dnl #
+dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AES
+dnl #
+AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AES], [
+ AC_MSG_CHECKING([whether host toolchain supports AES])
+
+ AC_LINK_IFELSE([AC_LANG_SOURCE([
+ [
+ void main()
+ {
+ __asm__ __volatile__("aesenc %xmm0, %xmm1");
+ }
+ ]])], [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_AES], 1, [Define if host toolchain supports AES])
+ ], [
+ AC_MSG_RESULT([no])
+ ])
+])
+
+dnl #
+dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_PCLMULQDQ
+dnl #
+AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_PCLMULQDQ], [
+ AC_MSG_CHECKING([whether host toolchain supports PCLMULQDQ])
+
+ AC_LINK_IFELSE([AC_LANG_SOURCE([
+ [
+ void main()
+ {
+ __asm__ __volatile__("pclmulqdq %0, %%xmm0, %%xmm1" :: "i"(0));
+ }
+ ]])], [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_PCLMULQDQ], 1, [Define if host toolchain supports PCLMULQDQ])
+ ], [
+ AC_MSG_RESULT([no])
+ ])
+])