1. 22 6月, 2013 4 次提交
    • V
      ARC: pt_regs update #4: r25 saved/restored unconditionally · 359105bd
      Vineet Gupta 提交于
      (This is a VERY IMP change for low level interrupt/exception handling)
      
      -----------------------------------------------------------------------
      WHAT
      -----------------------------------------------------------------------
      * User 25 now saved in pt_regs->user_r25 (vs. tsk->thread_info.user_r25)
      
      * This allows Low level interrupt code to unconditionally save r25
        (vs. the prev version which would only do it for U->K transition).
        Ofcourse for nested interrupts, only the pt_regs->user_r25 of
        bottom-most frame is useful.
      
      * simplifies the interrupt prologue/epilogue
      
      * Needed for ARCv2 ISA code and done here to keep design similar with
        ARCompact event handling
      
      -----------------------------------------------------------------------
      WHY
      -------------------------------------------------------------------------
      With CONFIG_ARC_CURR_IN_REG, r25 is used to cache "current" task pointer
      in kernel mode. So when entering kernel mode from User Mode
      - user r25 is specially safe-kept (it being a callee reg is NOT part of
        pt_regs which are saved by default on each interrupt/trap/exception)
      - r25 loaded with current task pointer.
      
      Further, if interrupt was taken in kernel mode, this is skipped since we
      know that r25 already has valid "current" pointer.
      
      With 2 level of interrupts in ARCompact ISA, detecting this is difficult
      but still possible, since we could be in kernel mode but r25 not already saved
      (in fact the stack itself might not have been switched).
      
      A. User mode
      B. L1 IRQ taken
      C. L2 IRQ taken (while on 1st line of L1 ISR)
      
      So in #C, although in kernel mode, r25 not saved (infact SP not
      switched at all)
      
      Given that ARcompact has manual stack switching, we could use a bit of
      trickey - The low level code would make sure that SP is only set to kernel
      mode value at the very end (after saving r25). So a non kernel mode SP,
      even if in kernel mode, meant r25 was NOT saved.
      
      The same paradigm won't work in ARCv2 ISA since SP is auto-switched so
      it's setting can't be delayed/constrained.
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      359105bd
    • V
      ARC: Increase readability of entry handlers · 3ebedbb2
      Vineet Gupta 提交于
      * use artificial PUSH/POP contructs for CORE Reg save/restore to stack
      * use artificial PUSHAX/POPAX contructs for Auxiliary Space regs
      * macro'ize multiple copies of callee-reg-save/restore (SAVE_R13_TO_R24)
      * use BIC insn for inverse-and operation
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      3ebedbb2
    • V
      ARC: pt_regs update #3: Remove unused gutter at start of callee_regs · 16f9afe6
      Vineet Gupta 提交于
      This is trickier than prev two:
      
      * context switching code saves kernel mode callee regs in the format of
        struct callee_regs thus needs adjustment. This also reduces the height
        of topmost kernel stack frame by 1 word.
      
      * Since kernel stack unwinder is sensitive to height of topmost kernel
        stack frame, that needs a word of adjustment too.
      
      ptrace needs a bit of updating since pt_regs now diverges from
      user_regs_struct.
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      16f9afe6
    • V
      ARC: pt_regs update #1: Align pt_regs end with end of kernel stack page · 283237a0
      Vineet Gupta 提交于
      Historically, pt_regs would end at offset of 1 word from end of stack
      page.
      
              -----------------  -> START of page (task->stack)
              |               |
              | thread_info   |
              -----------------
              |               |
         ^    ~               ~
         |    ~               ~
         |    |               |
         |    |               | <---- pt_regs used to END here
              -----------------
              | 1 word GUTTER |
              ----------------- -> End of page (START of kernel stack)
      
      This required special "one-off" considerations in low level code.
      
      The root cause is very likely assumption of "empty" SP by the original
      ARC kernel hackers, despite ARC700 always been "full" SP.
      
      So finally RIP one word gutter !
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      283237a0
  2. 08 4月, 2013 1 次提交
  3. 27 2月, 2013 1 次提交
  4. 11 2月, 2013 2 次提交