aboutsummaryrefslogtreecommitdiffstats
path: root/include/os
diff options
context:
space:
mode:
authorRichard Yao <[email protected]>2022-12-09 13:51:23 -0500
committerGitHub <[email protected]>2022-12-09 10:51:23 -0800
commit5401472cd0599dda4fdf71f9ba318785cbca2025 (patch)
treee6306812dc18ac70f661e2d708bbd1777153121a /include/os
parent7bf4c97a3696663959d1891c5890b2667761dd58 (diff)
Linux PPC: Fix build failures on kernels built without CONFIG_SPE
We do a simple ifdef to avoid calling enable_kernel_spe()/ disable_kernel_spe() on PowerPC. Reported-by: Rich Ercolani <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tino Reichardt <[email protected]> Tested-by: Georgy Yakovlev <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes #14233 Closes #14244
Diffstat (limited to 'include/os')
-rw-r--r--include/os/linux/kernel/linux/simd_powerpc.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/os/linux/kernel/linux/simd_powerpc.h b/include/os/linux/kernel/linux/simd_powerpc.h
index 2a2f92bc4..f1de3ad01 100644
--- a/include/os/linux/kernel/linux/simd_powerpc.h
+++ b/include/os/linux/kernel/linux/simd_powerpc.h
@@ -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(); \
@@ -83,6 +84,20 @@
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()