]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.61/mips-force-o32-fp64-support-on-32bit-mips64r6-kernels.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.4.61 / mips-force-o32-fp64-support-on-32bit-mips64r6-kernels.patch
CommitLineData
381a4dca
GKH
1From 2e6c7747730296a6d4fd700894286db1132598c4 Mon Sep 17 00:00:00 2001
2From: James Hogan <james.hogan@imgtec.com>
3Date: Thu, 16 Feb 2017 12:39:01 +0000
4Subject: MIPS: Force o32 fp64 support on 32bit MIPS64r6 kernels
5
6From: James Hogan <james.hogan@imgtec.com>
7
8commit 2e6c7747730296a6d4fd700894286db1132598c4 upstream.
9
10When a 32-bit kernel is configured to support MIPS64r6 (CPU_MIPS64_R6),
11MIPS_O32_FP64_SUPPORT won't be selected as it should be because
12MIPS32_O32 is disabled (o32 is already the default ABI available on
1332-bit kernels).
14
15This results in userland FP breakage as CP0_Status.FR is read-only 1
16since r6 (when an FPU is present) so __enable_fpu() will fail to clear
17FR. This causes the FPU emulator to get used which will incorrectly
18emulate 32-bit FPU registers.
19
20Force o32 fp64 support in this case by also selecting
21MIPS_O32_FP64_SUPPORT from CPU_MIPS64_R6 if 32BIT.
22
23Fixes: 4e9d324d4288 ("MIPS: Require O32 FP64 support for MIPS64 with O32 compat")
24Signed-off-by: James Hogan <james.hogan@imgtec.com>
25Reviewed-by: Paul Burton <paul.burton@imgtec.com>
26Cc: Ralf Baechle <ralf@linux-mips.org>
27Cc: linux-mips@linux-mips.org
28Patchwork: https://patchwork.linux-mips.org/patch/15310/
29Signed-off-by: James Hogan <james.hogan@imgtec.com>
30Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
31
32---
33 arch/mips/Kconfig | 2 +-
34 1 file changed, 1 insertion(+), 1 deletion(-)
35
36--- a/arch/mips/Kconfig
37+++ b/arch/mips/Kconfig
38@@ -1412,7 +1412,7 @@ config CPU_MIPS32_R6
39 select CPU_SUPPORTS_MSA
40 select GENERIC_CSUM
41 select HAVE_KVM
42- select MIPS_O32_FP64_SUPPORT
43+ select MIPS_O32_FP64_SUPPORT if 32BIT
44 help
45 Choose this option to build a kernel for release 6 or later of the
46 MIPS32 architecture. New MIPS processors, starting with the Warrior