Skip to content

Commit 07e4634

Browse files
rincebrainlundman
authored andcommitted
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 openzfs#16556
1 parent 7b749bc commit 07e4634

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

module/zcommon/simd_stat.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ kstat_t *simd_stat_kstat;
3434
#endif /* _KERNEL */
3535

3636
#ifdef _KERNEL
37+
/* Sometimes, we don't define these at all. */
38+
#ifndef HAVE_KERNEL_FPU
39+
#define HAVE_KERNEL_FPU (0)
40+
#endif
41+
#ifndef HAVE_UNDERSCORE_KERNEL_FPU
42+
#define HAVE_UNDERSCORE_KERNEL_FPU (0)
43+
#endif
44+
3745
#define SIMD_STAT_PRINT(s, feat, val) \
3846
kmem_scnprintf(s + off, MAX(4095-off, 0), "%-16s\t%1d\n", feat, (val))
3947

@@ -48,7 +56,7 @@ simd_stat_kstat_data(char *buf, size_t size, void *data)
4856
if (off == 0) {
4957
off += SIMD_STAT_PRINT(simd_stat_kstat_payload,
5058
"kfpu_allowed", kfpu_allowed());
51-
#ifdef __x86__
59+
#if defined(__x86_64__) || defined(__i386__)
5260
off += SIMD_STAT_PRINT(simd_stat_kstat_payload,
5361
"kfpu", HAVE_KERNEL_FPU);
5462
off += SIMD_STAT_PRINT(simd_stat_kstat_payload,

0 commit comments

Comments
 (0)