Skip to content

Commit

Permalink
Linux PPC: Fix build failures on kernels built without CONFIG_SPE
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ryao authored Dec 9, 2022
1 parent 7bf4c97 commit 5401472
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions include/os/linux/kernel/linux/simd_powerpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(); \
Expand All @@ -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()
Expand Down

0 comments on commit 5401472

Please sign in to comment.