From: Paul Burton Date: Wed, 7 Nov 2018 23:14:09 +0000 (+0000) Subject: MIPS: Avoid FCSR sanitization when CONFIG_MIPS_FP_SUPPORT=n X-Git-Tag: v5.4-rc1~1858^2~80 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=36a498035bd2e5169bbceed1e3b0c8bb0ce5a7b4;p=platform%2Fkernel%2Flinux-rpi.git MIPS: Avoid FCSR sanitization when CONFIG_MIPS_FP_SUPPORT=n When CONFIG_MIPS_FP_SUPPORT=n we don't support floating point, so we don't need to worry about floating point exceptions pending in the Floating point Control & Status Register (FCSR) during switch_to(). Stub out the __sanitize_fcr31() macro in this case. Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/21010/ Cc: linux-mips@linux-mips.org --- diff --git a/arch/mips/include/asm/switch_to.h b/arch/mips/include/asm/switch_to.h index e610473..0f813bb 100644 --- a/arch/mips/include/asm/switch_to.h +++ b/arch/mips/include/asm/switch_to.h @@ -84,7 +84,8 @@ do { \ * Check FCSR for any unmasked exceptions pending set with `ptrace', * clear them and send a signal. */ -#define __sanitize_fcr31(next) \ +#ifdef CONFIG_MIPS_FP_SUPPORT +# define __sanitize_fcr31(next) \ do { \ unsigned long fcr31 = mask_fcr31_x(next->thread.fpu.fcr31); \ void __user *pc; \ @@ -95,6 +96,9 @@ do { \ force_fcr31_sig(fcr31, pc, next); \ } \ } while (0) +#else +# define __sanitize_fcr31(next) +#endif /* * For newly created kernel threads switch_to() will return to