Skip to content

Commit

Permalink
MIPS: Avoid FCSR sanitization when CONFIG_MIPS_FP_SUPPORT=n
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Paul Burton committed Nov 9, 2018
1 parent ea6a373 commit 36a4980
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/mips/include/asm/switch_to.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand All @@ -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
Expand Down

0 comments on commit 36a4980

Please sign in to comment.