All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: bypass FP mode checks when CONFIG_MIPS_O32_FP64_SUPPORT==n
@ 2015-01-19  5:31 ` Paul Burton
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Burton @ 2015-01-19  5:31 UTC (permalink / raw)
  To: linux-mips; +Cc: Paul Burton, Manuel Lauss, Matthew Fortune

The FP mode checks introduced to support the FP modes indicated by the
new PT_MIPS_ABIFLAGS program header & .MIPS.abiflags section have been
found to cause some compatibility issues when mixing binaries with such
mode information & an ELF interpreter without it, or vice-versa[1]. The
mode checks serve little purpose unless the kernel actually supports the
FP64 modes as indicated by CONFIG_MIPS_O32_FP64_SUPPORT, which currently
defaults to disabled & is marked experimental. Bypass the mode checks
when the FP64 support is disabled in order to avoid compatibility issues
with v3.19 until the logic is fixed.

[1]: http://www.linux-mips.org/archives/linux-mips/2015-01/msg00279.html

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Manuel Lauss <manuel.lauss@gmail.com>
Cc: Matthew Fortune <Matthew.Fortune@imgtec.com>
---
Ralf: if people agree with this approach, it would be great to get this
      in for v3.19.
---
 arch/mips/kernel/elf.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/mips/kernel/elf.c b/arch/mips/kernel/elf.c
index c92b15d..bb73c7c 100644
--- a/arch/mips/kernel/elf.c
+++ b/arch/mips/kernel/elf.c
@@ -68,6 +68,15 @@ int arch_check_elf(void *_ehdr, bool has_interpreter,
 	struct elfhdr *ehdr = _ehdr;
 	unsigned fp_abi, interp_fp_abi, abi0, abi1;
 
+	if (!config_enabled(CONFIG_MIPS_O32_FP64_SUPPORT)) {
+		/*
+		 * Temporarily bypass this logic when the o32 FP64 support is
+		 * not enabled, until all compatibility issues are resolved.
+		 */
+		state->overall_abi = MIPS_ABI_FP_DOUBLE;
+		return 0;
+	}
+
 	/* Ignore non-O32 binaries */
 	if (config_enabled(CONFIG_64BIT) &&
 	    (ehdr->e_ident[EI_CLASS] != ELFCLASS32))
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] MIPS: bypass FP mode checks when CONFIG_MIPS_O32_FP64_SUPPORT==n
@ 2015-01-19  5:31 ` Paul Burton
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Burton @ 2015-01-19  5:31 UTC (permalink / raw)
  To: linux-mips; +Cc: Paul Burton, Manuel Lauss, Matthew Fortune

The FP mode checks introduced to support the FP modes indicated by the
new PT_MIPS_ABIFLAGS program header & .MIPS.abiflags section have been
found to cause some compatibility issues when mixing binaries with such
mode information & an ELF interpreter without it, or vice-versa[1]. The
mode checks serve little purpose unless the kernel actually supports the
FP64 modes as indicated by CONFIG_MIPS_O32_FP64_SUPPORT, which currently
defaults to disabled & is marked experimental. Bypass the mode checks
when the FP64 support is disabled in order to avoid compatibility issues
with v3.19 until the logic is fixed.

[1]: http://www.linux-mips.org/archives/linux-mips/2015-01/msg00279.html

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Manuel Lauss <manuel.lauss@gmail.com>
Cc: Matthew Fortune <Matthew.Fortune@imgtec.com>
---
Ralf: if people agree with this approach, it would be great to get this
      in for v3.19.
---
 arch/mips/kernel/elf.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/mips/kernel/elf.c b/arch/mips/kernel/elf.c
index c92b15d..bb73c7c 100644
--- a/arch/mips/kernel/elf.c
+++ b/arch/mips/kernel/elf.c
@@ -68,6 +68,15 @@ int arch_check_elf(void *_ehdr, bool has_interpreter,
 	struct elfhdr *ehdr = _ehdr;
 	unsigned fp_abi, interp_fp_abi, abi0, abi1;
 
+	if (!config_enabled(CONFIG_MIPS_O32_FP64_SUPPORT)) {
+		/*
+		 * Temporarily bypass this logic when the o32 FP64 support is
+		 * not enabled, until all compatibility issues are resolved.
+		 */
+		state->overall_abi = MIPS_ABI_FP_DOUBLE;
+		return 0;
+	}
+
 	/* Ignore non-O32 binaries */
 	if (config_enabled(CONFIG_64BIT) &&
 	    (ehdr->e_ident[EI_CLASS] != ELFCLASS32))
-- 
2.2.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS: bypass FP mode checks when CONFIG_MIPS_O32_FP64_SUPPORT==n
  2015-01-19  5:31 ` Paul Burton
  (?)
@ 2015-01-19  7:08 ` Manuel Lauss
  -1 siblings, 0 replies; 3+ messages in thread
From: Manuel Lauss @ 2015-01-19  7:08 UTC (permalink / raw)
  To: Paul Burton; +Cc: Linux-MIPS, Matthew Fortune

On Mon, Jan 19, 2015 at 6:31 AM, Paul Burton <paul.burton@imgtec.com> wrote:
> The FP mode checks introduced to support the FP modes indicated by the
> new PT_MIPS_ABIFLAGS program header & .MIPS.abiflags section have been
> found to cause some compatibility issues when mixing binaries with such
> mode information & an ELF interpreter without it, or vice-versa[1]. The
> mode checks serve little purpose unless the kernel actually supports the
> FP64 modes as indicated by CONFIG_MIPS_O32_FP64_SUPPORT, which currently
> defaults to disabled & is marked experimental. Bypass the mode checks
> when the FP64 support is disabled in order to avoid compatibility issues
> with v3.19 until the logic is fixed.
>
> [1]: http://www.linux-mips.org/archives/linux-mips/2015-01/msg00279.html
>
> Signed-off-by: Paul Burton <paul.burton@imgtec.com>
> Cc: Manuel Lauss <manuel.lauss@gmail.com>
> Cc: Matthew Fortune <Matthew.Fortune@imgtec.com>

Tested-by: Manuel Lauss <manuel.lauss@gmail.com>

Fixes my soft-float userspace issue.

Thanks Paul!

     Manuel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-19  7:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-19  5:31 [PATCH] MIPS: bypass FP mode checks when CONFIG_MIPS_O32_FP64_SUPPORT==n Paul Burton
2015-01-19  5:31 ` Paul Burton
2015-01-19  7:08 ` Manuel Lauss

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.