linux/arch/mips
Paul Burton 620b155034 MIPS: fix FP mode selection in lieu of .MIPS.abiflags data
Commit 46490b5725 ("MIPS: kernel: elf: Improve the overall ABI and FPU
mode checks") reworked the ELF FP ABI mode selection logic, but when
CONFIG_MIPS_O32_FP64_SUPPORT is enabled it breaks the use of binaries
which have no PT_MIPS_ABIFLAGS program header & associated
.MIPS.abiflags section.

A default mode is selected based upon whether the ELF contains MIPS32 or
MIPS64 code, but that selection is made in arch_elf_pt_proc.
arch_elf_pt_proc only executes when a PT_MIPS_ABIFLAGS program header is
found. If one is not found then arch_elf_pt_proc is never called, and no
default overall_fp_mode value is selected. When arch_check_elf is
called, both abi0 & abi1 are MIPS_ABI_FP_UNKNOWN which leads to both
prog_req & interp_req being set to none_req. none_req matches none of
the conditions for mode selection at the end of arch_check_elf, so
overall_fp_mode is left untouched. Finally once mips_set_personality_fp
is called the BUG() in the default case is then hit & the kernel likely
panics.

Fix this by moving the selection of a default overall mode to the start
of arch_check_elf, which runs once per ELF executed regardless of
whether it has a PT_MIPS_ABIFLAGS program header.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: Matthew Fortune <matthew.fortune@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: stable@vger.kernel.org # v4.0+
Patchwork: http://patchwork.linux-mips.org/patch/9978/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2015-05-12 18:54:05 +02:00
..
alchemy Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-02-21 19:41:38 -08:00
ar7 MIPS: AR7: Replace mac address parsing 2015-04-02 13:54:22 +02:00
ath25
ath79 MIPS: ath79: Increase max memory limit to 256MByte 2015-04-01 17:21:57 +02:00
bcm47xx Merge branch '4.0-fixes' into mips-for-linux-next 2015-04-13 16:03:32 +02:00
bcm63xx This is the final removal (after several years!) of the obsolete cpus_* 2015-04-20 10:19:03 -07:00
bmips MIPS: BMIPS: restrict DTB selection to BMIPS_GENERIC 2015-04-01 17:22:04 +02:00
boot MIPS: Reduce kernel image size for !CONFIG_DEBUG_ZBOOT 2015-04-02 13:54:25 +02:00
cavium-octeon This is the final removal (after several years!) of the obsolete cpus_* 2015-04-20 10:19:03 -07:00
cobalt
configs This is the bulk of GPIO changes for the v4.1 development 2015-04-18 08:22:10 -04:00
dec MIPS: DEC: Do not set up the FPU interrupt if no FPU 2015-04-08 01:10:46 +02:00
emma
fw MIPS: ARC: Use __noreturn / unreachable in ARC termination functions. 2015-01-13 16:04:27 +01:00
include MIPS: SMP: Fix build error. 2015-05-12 09:13:30 +02:00
jazz
jz4740 MIPS: jz4740: Implement read_sched_clock 2015-04-01 17:21:31 +02:00
kernel MIPS: fix FP mode selection in lieu of .MIPS.abiflags data 2015-05-12 18:54:05 +02:00
kvm MIPS: KVM: Wire up MSA capability 2015-03-27 21:25:22 +00:00
lantiq MIPS: mark prom_free_prom_memory() everywhere with __init 2015-04-01 17:21:58 +02:00
lasat Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-04-17 15:50:54 -04:00
lib MIPS: csum_partial: Improve instruction parallelism. 2015-04-01 17:22:11 +02:00
loongson This is the final removal (after several years!) of the obsolete cpus_* 2015-04-20 10:19:03 -07:00
loongson1
math-emu MIPS: Respect the ISA level in FCSR handling 2015-04-08 01:10:37 +02:00
mm Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-04-17 15:50:54 -04:00
mti-malta TTY/Serial patches for 4.1-rc1 2015-04-21 09:33:10 -07:00
mti-sead3 MIPS: SEAD3: Combine all platform device registrations in one file. 2015-04-02 17:07:26 +02:00
net module: remove mod arg from module_free, rename module_memfree(). 2015-01-20 11:38:33 +10:30
netlogic Merge branch '4.0-fixes' into mips-for-linux-next 2015-04-13 16:03:32 +02:00
oprofile MIPS: Add R16000 detection 2015-04-01 17:22:13 +02:00
paravirt mips: fix up obsolete cpu function usage. 2015-03-05 15:25:06 +10:30
pci Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-04-17 15:50:54 -04:00
pistachio MIPS: Add support for the IMG Pistachio SoC 2015-03-31 12:04:12 +02:00
pmcs-msp71xx
pnx833x
power MIPS: Hibernate: flush TLB entries earlier 2015-04-10 15:41:52 +02:00
ralink MIPS: ralink: add missing symbol for RALINK_ILL_ACC 2015-04-10 15:41:51 +02:00
rb532
sgi-ip22 MIPS: ip22-gio: Remove legacy suspend/resume support 2015-02-20 13:30:55 +01:00
sgi-ip27 This is the final removal (after several years!) of the obsolete cpus_* 2015-04-20 10:19:03 -07:00
sgi-ip32 Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-04-17 15:50:54 -04:00
sibyte
sni
txx9
vr41xx
Kbuild
Kbuild.platforms MIPS: bcm3384: Rename "bcm3384" target to "bmips" 2015-04-01 17:21:35 +02:00
Kconfig This is the bulk of GPIO changes for the v4.1 development 2015-04-18 08:22:10 -04:00
Kconfig.debug MIPS: kernel: elf: Improve the overall ABI and FPU mode checks 2015-02-17 15:37:39 +00:00
Makefile Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-04-17 15:50:54 -04:00