diff options
author | Matthew Macy <[email protected]> | 2019-09-05 09:34:54 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-09-05 09:34:54 -0700 |
commit | 006e9a40882468be68f276c946bae812b74ac35c (patch) | |
tree | a4137660779e71e9da7e0a4dfb18c15951eb01f0 /module | |
parent | d02186ee2b0570069cfbb0d08d5c52752648f388 (diff) |
OpenZFS restructuring - move platform specific headers
Move platform specific Linux headers under include/os/linux/.
Update the build system accordingly to detect the platform.
This lays some of the initial groundwork to supporting building
for other platforms.
As part of this change it was necessary to create both a user
and kernel space sys/simd.h header which can be included in
either context. No functional change, the source has been
refactored and the relevant #include's updated.
Reviewed-by: Jorgen Lundman <[email protected]>
Reviewed-by: Igor Kozhukhov <[email protected]>
Signed-off-by: Matthew Macy <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #9198
Diffstat (limited to 'module')
-rw-r--r-- | module/Makefile.in | 4 | ||||
-rw-r--r-- | module/icp/algs/aes/aes_impl.c | 2 | ||||
-rw-r--r-- | module/icp/algs/aes/aes_impl_aesni.c | 3 | ||||
-rw-r--r-- | module/icp/algs/aes/aes_impl_x86-64.c | 2 | ||||
-rw-r--r-- | module/icp/algs/modes/gcm.c | 2 | ||||
-rw-r--r-- | module/icp/algs/modes/gcm_pclmulqdq.c | 4 | ||||
-rw-r--r-- | module/icp/io/aes.c | 4 | ||||
-rw-r--r-- | module/spl/spl-taskq.c | 2 | ||||
-rw-r--r-- | module/spl/spl-thread.c | 2 | ||||
-rw-r--r-- | module/zcommon/zfs_fletcher.c | 4 | ||||
-rw-r--r-- | module/zcommon/zfs_fletcher_aarch64_neon.c | 2 | ||||
-rw-r--r-- | module/zcommon/zfs_fletcher_avx512.c | 2 | ||||
-rw-r--r-- | module/zcommon/zfs_fletcher_intel.c | 2 | ||||
-rw-r--r-- | module/zcommon/zfs_fletcher_sse.c | 2 | ||||
-rw-r--r-- | module/zfs/vdev_raidz_math.c | 2 | ||||
-rw-r--r-- | module/zfs/vdev_raidz_math_aarch64_neon_common.h | 2 | ||||
-rw-r--r-- | module/zfs/vdev_raidz_math_avx2.c | 2 | ||||
-rw-r--r-- | module/zfs/vdev_raidz_math_avx512bw.c | 2 | ||||
-rw-r--r-- | module/zfs/vdev_raidz_math_avx512f.c | 2 | ||||
-rw-r--r-- | module/zfs/vdev_raidz_math_sse2.c | 2 | ||||
-rw-r--r-- | module/zfs/vdev_raidz_math_ssse3.c | 2 |
21 files changed, 27 insertions, 24 deletions
diff --git a/module/Makefile.in b/module/Makefile.in index 7477dbe56..bf0eb101c 100644 --- a/module/Makefile.in +++ b/module/Makefile.in @@ -12,7 +12,9 @@ INSTALL_MOD_DIR ?= extra ZFS_MODULE_CFLAGS += -std=gnu99 -Wno-declaration-after-statement ZFS_MODULE_CFLAGS += @KERNEL_DEBUG_CFLAGS@ ZFS_MODULE_CFLAGS += -include @abs_top_builddir@/zfs_config.h -ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include/spl +ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include/os/linux/kernel +ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include/os/linux/spl +ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include/os/linux/zfs ZFS_MODULE_CFLAGS += -I@abs_top_srcdir@/include ZFS_MODULE_CPPFLAGS += -D_KERNEL diff --git a/module/icp/algs/aes/aes_impl.c b/module/icp/algs/aes/aes_impl.c index 0f11f9999..b60b16cc0 100644 --- a/module/icp/algs/aes/aes_impl.c +++ b/module/icp/algs/aes/aes_impl.c @@ -25,9 +25,9 @@ #include <sys/zfs_context.h> #include <sys/crypto/icp.h> #include <sys/crypto/spi.h> +#include <sys/simd.h> #include <modes/modes.h> #include <aes/aes_impl.h> -#include <linux/simd.h> /* * Initialize AES encryption and decryption key schedules. diff --git a/module/icp/algs/aes/aes_impl_aesni.c b/module/icp/algs/aes/aes_impl_aesni.c index 222c176aa..4b5eefd71 100644 --- a/module/icp/algs/aes/aes_impl_aesni.c +++ b/module/icp/algs/aes/aes_impl_aesni.c @@ -24,7 +24,8 @@ #if defined(__x86_64) && defined(HAVE_AES) -#include <linux/simd_x86.h> +#include <sys/simd.h> +#include <sys/types.h> /* These functions are used to execute AES-NI instructions: */ extern int rijndael_key_setup_enc_intel(uint32_t rk[], diff --git a/module/icp/algs/aes/aes_impl_x86-64.c b/module/icp/algs/aes/aes_impl_x86-64.c index b4515fa22..0ee7ee99c 100644 --- a/module/icp/algs/aes/aes_impl_x86-64.c +++ b/module/icp/algs/aes/aes_impl_x86-64.c @@ -24,7 +24,7 @@ #if defined(__x86_64) -#include <linux/simd_x86.h> +#include <sys/simd.h> /* These functions are used to execute amd64 instructions for AMD or Intel: */ extern int rijndael_key_setup_enc_amd64(uint32_t rk[], diff --git a/module/icp/algs/modes/gcm.c b/module/icp/algs/modes/gcm.c index 423b70e2c..1fb8e256a 100644 --- a/module/icp/algs/modes/gcm.c +++ b/module/icp/algs/modes/gcm.c @@ -28,8 +28,8 @@ #include <sys/crypto/icp.h> #include <sys/crypto/impl.h> #include <sys/byteorder.h> +#include <sys/simd.h> #include <modes/gcm_impl.h> -#include <linux/simd.h> #define GHASH(c, d, t, o) \ xor_block((uint8_t *)(d), (uint8_t *)(c)->gcm_ghash); \ diff --git a/module/icp/algs/modes/gcm_pclmulqdq.c b/module/icp/algs/modes/gcm_pclmulqdq.c index 8a43ba33a..05920115c 100644 --- a/module/icp/algs/modes/gcm_pclmulqdq.c +++ b/module/icp/algs/modes/gcm_pclmulqdq.c @@ -24,12 +24,12 @@ #if defined(__x86_64) && defined(HAVE_PCLMULQDQ) -#include <linux/simd_x86.h> +#include <sys/types.h> +#include <sys/simd.h> /* These functions are used to execute pclmulqdq based assembly methods */ extern void gcm_mul_pclmulqdq(uint64_t *, uint64_t *, uint64_t *); - #include <modes/gcm_impl.h> /* diff --git a/module/icp/io/aes.c b/module/icp/io/aes.c index 51538bc60..4b2dbd6e1 100644 --- a/module/icp/io/aes.c +++ b/module/icp/io/aes.c @@ -212,8 +212,8 @@ aes_mod_init(void) * are run in dedicated kernel threads to allow Linux 5.0+ kernels * to use SIMD operations. If for some reason this isn't possible, * fallback to the generic implementations. See the comment in - * include/linux/simd_x86.h for additional details. Additionally, - * this has the benefit of allowing them to be run in parallel. + * linux/simd_x86.h for additional details. Additionally, this has + * the benefit of allowing them to be run in parallel. */ taskqid_t aes_id = taskq_dispatch(system_taskq, aes_impl_init, NULL, TQ_SLEEP); diff --git a/module/spl/spl-taskq.c b/module/spl/spl-taskq.c index 69d591ff7..90e1d0a4d 100644 --- a/module/spl/spl-taskq.c +++ b/module/spl/spl-taskq.c @@ -28,7 +28,7 @@ #include <sys/taskq.h> #include <sys/kmem.h> #include <sys/tsd.h> -#include <linux/simd.h> +#include <sys/simd.h> int spl_taskq_thread_bind = 0; module_param(spl_taskq_thread_bind, int, 0644); diff --git a/module/spl/spl-thread.c b/module/spl/spl-thread.c index 07e3a1bff..29de9252a 100644 --- a/module/spl/spl-thread.c +++ b/module/spl/spl-thread.c @@ -27,7 +27,7 @@ #include <sys/thread.h> #include <sys/kmem.h> #include <sys/tsd.h> -#include <linux/simd.h> +#include <sys/simd.h> /* * Thread interfaces diff --git a/module/zcommon/zfs_fletcher.c b/module/zcommon/zfs_fletcher.c index 9187a7c1e..c14c95fa2 100644 --- a/module/zcommon/zfs_fletcher.c +++ b/module/zcommon/zfs_fletcher.c @@ -137,10 +137,10 @@ #include <sys/sysmacros.h> #include <sys/byteorder.h> #include <sys/spa.h> +#include <sys/simd.h> #include <sys/zio_checksum.h> #include <sys/zfs_context.h> #include <zfs_fletcher.h> -#include <linux/simd.h> #define FLETCHER_MIN_SIMD_SIZE 64 @@ -773,7 +773,7 @@ fletcher_4_init(void) /* * For 5.0 and latter Linux kernels the fletcher 4 benchmarks are * run in a kernel threads. This is needed to take advantage of the - * SIMD functionality, see include/linux/simd_x86.h for details. + * SIMD functionality, see linux/simd_x86.h for details. */ taskqid_t id = taskq_dispatch(system_taskq, fletcher_4_benchmark, NULL, TQ_SLEEP); diff --git a/module/zcommon/zfs_fletcher_aarch64_neon.c b/module/zcommon/zfs_fletcher_aarch64_neon.c index 3b3c1b52b..c95a71681 100644 --- a/module/zcommon/zfs_fletcher_aarch64_neon.c +++ b/module/zcommon/zfs_fletcher_aarch64_neon.c @@ -43,7 +43,7 @@ #if defined(__aarch64__) -#include <linux/simd_aarch64.h> +#include <sys/simd.h> #include <sys/spa_checksum.h> #include <sys/strings.h> #include <zfs_fletcher.h> diff --git a/module/zcommon/zfs_fletcher_avx512.c b/module/zcommon/zfs_fletcher_avx512.c index 0d4cff21a..43806f264 100644 --- a/module/zcommon/zfs_fletcher_avx512.c +++ b/module/zcommon/zfs_fletcher_avx512.c @@ -24,11 +24,11 @@ #if defined(__x86_64) && defined(HAVE_AVX512F) -#include <linux/simd_x86.h> #include <sys/byteorder.h> #include <sys/frame.h> #include <sys/spa_checksum.h> #include <sys/strings.h> +#include <sys/simd.h> #include <zfs_fletcher.h> #define __asm __asm__ __volatile__ diff --git a/module/zcommon/zfs_fletcher_intel.c b/module/zcommon/zfs_fletcher_intel.c index 7f12efe6d..5136a01ec 100644 --- a/module/zcommon/zfs_fletcher_intel.c +++ b/module/zcommon/zfs_fletcher_intel.c @@ -42,8 +42,8 @@ #if defined(HAVE_AVX) && defined(HAVE_AVX2) -#include <linux/simd_x86.h> #include <sys/spa_checksum.h> +#include <sys/simd.h> #include <sys/strings.h> #include <zfs_fletcher.h> diff --git a/module/zcommon/zfs_fletcher_sse.c b/module/zcommon/zfs_fletcher_sse.c index e6389d6e5..15ce9b07f 100644 --- a/module/zcommon/zfs_fletcher_sse.c +++ b/module/zcommon/zfs_fletcher_sse.c @@ -43,7 +43,7 @@ #if defined(HAVE_SSE2) -#include <linux/simd_x86.h> +#include <sys/simd.h> #include <sys/spa_checksum.h> #include <sys/byteorder.h> #include <sys/strings.h> diff --git a/module/zfs/vdev_raidz_math.c b/module/zfs/vdev_raidz_math.c index ef514e9e1..86d4aabdc 100644 --- a/module/zfs/vdev_raidz_math.c +++ b/module/zfs/vdev_raidz_math.c @@ -29,7 +29,7 @@ #include <sys/zfs_debug.h> #include <sys/vdev_raidz.h> #include <sys/vdev_raidz_impl.h> -#include <linux/simd.h> +#include <sys/simd.h> extern boolean_t raidz_will_scalar_work(void); diff --git a/module/zfs/vdev_raidz_math_aarch64_neon_common.h b/module/zfs/vdev_raidz_math_aarch64_neon_common.h index 0ea2ad611..5312b9094 100644 --- a/module/zfs/vdev_raidz_math_aarch64_neon_common.h +++ b/module/zfs/vdev_raidz_math_aarch64_neon_common.h @@ -23,7 +23,7 @@ */ #include <sys/types.h> -#include <linux/simd_aarch64.h> +#include <sys/simd.h> #define __asm __asm__ __volatile__ diff --git a/module/zfs/vdev_raidz_math_avx2.c b/module/zfs/vdev_raidz_math_avx2.c index a12eb6720..008e848d4 100644 --- a/module/zfs/vdev_raidz_math_avx2.c +++ b/module/zfs/vdev_raidz_math_avx2.c @@ -26,7 +26,7 @@ #if defined(__x86_64) && defined(HAVE_AVX2) #include <sys/types.h> -#include <linux/simd_x86.h> +#include <sys/simd.h> #define __asm __asm__ __volatile__ diff --git a/module/zfs/vdev_raidz_math_avx512bw.c b/module/zfs/vdev_raidz_math_avx512bw.c index 2f545c9ec..38cdbedf7 100644 --- a/module/zfs/vdev_raidz_math_avx512bw.c +++ b/module/zfs/vdev_raidz_math_avx512bw.c @@ -28,7 +28,7 @@ #if defined(__x86_64) && defined(HAVE_AVX512BW) #include <sys/types.h> -#include <linux/simd_x86.h> +#include <sys/simd.h> #define __asm __asm__ __volatile__ diff --git a/module/zfs/vdev_raidz_math_avx512f.c b/module/zfs/vdev_raidz_math_avx512f.c index 75af7a8ee..adbe9b0ef 100644 --- a/module/zfs/vdev_raidz_math_avx512f.c +++ b/module/zfs/vdev_raidz_math_avx512f.c @@ -28,7 +28,7 @@ #if defined(__x86_64) && defined(HAVE_AVX512F) #include <sys/types.h> -#include <linux/simd_x86.h> +#include <sys/simd.h> #define __asm __asm__ __volatile__ diff --git a/module/zfs/vdev_raidz_math_sse2.c b/module/zfs/vdev_raidz_math_sse2.c index 5b3a9385c..70a21c10c 100644 --- a/module/zfs/vdev_raidz_math_sse2.c +++ b/module/zfs/vdev_raidz_math_sse2.c @@ -27,7 +27,7 @@ #if defined(__x86_64) && defined(HAVE_SSE2) #include <sys/types.h> -#include <linux/simd_x86.h> +#include <sys/simd.h> #define __asm __asm__ __volatile__ diff --git a/module/zfs/vdev_raidz_math_ssse3.c b/module/zfs/vdev_raidz_math_ssse3.c index 62247cf8e..d5776a38a 100644 --- a/module/zfs/vdev_raidz_math_ssse3.c +++ b/module/zfs/vdev_raidz_math_ssse3.c @@ -27,7 +27,7 @@ #if defined(__x86_64) && defined(HAVE_SSSE3) #include <sys/types.h> -#include <linux/simd_x86.h> +#include <sys/simd.h> #define __asm __asm__ __volatile__ |