summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/fs/zfs/spa_misc.c9
-rw-r--r--usr/src/uts/common/fs/zfs/sys/simd.h11
2 files changed, 18 insertions, 2 deletions
diff --git a/usr/src/uts/common/fs/zfs/spa_misc.c b/usr/src/uts/common/fs/zfs/spa_misc.c
index c9ceeb6873..dd44829a43 100644
--- a/usr/src/uts/common/fs/zfs/spa_misc.c
+++ b/usr/src/uts/common/fs/zfs/spa_misc.c
@@ -316,6 +316,15 @@ uint64_t zfs_deadman_checktime_ms = 5000ULL;
*/
int zfs_deadman_enabled = -1;
+#if defined(__amd64__) || defined(__i386__)
+/*
+ * Should we allow the use of mechanisms that depend on saving and restoring
+ * the FPU state? This is currently off by default due to stability issues in
+ * the kernel FPU routines; e.g., see bug 13717.
+ */
+int zfs_fpu_enabled = 0;
+#endif
+
/*
* The worst case is single-sector max-parity RAID-Z blocks, in which
* case the space requirement is exactly (VDEV_RAIDZ_MAXPARITY + 1)
diff --git a/usr/src/uts/common/fs/zfs/sys/simd.h b/usr/src/uts/common/fs/zfs/sys/simd.h
index c504e00326..1ee17c902d 100644
--- a/usr/src/uts/common/fs/zfs/sys/simd.h
+++ b/usr/src/uts/common/fs/zfs/sys/simd.h
@@ -18,8 +18,6 @@
#if defined(__amd64__) || defined(__i386__)
-
-#define kfpu_allowed() 1
#define kfpu_initialize(tsk) do {} while (0)
#define kfpu_init() (0)
#define kfpu_fini() do {} while (0)
@@ -32,6 +30,14 @@
#include <sys/disp.h>
#include <sys/cpuvar.h>
+static inline int
+kfpu_allowed(void)
+{
+ extern int zfs_fpu_enabled;
+
+ return (zfs_fpu_enabled != 0 ? 1 : 0);
+}
+
static inline void
kfpu_begin(void)
{
@@ -99,6 +105,7 @@ zfs_avx2_available(void)
#include <sys/auxv.h>
#include <sys/auxv_386.h>
+#define kfpu_allowed() 1
#define kfpu_begin() do {} while (0)
#define kfpu_end() do {} while (0)