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

MIPS: Force o32 fp64 support on 32bit MIPS64r6 kernels

When a 32-bit kernel is configured to support MIPS64r6 (CPU_MIPS64_R6),
MIPS_O32_FP64_SUPPORT won't be selected as it should be because
MIPS32_O32 is disabled (o32 is already the default ABI available on
32-bit kernels).

This results in userland FP breakage as CP0_Status.FR is read-only 1
since r6 (when an FPU is present) so __enable_fpu() will fail to clear
FR. This causes the FPU emulator to get used which will incorrectly
emulate 32-bit FPU registers.

Force o32 fp64 support in this case by also selecting
MIPS_O32_FP64_SUPPORT from CPU_MIPS64_R6 if 32BIT.

Fixes: 4e9d324d4288 ("MIPS: Require O32 FP64 support for MIPS64 with O32 compat")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Paul Burton <paul.burton@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org> # 4.0.x-
Patchwork: https://patchwork.linux-mips.org/patch/15310/
Signed-off-by: James Hogan <james.hogan@imgtec.com>

authored by

James Hogan and committed by
Ralf Baechle
2e6c7747 c1ae3cfa

+1 -1
+1 -1
arch/mips/Kconfig
··· 1531 1531 select CPU_SUPPORTS_HIGHMEM 1532 1532 select CPU_SUPPORTS_MSA 1533 1533 select GENERIC_CSUM 1534 - select MIPS_O32_FP64_SUPPORT if MIPS32_O32 1534 + select MIPS_O32_FP64_SUPPORT if 32BIT || MIPS32_O32 1535 1535 select HAVE_KVM 1536 1536 help 1537 1537 Choose this option to build a kernel for release 6 or later of the