diff options
| author | Markos Chandras <markos.chandras@imgtec.com> | 2015-02-26 06:11:30 -0500 |
|---|---|---|
| committer | Ralf Baechle <ralf@linux-mips.org> | 2015-04-10 09:41:54 -0400 |
| commit | 48f8eaee3f59848809644507fc47363b37e54450 (patch) | |
| tree | 36ebe6eb8ec3405ac64f3665a9ec9565a2113fc5 /arch/mips | |
| parent | 96f7c21363e0e0d19f3471f54a719ed06d708513 (diff) | |
MIPS: asm: elf: Set O32 default FPU flags
Set good default FPU flags (FR0) for O32 binaries similar to what the
kernel does for the N64/N32 ones. This also fixes a regression
introduced in commit 46490b572544 ("MIPS: kernel: elf: Improve the
overall ABI and FPU mode checks") when MIPS_O32_FP64_SUPPORT is
disabled. In that case, the mips_set_personality_fp() did not set the
FPU mode at all because it assumed that the FPU mode was already set
properly. That led to O32 userland problems.
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Reported-by: Mans Rullgard <mans@mansr.com>
Fixes: 46490b572544 ("MIPS: kernel: elf: Improve the overall ABI and FPU mode checks")
Tested-by: Mans Rullgard <mans@mansr.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Matthew Fortune <Matthew.Fortune@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/9344/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
| -rw-r--r-- | arch/mips/include/asm/elf.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h index 535f196ffe02..694925a26924 100644 --- a/arch/mips/include/asm/elf.h +++ b/arch/mips/include/asm/elf.h | |||
| @@ -294,6 +294,9 @@ do { \ | |||
| 294 | if (personality(current->personality) != PER_LINUX) \ | 294 | if (personality(current->personality) != PER_LINUX) \ |
| 295 | set_personality(PER_LINUX); \ | 295 | set_personality(PER_LINUX); \ |
| 296 | \ | 296 | \ |
| 297 | clear_thread_flag(TIF_HYBRID_FPREGS); \ | ||
| 298 | set_thread_flag(TIF_32BIT_FPREGS); \ | ||
| 299 | \ | ||
| 297 | mips_set_personality_fp(state); \ | 300 | mips_set_personality_fp(state); \ |
| 298 | \ | 301 | \ |
| 299 | current->thread.abi = &mips_abi; \ | 302 | current->thread.abi = &mips_abi; \ |
| @@ -319,6 +322,8 @@ do { \ | |||
| 319 | do { \ | 322 | do { \ |
| 320 | set_thread_flag(TIF_32BIT_REGS); \ | 323 | set_thread_flag(TIF_32BIT_REGS); \ |
| 321 | set_thread_flag(TIF_32BIT_ADDR); \ | 324 | set_thread_flag(TIF_32BIT_ADDR); \ |
| 325 | clear_thread_flag(TIF_HYBRID_FPREGS); \ | ||
| 326 | set_thread_flag(TIF_32BIT_FPREGS); \ | ||
| 322 | \ | 327 | \ |
| 323 | mips_set_personality_fp(state); \ | 328 | mips_set_personality_fp(state); \ |
| 324 | \ | 329 | \ |
