Skip to contentSkip to conversation

MIPS: Call mips_set_personality_fp() in all O32 cases

PATCH In review Huacai Chen 2 participants 3 messages Mar 3, 2015 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: Call mips_set_personality_fp() in all O32 cases

Commit 46490b572544f (MIPS: kernel: elf: Improve the overall ABI and FPU mode checks) assumes mips_set_personality_fp() is only needed in CONFIG_MIPS_O32_FP64_SUPPORT case. However, this assumption is wrong, because O32 binaries always need the correct thread flags to set FR/FRE, whether CONFIG_MIPS_O32_FP64_SUPPORT is configured or not.

---
 arch/mips/kernel/elf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/kernel/elf.c +1 -1
index d2c09f6..cec5bc3 100644
@@ -245,7 +245,7 @@ void mips_set_personality_fp(struct arch_elf_state *state)
 	 * not be worried about N32/N64 binaries.
 	 */
 
-	if (!config_enabled(CONFIG_MIPS_O32_FP64_SUPPORT))
+	if (!config_enabled(CONFIG_32BIT) && !config_enabled(CONFIG_MIPS32_O32))
 		return;
 
 	switch (state->overall_fp_mode) {
Signature · 1 line
1.7.7.3
#1 lore raw
Quoted 30 lines · Huacai Chen

Commit 46490b572544f (MIPS: kernel: elf: Improve the overall ABI and FPU mode checks) assumes mips_set_personality_fp() is only needed in CONFIG_MIPS_O32_FP64_SUPPORT case. However, this assumption is wrong, because O32 binaries always need the correct thread flags to set FR/FRE, whether CONFIG_MIPS_O32_FP64_SUPPORT is configured or not.

---
 arch/mips/kernel/elf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/kernel/elf.c +1 -1
index d2c09f6..cec5bc3 100644
@@ -245,7 +245,7 @@ void mips_set_personality_fp(struct arch_elf_state *state)
 	 * not be worried about N32/N64 binaries.
 	 */
 
-	if (!config_enabled(CONFIG_MIPS_O32_FP64_SUPPORT))
+	if (!config_enabled(CONFIG_32BIT) && !config_enabled(CONFIG_MIPS32_O32))
 		return;
 
 	switch (state->overall_fp_mode) {
Signature · 1 line
1.7.7.3

Hi,

I have already posted a patch for this problem. Could you try that instead?

http://patchwork.linux-mips.org/patch/9344/

Signature · 1 line
markos
#2 lore raw

It seems your patch is better, please ignore mine.

Huacai

Quoted 40 lines · Markos Chandras
Quoted 25 lines · Huacai Chen

Commit 46490b572544f (MIPS: kernel: elf: Improve the overall ABI and FPU mode checks) assumes mips_set_personality_fp() is only needed in CONFIG_MIPS_O32_FP64_SUPPORT case. However, this assumption is wrong, because O32 binaries always need the correct thread flags to set FR/FRE, whether CONFIG_MIPS_O32_FP64_SUPPORT is configured or not.

---
 arch/mips/kernel/elf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/kernel/elf.c +1 -2
index d2c09f6..cec5bc3 100644
@@ -245,7 +245,7 @@ void mips_set_personality_fp(struct arch_elf_state *state)
       * not be worried about N32/N64 binaries.
       */
 
-     if (!config_enabled(CONFIG_MIPS_O32_FP64_SUPPORT))
+     if (!config_enabled(CONFIG_32BIT) && !config_enabled(CONFIG_MIPS32_O32))
              return;
 
      switch (state->overall_fp_mode) {
--
Quoted 5 lines

1.7.7.3

Hi,

I have already posted a patch for this problem. Could you try that instead?

http://patchwork.linux-mips.org/patch/9344/

--
markos