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 <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
This commit is contained in:
Richard Yao 2022-12-09 13:51:23 -05:00 committed by GitHub
parent 7bf4c97a36
commit 5401472cd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -69,6 +69,7 @@
#define kfpu_allowed() 1 #define kfpu_allowed() 1
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
#ifdef CONFIG_SPE
#define kfpu_begin() \ #define kfpu_begin() \
{ \ { \
preempt_disable(); \ preempt_disable(); \
@ -83,6 +84,20 @@
disable_kernel_altivec(); \ disable_kernel_altivec(); \
preempt_enable(); \ 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 #else
/* seems that before 4.5 no-one bothered */ /* seems that before 4.5 no-one bothered */
#define kfpu_begin() #define kfpu_begin()