diff options
Diffstat (limited to 'arch/mips/kernel/process.c')
| -rw-r--r-- | arch/mips/kernel/process.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index 45d0b6b037ee..57028d49c202 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c | |||
| @@ -705,6 +705,18 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value) | |||
| 705 | struct task_struct *t; | 705 | struct task_struct *t; |
| 706 | int max_users; | 706 | int max_users; |
| 707 | 707 | ||
| 708 | /* If nothing to change, return right away, successfully. */ | ||
| 709 | if (value == mips_get_process_fp_mode(task)) | ||
| 710 | return 0; | ||
| 711 | |||
| 712 | /* Only accept a mode change if 64-bit FP enabled for o32. */ | ||
| 713 | if (!IS_ENABLED(CONFIG_MIPS_O32_FP64_SUPPORT)) | ||
| 714 | return -EOPNOTSUPP; | ||
| 715 | |||
| 716 | /* And only for o32 tasks. */ | ||
| 717 | if (IS_ENABLED(CONFIG_64BIT) && !test_thread_flag(TIF_32BIT_REGS)) | ||
| 718 | return -EOPNOTSUPP; | ||
| 719 | |||
| 708 | /* Check the value is valid */ | 720 | /* Check the value is valid */ |
| 709 | if (value & ~known_bits) | 721 | if (value & ~known_bits) |
| 710 | return -EOPNOTSUPP; | 722 | return -EOPNOTSUPP; |
