aboutsummaryrefslogtreecommitdiffstats
path: root/module/zcommon
diff options
context:
space:
mode:
authorRich Ercolani <[email protected]>2024-09-22 16:11:19 -0400
committerGitHub <[email protected]>2024-09-22 13:11:19 -0700
commit1d84c9eb661802e81dde6677e3c38ecdfe0bda6c (patch)
tree64cdff082a52cb10460c2934e78aa266762ff5b7 /module/zcommon
parentd565835c477cd938d0f90c952f9c023efe7fb8a7 (diff)
Fix /proc/spl/kstat/simd on x86
Evidently while reworking it on aarch64, I broke it on x86 and didn't notice. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #16556
Diffstat (limited to 'module/zcommon')
-rw-r--r--module/zcommon/simd_stat.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/module/zcommon/simd_stat.c b/module/zcommon/simd_stat.c
index 538f8317a..f2d100d84 100644
--- a/module/zcommon/simd_stat.c
+++ b/module/zcommon/simd_stat.c
@@ -34,6 +34,14 @@ kstat_t *simd_stat_kstat;
#endif /* _KERNEL */
#ifdef _KERNEL
+/* Sometimes, we don't define these at all. */
+#ifndef HAVE_KERNEL_FPU
+#define HAVE_KERNEL_FPU (0)
+#endif
+#ifndef HAVE_UNDERSCORE_KERNEL_FPU
+#define HAVE_UNDERSCORE_KERNEL_FPU (0)
+#endif
+
#define SIMD_STAT_PRINT(s, feat, val) \
kmem_scnprintf(s + off, MAX(4095-off, 0), "%-16s\t%1d\n", feat, (val))
@@ -48,7 +56,7 @@ simd_stat_kstat_data(char *buf, size_t size, void *data)
if (off == 0) {
off += SIMD_STAT_PRINT(simd_stat_kstat_payload,
"kfpu_allowed", kfpu_allowed());
-#ifdef __x86__
+#if defined(__x86_64__) || defined(__i386__)
off += SIMD_STAT_PRINT(simd_stat_kstat_payload,
"kfpu", HAVE_KERNEL_FPU);
off += SIMD_STAT_PRINT(simd_stat_kstat_payload,