1. 29 6月, 2017 7 次提交
  2. 15 6月, 2017 1 次提交
    • P
      MIPS: Fix bnezc/jialc return address calculation · 1a73d931
      Paul Burton 提交于
      The code handling the pop76 opcode (ie. bnezc & jialc instructions) in
      __compute_return_epc_for_insn() needs to set the value of $31 in the
      jialc case, which is encoded with rs = 0. However its check to
      differentiate bnezc (rs != 0) from jialc (rs = 0) was unfortunately
      backwards, meaning that if we emulate a bnezc instruction we clobber $31
      & if we emulate a jialc instruction it actually behaves like a jic
      instruction.
      
      Fix this by inverting the check of rs to match the way the instructions
      are actually encoded.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Fixes: 28d6f93d ("MIPS: Emulate the new MIPS R6 BNEZC and JIALC instructions")
      Cc: stable <stable@vger.kernel.org> # v4.0+
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16178/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      1a73d931
  3. 02 3月, 2017 1 次提交
  4. 25 12月, 2016 1 次提交
  5. 06 10月, 2016 1 次提交
    • M
      MIPS: tracing: disable uprobe/kprobe on compact branch instructions · d05c5130
      Marcin Nowakowski 提交于
      Current instruction decoder for uprobe/kprobe handler only handles
      branches with delay slots. For compact branches the behaviour is rather
      unpredictable - and depending on the encoding of a compact branch
      instruction may result in one (or more) of:
      - executing an instruction that follows a branch which wasn't in a delay
        slot and shouldn't have been executed
      - incorrectly emulating a branch leading to a jump to a wrong location
      - unexpected branching out of the single-stepped code and never reaching
        the breakpoint that should terminate the probe handler
      
      Results of these actions are generally unpredictable, but can end up
      with a probed application or kernel crash, so disable placing probes on
      compact branches until they are handled properly.
      Signed-off-by: NMarcin Nowakowski <marcin.nowakowski@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/14336/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      d05c5130
  6. 05 10月, 2016 1 次提交
    • P
      MIPS: kernel: Audit and remove any unnecessary uses of module.h · d9d54177
      Paul Gortmaker 提交于
      Historically a lot of these existed because we did not have
      a distinction between what was modular code and what was providing
      support to modules via EXPORT_SYMBOL and friends.  That changed
      when we forked out support for the latter into the export.h file.
      
      This means we should be able to reduce the usage of module.h
      in code that is obj-y Makefile or bool Kconfig.  The advantage
      in doing so is that module.h itself sources about 15 other headers;
      adding significantly to what we feed cpp, and it can obscure what
      headers we are effectively using.
      
      Since module.h was the source for init.h (for __init) and for
      export.h (for EXPORT_SYMBOL) we consider each obj-y/bool instance
      for the presence of either and replace as needed.
      
      In the case of the n32/o32 files, we have to get rid of a couple
      no-op MODULE_ tags to facilitate the module.h removal.  They piggy
      back off the fs/ elf binary support, which is also a bool Kconfig.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/14032/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      d9d54177
  7. 05 7月, 2016 2 次提交
  8. 28 5月, 2016 1 次提交
  9. 13 5月, 2016 1 次提交
  10. 09 7月, 2015 1 次提交
  11. 01 4月, 2015 1 次提交
  12. 17 2月, 2015 12 次提交
  13. 07 11月, 2014 1 次提交
    • M
      MIPS: Fix build with binutils 2.24.51+ · 842dfc11
      Manuel Lauss 提交于
      Starting with version 2.24.51.20140728 MIPS binutils complain loudly
      about mixing soft-float and hard-float object files, leading to this
      build failure since GCC is invoked with "-msoft-float" on MIPS:
      
      {standard input}: Warning: .gnu_attribute 4,3 requires `softfloat'
        LD      arch/mips/alchemy/common/built-in.o
      mipsel-softfloat-linux-gnu-ld: Warning: arch/mips/alchemy/common/built-in.o
       uses -msoft-float (set by arch/mips/alchemy/common/prom.o),
       arch/mips/alchemy/common/sleeper.o uses -mhard-float
      
      To fix this, we detect if GAS is new enough to support "-msoft-float" command
      option, and if it does, we can let GCC pass it to GAS;  but then we also need
      to sprinkle the files which make use of floating point registers with the
      necessary ".set hardfloat" directives.
      Signed-off-by: NManuel Lauss <manuel.lauss@gmail.com>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Cc: Matthew Fortune <Matthew.Fortune@imgtec.com>
      Cc: Markos Chandras <Markos.Chandras@imgtec.com>
      Cc: Maciej W. Rozycki <macro@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/8355/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      842dfc11
  14. 31 5月, 2014 1 次提交
  15. 23 5月, 2014 2 次提交
    • R
      MIPS: Sort out mm_isBranchInstr. · 76fbfc31
      Ralf Baechle 提交于
      mm_isBranchInstr() did reside in the math emu code even though it logically
      is separate and also is used outside the math emu code.  In addition GCC 4.9.0
      leaves the following unnnecessarily bloated function body for a non-microMIPS
      configuration:
      
      <mm_isBranchInstr>:
          105c:       afa50004        sw      a1,4(sp)
          1060:       afa60008        sw      a2,8(sp)
          1064:       afa7000c        sw      a3,12(sp)
          1068:       03e00008        jr      ra
          106c:       00001021        move    v0,zero
      
      which stores arguments that are never going to be used on the stack frame.
      
      Move mm_isBranchInstr() from cp1emu.c to branch.c, then split mm_isBranchInstr()
      into a __mm_isBranchInstr() core and a mm_isBranchInstr() wrapper inline function
      which only invokes __mm_isBranchInstr() on microMIPS configurations.
      
      This shaves off 112 bytes off the kernel and improves code flow a bit.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      76fbfc31
    • R
      MIPS: Fix branch emulation of branch likely instructions. · 41ca86e8
      Ralf Baechle 提交于
      Two issues:
      
        o For beql_op, beql_op, bne_op, bnel_op, blez_op, blezl_op, bgtz_op and
          bgtzl_op the wrong field was being checked for the instruction opcode.
        o For blez_op / blezl_op and bgtz_op / bgtzl_op the test was testing
          for the wrong opcode.
      
      This bug got introduced by d8d4e3ae [MIPS
      Kprobes: Refactor branch emulation].
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Acked-by: NLeonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Acked-by: NVictor Kamensky <kamensky@cisco.com>
      41ca86e8
  16. 01 7月, 2013 1 次提交
  17. 09 5月, 2013 2 次提交
  18. 01 2月, 2013 1 次提交
  19. 08 12月, 2011 1 次提交
    • M
      MIPS Kprobes: Refactor branch emulation · d8d4e3ae
      Maneesh Soni 提交于
      This patch refactors MIPS branch emulation code so as to allow skipping
      delay slot instruction in case of branch likely instructions when branch is
      not taken. This is useful for keeping the code common for use cases like
      kprobes where one would like to handle the branch instructions keeping the
      delay slot instuction also in picture for branch likely instructions. Also
      allow emulation when instruction to be decoded is not at pt_regs->cp0_epc
      as in case of kprobes where pt_regs->cp0_epc points to the breakpoint
      instruction.
      
      The patch also exports the function for modules.
      Signed-off-by: NManeesh Soni <manesoni@cisco.com>
      Signed-off-by: NVictor Kamensky <kamensky@cisco.com>
      Cc: David Daney <david.daney@cavium.com>
      Cc: ananth@in.ibm.com
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/2913/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      d8d4e3ae
  20. 18 10月, 2010 1 次提交