aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2014-09-11 03:30:23 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-11-24 01:45:08 -0500
commitf4af6fb2fc942e84612e8c1a80f0727a797a750a (patch)
tree6619b78591f73135db813cfca64664e40c8cf7a5 /arch/mips/kernel
parent90cee759f08a6b7a8daab9977d3e163ebbcac220 (diff)
MIPS: Kconfig option to better exercise/debug hybrid FPRs
The hybrid FPR scheme exists to allow for compatibility between existing FP32 code and newly compiled FP64A code. Such code should hopefully be rare in the real world, and for the moment is difficult to come across. All code except that built for the FP64 ABI can correctly execute using the hybrid FPR scheme, so debugging the hybrid FPR implementation can be eased by forcing all such code to use it. This is undesirable in general due to the trap & emulate overhead of the hybrid FPR implementation, but is a very useful option to have for debugging. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: linux-mips@linux-mips.org Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/7680/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r--arch/mips/kernel/elf.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/mips/kernel/elf.c b/arch/mips/kernel/elf.c
index 0933e0726f64..c92b15df6893 100644
--- a/arch/mips/kernel/elf.c
+++ b/arch/mips/kernel/elf.c
@@ -134,6 +134,24 @@ int arch_check_elf(void *_ehdr, bool has_interpreter,
134 134
135void mips_set_personality_fp(struct arch_elf_state *state) 135void mips_set_personality_fp(struct arch_elf_state *state)
136{ 136{
137 if (config_enabled(CONFIG_FP32XX_HYBRID_FPRS)) {
138 /*
139 * Use hybrid FPRs for all code which can correctly execute
140 * with that mode.
141 */
142 switch (state->overall_abi) {
143 case MIPS_ABI_FP_DOUBLE:
144 case MIPS_ABI_FP_SINGLE:
145 case MIPS_ABI_FP_SOFT:
146 case MIPS_ABI_FP_XX:
147 case MIPS_ABI_FP_ANY:
148 /* FR=1, FRE=1 */
149 clear_thread_flag(TIF_32BIT_FPREGS);
150 set_thread_flag(TIF_HYBRID_FPREGS);
151 return;
152 }
153 }
154
137 switch (state->overall_abi) { 155 switch (state->overall_abi) {
138 case MIPS_ABI_FP_DOUBLE: 156 case MIPS_ABI_FP_DOUBLE:
139 case MIPS_ABI_FP_SINGLE: 157 case MIPS_ABI_FP_SINGLE: