Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix /proc/spl/kstat/simd on x86 #16556

Merged
merged 1 commit into from
Sep 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion module/zcommon/simd_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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,
Expand Down
Loading