1. 06 9月, 2017 2 次提交
    • C
      MIPS: Add DWARF unwinding to assembly · 866b6a89
      Corey Minyard 提交于
      This will allow kdump dumps to work correclty with MIPS and
      future DWARF unwinding of the stack to give accurate tracebacks.
      Signed-off-by: NCorey Minyard <cminyard@mvista.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/16990/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      866b6a89
    • C
      MIPS: Make SAVE_SOME more standard · 9fef6868
      Corey Minyard 提交于
      Modify the SAVE_SOME macro to look more like a standard
      function, doing the arithmetic for the frame on the SP
      register instead of copying it from K1, and by saving
      the stored EPC from the RA.  This lets the get_frame_info()
      function process this function like any other.  It also
      remove an instruction or two from the kernel entry,
      making it more efficient.
      
      unwind_stack_by_address() has special handling for
      the top of the interrupt stack, but without this change
      unwinding will still fail if you get an interrupt while
      handling an interrupt and try to do a traceback from
      the second interrupt.
      
      This change modifies the get_saved_sp macro to
      optionally store the fetched value right into sp and store the
      old SP value into K0.  Then it's just a matter of subtracting
      the frame from SP and storing the old SP from K0.
      
      This required changing the DADDI workaround a bit, since K0
      holds the SP, we had to use K1 for AT.  But it eliminated
      some of the special handling for the DADDI workaround.
      
      Saving the RA register was moved up to before fetching the
      CP0_EPC register, so the CP0_EPC register could be stored
      into RA and the saved.  This lets the traceback code know
      where RA is actually stored.
      Signed-off-by: NCorey Minyard <cminyard@mvista.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/16991/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      9fef6868
  2. 03 1月, 2017 3 次提交
    • P
      MIPS: Remove RESTORE_ALL_AND_RET · 3ae34beb
      Paul Burton 提交于
      The RESTORE_ALL_AND_RET macro is never used. Remove the dead code.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/14411/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      3ae34beb
    • P
      MIPS: Remove r2_emul_return from struct thread_info · e11124d8
      Paul Burton 提交于
      The r2_emul_return field in struct thread_info was used in order to take
      an alternate codepath when returning to userland, which (besides not
      implementing certain features) effectively used the eretnc instruction
      in place of eret. The difference is that eretnc doesn't clear LLBit, and
      therefore doesn't cause a linked load & store sequence to fail due to
      emulation like eret would.
      
      The reason eret would usually be used to clear LLBit is so that after
      context switching we ensure that a load performed by one task doesn't
      influence another task. However commit 7c151d3d ("MIPS: Make use of
      the ERETNC instruction on MIPS R6") which introduced the r2_emul_return
      field and conditional use of eretnc also for some reason began
      explicitly clearing LLBit during context switches - despite retaining
      the use of eret for everything but returns from the pre-r6 instruction
      emulation code.
      
      As LLBit is cleared upon context switches anyway, simplify this by using
      eretnc unconditionally for MIPSr6 kernels. This allows us to remove the
      4 byte r2_emul_return boolean from struct thread_info, simplify the
      return to user code in entry.S and avoid the overhead of tracking &
      checking state which we don't need.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/14408/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e11124d8
    • M
      MIPS: Only change $28 to thread_info if coming from user mode · 510d8636
      Matt Redfearn 提交于
      The SAVE_SOME macro is used to save the execution context on all
      exceptions.
      If an exception occurs while executing user code, the stack is switched
      to the kernel's stack for the current task, and register $28 is switched
      to point to the current_thread_info, which is at the bottom of the stack
      region.
      If the exception occurs while executing kernel code, the stack is left,
      and this change ensures that register $28 is not updated. This is the
      correct behaviour when the kernel can be executing on the separate irq
      stack, because the thread_info will not be at the base of it.
      
      With this change, register $28 is only switched to it's kernel
      conventional usage of the currrent thread info pointer at the point at
      which execution enters kernel space. Doing it on every exception was
      redundant, but OK without an IRQ stack, but will be erroneous once that
      is introduced.
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Acked-by: NJason A. Donenfeld <jason@zx2c4.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/14742/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      510d8636
  3. 02 2月, 2016 1 次提交
    • J
      MIPS: Fix FPU disable with preemption · 00fe56dc
      James Hogan 提交于
      The FPU should not be left enabled after a task context switch. This
      isn't usually a problem as the FPU enable bit is updated before
      returning to userland, however it can potentially mask kernel bugs, and
      in fact KVM assumes it won't happen and won't clear the FPU enable bit
      before returning to the guest, which allows the guest to use stale FPU
      context.
      
      Interrupts and exceptions save and restore most bits of the CP0 Status
      register which contains the FPU enable bit (CU1). When the kernel needs
      to enable or disable the FPU (for example due to attempted FPU use by
      userland, or the scheduler being invoked) both the actual Status
      register and the saved value in the userland context are updated.
      
      However this doesn't work correctly with full kernel preemption enabled,
      since the FPU enable bit can be cleared from within an interrupt when
      the scheduler is invoked, and only the userland context is updated, not
      the interrupt context.
      
      For example:
      1) Enter kernel with FPU already enabled, TIF_USEDFPU=1, Status.CU1=1
         saved.
      2) Take a timer interrupt while in kernel mode, Status.CU1=1 saved.
      3) Timer interrupt invokes scheduler to preempt the task, which clears
         TIF_USEDFPU, disables the FPU in Status register (Status.CU1=0), and
         the value stored in user context from step (1), but not the interrupt
         context from step (2).
      4) When the process is scheduled back in again Status.CU1=0.
      5) The interrupt context from step (2) is restored, which sets
         Status.CU1=1. So from user context point of view, preemption has
         re-enabled FPU!
      6) If the scheduler is invoked again (via preemption or voluntarily)
         before returning to userland, TIF_USEDFPU=0 so the FPU is not
         disabled before the task context switch.
      7) The next task resumes from the context switch with FPU enabled!
      
      The restoring of the Status register on return from interrupt/exception
      is already selective about which bits to restore, leaving the interrupt
      mask bits alone so enabling/disabling of CPU interrupt lines can
      persist. Extend this to also leave both the CU1 bit (FPU enable) and the
      FR bit (which specifies the FPU mode and gets changed with CU1). This
      prevents a stale Status value being restored in step (5) above and
      persisting through subsequent context switches.
      
      Also switch to the use of definitions from asm/mipsregs.h while we're at
      it.
      
      Since this change also affects the restoration of Status register on the
      path back to userland, it increases the sensitivity of the kernel to the
      problem of the FPU being left enabled, allowing it to propagate to
      userland, therefore a warning is also added to lose_fpu_inatomic() to
      point out any future reoccurances before they do any damage.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Reviewed-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/12303/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      00fe56dc
  4. 03 8月, 2015 1 次提交
    • J
      MIPS: Flush RPS on kernel entry with EVA · 3aff47c0
      James Hogan 提交于
      When EVA is enabled, flush the Return Prediction Stack (RPS) present on
      some MIPS cores on entry to the kernel from user mode.
      
      This is important specifically for interAptiv with EVA enabled,
      otherwise kernel mode RPS mispredicts may trigger speculative fetches of
      user return addresses, which may be sensitive in the kernel address
      space due to EVA's overlapping user/kernel address spaces.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: Leonid Yegoshin <leonid.yegoshin@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: <stable@vger.kernel.org> # 3.15.x-
      Patchwork: https://patchwork.linux-mips.org/patch/10812/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      3aff47c0
  5. 17 2月, 2015 1 次提交
  6. 24 5月, 2014 1 次提交
    • R
      MIPS: MT: Remove SMTC support · b633648c
      Ralf Baechle 提交于
      Nobody is maintaining SMTC anymore and there also seems to be no userbase.
      Which is a pity - the SMTC technology primarily developed by Kevin D.
      Kissell <kevink@paralogos.com> is an ingenious demonstration for the MT
      ASE's power and elegance.
      
      Based on Markos Chandras <Markos.Chandras@imgtec.com> patch
      https://patchwork.linux-mips.org/patch/6719/ which while very similar did
      no longer apply cleanly when I tried to merge it plus some additional
      post-SMTC cleanup - SMTC was a feature as tricky to remove as it was to
      merge once upon a time.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      b633648c
  7. 01 4月, 2014 1 次提交
    • R
      MIPS: Fix gigaton of warning building with microMIPS. · a809d460
      Ralf Baechle 提交于
      With binutils 2.24 the attempt to switch with microMIPS mode to MIPS III
      mode through .set mips3 results in *lots* of warnings like
      
      {standard input}: Assembler messages:
      {standard input}:397: Warning: the 64-bit MIPS architecture does not support the `smartmips' extension
      
      during a kernel build.  Fixed by using .set arch=r4000 instead.
      
      This breaks support for building the kernel with binutils 2.13 which
      was supported for 32 bit kernels only anyway and 2.14 which was a bad
      vintage for MIPS anyway.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      a809d460
  8. 30 10月, 2013 1 次提交
  9. 01 7月, 2013 1 次提交
  10. 09 5月, 2013 1 次提交
  11. 01 2月, 2013 1 次提交
  12. 21 9月, 2011 1 次提交
  13. 31 3月, 2011 1 次提交
  14. 01 5月, 2010 1 次提交
  15. 13 4月, 2010 1 次提交
  16. 17 12月, 2009 2 次提交
  17. 11 1月, 2009 1 次提交
  18. 11 10月, 2008 1 次提交
  19. 04 10月, 2008 1 次提交
  20. 29 1月, 2008 1 次提交
    • M
      [MIPS] R4000/R4400 daddiu erratum workaround · 619b6e18
      Maciej W. Rozycki 提交于
       This complements the generic R4000/R4400 errata workaround code and adds 
      bits for the daddiu problem.  In most places it just modifies handwritten 
      assembly code so that the assembler is allowed to use a temporary register 
      as daddiu may now be treated as a macro that expands to a sequence of li 
      and daddu.  It is the AT register or, where AT is unavailable or used 
      explicitly for another purpose, an explicitly-named register is selected, 
      using the .set at=<reg> feature added recently to gas.  This feature is 
      only used if CONFIG_CPU_DADDI_WORKAROUNDS has been set, so if the 
      workaround remains disabled, the required version of binutils stays 
      unchanged.
      
       Similarly, daddiu instructions put in branch delay slots in noreorder 
      fragments are now taken out of them and the assembler is allowed to 
      reorder them itself as possible (which it does making the whole idea of 
      scheduling them into delay slots manually questionable).
      
       Also in the very few places where such a simple conversion was not 
      possible, a handcoded longer sequence is implemented.
      
       Other than that there are changes to code responsible for building the 
      TLB fault and page clear/copy handlers to avoid daddiu as appropriate.  
      These are only effective if the erratum is verified to be present at the 
      run time.
      
       Finally there is a trivial update to __delay(), because it uses daddiu in 
      a branch delay slot.
      Signed-off-by: NMaciej W. Rozycki <macro@linux-mips.org>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      619b6e18
  21. 12 10月, 2007 2 次提交
  22. 12 6月, 2007 1 次提交
  23. 22 2月, 2007 1 次提交
    • F
      [MIPS] Add basic SMARTMIPS ASE support · 9693a853
      Franck Bui-Huu 提交于
      This patch adds trivial support for SMARTMIPS extension. This extension
      is currently implemented by 4KS[CD] CPUs.
      
      Basically it saves/restores ACX register, which is part of the SMARTMIPS
      ASE, when needed. This patch does *not* add any support for Smartmips MMU
      features.
      
      Futhermore this patch does not add explicit support for 4KS[CD] CPUs since
      they are respectively mips32 and mips32r2 compliant.  So with the current
      processor configuration, a platform that has such CPUs needs to select
      both configs:
      
      	CPU_HAS_SMARTMIPS
      	SYS_HAS_CPU_MIPS32_R[12]
      
      This is due to the processor configuration which is mixing up all the
      architecture variants and the processor types.
      
      The drawback of this, is that we currently pass '-march=mips32' option to
      gcc when building a kernel instead of '-march=4ksc' for 4KSC case. This
      can lead to a kernel image a little bit bigger than required.
      Signed-off-by: NFranck Bui-Huu <fbuihuu@gmail.com>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      9693a853
  24. 12 10月, 2006 1 次提交
  25. 30 6月, 2006 1 次提交
  26. 26 4月, 2006 1 次提交
  27. 19 4月, 2006 1 次提交
  28. 21 3月, 2006 1 次提交
  29. 30 10月, 2005 3 次提交
  30. 10 9月, 2005 1 次提交
  31. 05 9月, 2005 1 次提交
  32. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4