]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Linux PPC: Fix build failures on kernels built without CONFIG_SPE
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Fri, 9 Dec 2022 18:51:23 +0000 (13:51 -0500)
committerGitHub <noreply@github.com>
Fri, 9 Dec 2022 18:51:23 +0000 (10:51 -0800)
We do a simple ifdef to avoid calling enable_kernel_spe()/
disable_kernel_spe() on PowerPC.

Reported-by: Rich Ercolani <Rincebrain@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Tested-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14233
Closes #14244

include/os/linux/kernel/linux/simd_powerpc.h

index 2a2f92bc499d4bedc66731c4985b4c2d13fcc616..f1de3ad016565e3b8c9b3da6acc80c8d395bde09 100644 (file)
@@ -69,6 +69,7 @@
 #define        kfpu_allowed()                  1
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
+#ifdef CONFIG_SPE
 #define        kfpu_begin()                            \
        {                                       \
                preempt_disable();              \
                disable_kernel_altivec();       \
                preempt_enable();               \
        }
+#else /* CONFIG_SPE */
+#define        kfpu_begin()                            \
+       {                                       \
+               preempt_disable();              \
+               enable_kernel_altivec();        \
+               enable_kernel_vsx();            \
+       }
+#define        kfpu_end()                              \
+       {                                       \
+               disable_kernel_vsx();           \
+               disable_kernel_altivec();       \
+               preempt_enable();               \
+       }
+#endif
 #else
 /* seems that before 4.5 no-one bothered */
 #define        kfpu_begin()