Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/21010/
Cc: linux-mips@linux-mips.org

+5 -1
+5 -1
arch/mips/include/asm/switch_to.h
··· 84 84 * Check FCSR for any unmasked exceptions pending set with `ptrace', 85 85 * clear them and send a signal. 86 86 */ 87 - #define __sanitize_fcr31(next) \ 87 + #ifdef CONFIG_MIPS_FP_SUPPORT 88 + # define __sanitize_fcr31(next) \ 88 89 do { \ 89 90 unsigned long fcr31 = mask_fcr31_x(next->thread.fpu.fcr31); \ 90 91 void __user *pc; \ ··· 96 95 force_fcr31_sig(fcr31, pc, next); \ 97 96 } \ 98 97 } while (0) 98 + #else 99 + # define __sanitize_fcr31(next) 100 + #endif 99 101 100 102 /* 101 103 * For newly created kernel threads switch_to() will return to