diff options
-rw-r--r-- | arch/mips/Kconfig.debug | 13 | ||||
-rw-r--r-- | arch/mips/kernel/elf.c | 18 |
2 files changed, 31 insertions, 0 deletions
diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug index 3a2b775e8458..88a9f433f6fc 100644 --- a/arch/mips/Kconfig.debug +++ b/arch/mips/Kconfig.debug | |||
@@ -122,4 +122,17 @@ config SPINLOCK_TEST | |||
122 | help | 122 | help |
123 | Add several files to the debugfs to test spinlock speed. | 123 | Add several files to the debugfs to test spinlock speed. |
124 | 124 | ||
125 | config FP32XX_HYBRID_FPRS | ||
126 | bool "Run FP32 & FPXX code with hybrid FPRs" | ||
127 | depends on MIPS_O32_FP64_SUPPORT | ||
128 | help | ||
129 | The hybrid FPR scheme is normally used only when a program needs to | ||
130 | execute a mix of FP32 & FP64A code, since the trapping & emulation | ||
131 | that it entails is expensive. When enabled, this option will lead | ||
132 | to the kernel running programs which use the FP32 & FPXX FP ABIs | ||
133 | using the hybrid FPR scheme, which can be useful for debugging | ||
134 | purposes. | ||
135 | |||
136 | If unsure, say N. | ||
137 | |||
125 | endmenu | 138 | endmenu |
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 | ||
135 | void mips_set_personality_fp(struct arch_elf_state *state) | 135 | void 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: |