1. 24 1月, 2016 6 次提交
    • M
      MIPS: math-emu: dsemul: Reduce `get_isa16_mode' clutter · 6d7b1415
      Maciej W. Rozycki 提交于
      Signed-off-by: NMaciej W. Rozycki <macro@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/12178/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      6d7b1415
    • M
      MIPS: math-emu: dsemul: Correct description of the emulation frame · 6e1715f7
      Maciej W. Rozycki 提交于
      Remove irrelevant content from the description of the emulation frame in
      `mips_dsemul', referring to bare-metal configurations.  Update the text,
      reflecting the change made with commit ba3049ed ("MIPS: Switch FPU
      emulator trap to BREAK instruction."), where we switched from using an
      address error exception on an unaligned access to the use of a BREAK 514
      instruction causing a breakpoint exception instead.
      Signed-off-by: NMaciej W. Rozycki <macro@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/12176/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      6e1715f7
    • M
      MIPS: math-emu: Correct the emulation of microMIPS ADDIUPC instruction · 69a1e6cb
      Maciej W. Rozycki 提交于
      Emulate the microMIPS ADDIUPC instruction directly in `mips_dsemul'.  If
      executed in the emulation frame, this instruction produces an incorrect
      result, because the value of the PC there is not the same as where the
      instruction originated.
      
      Reshape code so as to handle all microMIPS cases together.
      Signed-off-by: NMaciej W. Rozycki <macro@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/12175/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      69a1e6cb
    • M
      MIPS: math-emu: Make microMIPS branch delay slot emulation work · 733b8bc1
      Maciej W. Rozycki 提交于
      Complement commit 102cedc3 ("MIPS: microMIPS: Floating point
      support.") which introduced microMIPS FPU emulation, but did not adjust
      the encoding of the BREAK instruction used to terminate the branch delay
      slot emulation frame.  Consequently the execution of any such frame is
      indeterminate and, depending on CPU configuration, will result in random
      code execution or an offending program being terminated with SIGILL.
      
      This is because the regular MIPS BREAK instruction is encoded with the 0
      major and the 0xd minor opcode, however in the microMIPS instruction set
      this major/minor opcode pair denotes an encoding reserved for the DSP
      ASE.  Instead the microMIPS BREAK instruction is encoded with the 0
      major and the 0x7 minor opcode.
      
      Use the correct BREAK encoding for microMIPS FPU emulation then.
      Signed-off-by: NMaciej W. Rozycki <macro@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/12174/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      733b8bc1
    • M
      MIPS: math-emu: dsemul: Fix ill formatting of microMIPS part · a87265cf
      Maciej W. Rozycki 提交于
      Correct formatting breakage introduced with commit 102cedc3 ("MIPS:
      microMIPS: Floating point support."), so that further changes to this
      code can be consistent.
      Signed-off-by: NMaciej W. Rozycki <macro@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/12173/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      a87265cf
    • M
      MIPS: math-emu: Correctly handle NOP emulation · e4553573
      Maciej W. Rozycki 提交于
      Fix an issue introduced with commit 9ab4471c ("MIPS: math-emu:
      Correct delay-slot exception propagation") where the emulation of a NOP
      instruction signals the need to terminate the emulation loop.  This in
      turn, if the PC has not changed from the entry to the loop, will cause
      the kernel to terminate the program with SIGILL.
      
      Consider this program:
      
      static double div(double d)
      {
      	do
      		d /= 2.0;
      	while (d > .5);
      	return d;
      }
      
      int main(int argc, char **argv)
      {
      	return div(argc);
      }
      
      which gets compiled to the following binary code:
      
      00400490 <main>:
        400490:	44840000 	mtc1	a0,$f0
        400494:	3c020040 	lui	v0,0x40
        400498:	d44207f8 	ldc1	$f2,2040(v0)
        40049c:	46800021 	cvt.d.w	$f0,$f0
        4004a0:	46220002 	mul.d	$f0,$f0,$f2
        4004a4:	4620103c 	c.lt.d	$f2,$f0
        4004a8:	4501fffd 	bc1t	4004a0 <main+0x10>
        4004ac:	00000000 	nop
        4004b0:	4620000d 	trunc.w.d	$f0,$f0
        4004b4:	03e00008 	jr	ra
        4004b8:	44020000 	mfc1	v0,$f0
        4004bc:	00000000 	nop
      
      Where the FPU emulator is used, depending on the number of command-line
      arguments this code will either run to completion or terminate with
      SIGILL.
      
      If no arguments are specified, then BC1T will not be taken, NOP will not
      be emulated and code will complete successfully.
      
      If one argument is specified, then BC1T will be taken once and NOP will
      be emulated.  At this point the entry PC value will be 0x400498 and the
      new PC value, set by `mips_dsemul' will be 0x4004a0, the target of BC1T.
      The emulation loop will terminate, but SIGILL will not be issued,
      because the PC has changed.  The FPU emulator will be entered again and
      on the second execution BC1T will not be taken, NOP will not be emulated
      and code will complete successfully.
      
      If two or more arguments are specified, then the first execution of BC1T
      will proceed as above.  Upon reentering the FPU emulator the emulation
      loop will continue to BC1T, at which point the branch will be taken and
      NOP emulated again.  At this point however the entry PC value will be
      0x4004a0, the same as the target of BC1T.  This will make the emulator
      conclude that execution has not advanced and therefore an unsupported
      FPU instruction has been encountered, and SIGILL will be sent to the
      process.
      
      Fix the problem by extending the internal API of `mips_dsemul', making
      it return -1 if no delay slot emulation frame has been made, the
      instruction has been handled and execution of the emulation loop needs
      to continue as if nothing happened.  Remove code from `mips_dsemul' to
      reproduce steps made by the emulation loop at the conclusion of each
      iteration, as those will be reached normally now.  Adjust call sites
      accordingly.  Document the API.
      Signed-off-by: NMaciej W. Rozycki <macro@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/12172/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e4553573
  2. 03 9月, 2015 1 次提交
  3. 08 4月, 2015 2 次提交
    • M
      MIPS: math-emu: Correct delay-slot exception propagation · 9ab4471c
      Maciej W. Rozycki 提交于
      Restore EPC at the branch whose delay slot is emulated if the delay-slot
      instruction signals.  This is so that code in `fpu_emulator_cop1Handler'
      does not see EPC having advanced and mistakenly successfully resume
      userland execution from the location at the branch target in that case.
      Restoring EPC guarantees an immediate exit from the emulation loop and
      if EPC hasn't advanced at all since entering the loop, also issuing the
      signal reported by the delay-slot instruction.
      Signed-off-by: NMaciej W. Rozycki <macro@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9701/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      9ab4471c
    • M
      MIPS: math-emu: Fix delay-slot emulation cache incoherency · 7737b20b
      Maciej W. Rozycki 提交于
      Correct a cache coherency regression introduced with be1664c4 [Another
      round of fixes for the fp emulator.] for the emulation frame used in
      delay-slot emulation.
      
      Two instructions are copied into the frame and as from the commit
      referred a cache synchronisation call is made for the second instruction
      aka `badinst' of the two only.  The `flush_cache_sigtramp' interface is
      reused that guarantees that synchronisation will be made for 8 bytes or
      2 instructions starting from the address requested, although if cache
      lines are wider then a larger area may be synchronised.
      
      Change the call to point to the first of the two instructions aka `emul'
      instead, removing unpredictable behaviour resulting from cache
      incoherency.
      
      This bug only ever manifested itself on systems implementing 4-byte
      cache lines, typically MIPS I systems, causing all kinds of weirdness.
      This is because the sequence of two instructions starting from `emul' is
      8-byte aligned and for 8-byte or wider cache lines the line synchronised
      will span both, so the vast majority of systems have escaped unharmed.
      Signed-off-by: NMaciej W. Rozycki <macro@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9698/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      7737b20b
  4. 01 4月, 2015 1 次提交
  5. 23 5月, 2014 1 次提交
  6. 21 5月, 2014 3 次提交
  7. 09 5月, 2013 1 次提交
  8. 29 3月, 2012 1 次提交
  9. 31 3月, 2011 1 次提交
  10. 17 12月, 2009 1 次提交
    • D
      MIPS: Collect FPU emulator statistics per-CPU. · b6ee75ed
      David Daney 提交于
      On SMP systems, the collection of statistics can cause cache line
      bouncing in the lines associated with the counters.  Also there are
      races incrementing the counters on multiple CPUs.
      
      To fix both problems, we collect the statistics in per-CPU variables,
      and add them up in the debugfs read operation.
      
      As a test I ran the LTP float_bessel test on a 12 CPU Octeon system.
      
      Without CONFIG_DEBUG_FS :             2602 seconds.
      With CONFIG_DEBUG_FS:                 2640 seconds.
      With non-cpu-local atomic statistics: 14569 seconds.
      Signed-off-by: NDavid Daney <ddaney@caviumnetworks.com>
      Cc: linux-mips@linux-mips.org
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      b6ee75ed
  11. 30 10月, 2008 1 次提交
  12. 14 7月, 2007 1 次提交
  13. 09 5月, 2007 1 次提交
  14. 30 10月, 2005 3 次提交
  15. 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