1. 08 2月, 2010 3 次提交
    • M
      sh: Don't continue unwinding across interrupts · 944a3438
      Matt Fleming 提交于
      Unfortunately, due to poor DWARF info in current toolchains, unwinding
      through interrutps cannot be done reliably. The problem is that the
      DWARF info for function epilogues is wrong.
      
      Take this standard epilogue sequence,
      
      80003cc4:       e3 6f           mov     r14,r15
      80003cc6:       26 4f           lds.l   @r15+,pr
      80003cc8:       f6 6e           mov.l   @r15+,r14
      						<---- interrupt here
      80003cca:       f6 6b           mov.l   @r15+,r11
      80003ccc:       f6 6a           mov.l   @r15+,r10
      80003cce:       f6 69           mov.l   @r15+,r9
      80003cd0:       0b 00           rts
      
      If we take an interrupt at the highlighted point, the DWARF info will
      bogusly claim that the return address can be found at some offset from
      the frame pointer, even though the frame pointer was just restored. The
      worst part is if the unwinder finds a text address at the bogus stack
      address - unwinding will continue, for a bit, until it finally comes
      across an unexpected address on the stack and blows up.
      
      The only solution is to stop unwinding once we've calculated the
      function that was executing when the interrupt occurred. This PC can be
      easily calculated from pt_regs->pc.
      Signed-off-by: NMatt Fleming <matt@console-pimps.org>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      944a3438
    • M
      sh: Setup frame pointer in handle_exception path · 1dca56f1
      Matt Fleming 提交于
      In order to allow the DWARF unwinder to unwind through exceptions we
      need to setup the frame pointer register (r14).
      Signed-off-by: NMatt Fleming <matt@console-pimps.org>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      1dca56f1
    • M
      sh: Correct the offset of the return address in ret_from_exception · 14269828
      Matt Fleming 提交于
      The address that ret_from_exception and ret_from_irq will return to is
      found in the stack slot for SPC, not PR. This error was causing the
      DWARF unwinder to pick up the wrong return address on the stack and then
      unwind using the unwind tables for the wrong function.
      
      While I'm here I might as well add CFI annotations for the other
      registers since they could be useful when unwinding.
      Signed-off-by: NMatt Fleming <matt@console-pimps.org>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      14269828
  2. 05 2月, 2010 8 次提交
  3. 04 2月, 2010 11 次提交
  4. 03 2月, 2010 18 次提交