Skip to content
Snippets Groups Projects
  1. Jan 19, 2016
  2. May 12, 2015
    • Paul Burton's avatar
      MIPS: fix FP mode selection in lieu of .MIPS.abiflags data · 620b1550
      Paul Burton authored
      
      Commit 46490b57 ("MIPS: kernel: elf: Improve the overall ABI and FPU
      mode checks") reworked the ELF FP ABI mode selection logic, but when
      CONFIG_MIPS_O32_FP64_SUPPORT is enabled it breaks the use of binaries
      which have no PT_MIPS_ABIFLAGS program header & associated
      .MIPS.abiflags section.
      
      A default mode is selected based upon whether the ELF contains MIPS32 or
      MIPS64 code, but that selection is made in arch_elf_pt_proc.
      arch_elf_pt_proc only executes when a PT_MIPS_ABIFLAGS program header is
      found. If one is not found then arch_elf_pt_proc is never called, and no
      default overall_fp_mode value is selected. When arch_check_elf is
      called, both abi0 & abi1 are MIPS_ABI_FP_UNKNOWN which leads to both
      prog_req & interp_req being set to none_req. none_req matches none of
      the conditions for mode selection at the end of arch_check_elf, so
      overall_fp_mode is left untouched. Finally once mips_set_personality_fp
      is called the BUG() in the default case is then hit & the kernel likely
      panics.
      
      Fix this by moving the selection of a default overall mode to the start
      of arch_check_elf, which runs once per ELF executed regardless of
      whether it has a PT_MIPS_ABIFLAGS program header.
      
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: Matthew Fortune <matthew.fortune@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: stable@vger.kernel.org # v4.0+
      Patchwork: http://patchwork.linux-mips.org/patch/9978/
      
      
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      620b1550
  3. Apr 07, 2015
  4. Feb 17, 2015
    • Markos Chandras's avatar
      MIPS: kernel: elf: Improve the overall ABI and FPU mode checks · 46490b57
      Markos Chandras authored
      
      The previous implementation did not cover all possible FPU combinations
      and it silently allowed ABI incompatible objects to be loaded with the
      wrong ABI. For example, the previous logic would set the FP_64 ABI as
      the matching ABI for an FP_XX object combined with an FP_64A object.
      This was wrong, and the matching ABI should have been FP_64A.
      The previous logic is now replaced with a new one which determines
      the appropriate FPU mode to be used rather than the FP ABI. This has
      the advantage that the entire logic is much simpler since it is the FPU
      mode we are interested in rather than the FP ABI resulting to code
      simplifications. This also removes the now obsolete FP32XX_HYBRID_FPRS
      option.
      
      Cc: Matthew Fortune <Matthew.Fortune@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      46490b57
  5. Jan 15, 2015
  6. Nov 24, 2014
Loading