1. 30 May, 2016 1 commit
    • Vineet Gupta's avatar
      ARC: [intc-compact] simplify code for 2 priority levels · 60f2b4b8
      Vineet Gupta authored
      
      ARC700 support for 2 interrupt priorities historically allowed even slow
      perpherals such as emac and uart to setup high priority interrupts
      which was wrong from the beginning as they could possibly delay the more
      critical timer interrupt.
      
      The hardware support for 2 level interrupts in ARCompact is less than
      ideal anyways (judging from the "hacks" in low level entry code and thus
      is not used in productions systems I know of.
      
      So reduce the scope of this to timer only, thereby reducing a bunch of
      complexity.
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      60f2b4b8
  2. 22 Apr, 2016 1 commit
    • Evgeny Voevodin's avatar
      ARCv2: Enable LOCKDEP · d9676fa1
      Evgeny Voevodin authored
      
      - The asm helpers for calling into irq tracer were missing
      
      - Add calls to above helpers in low level assembly entry code for ARCv2
      
      - irq_save() uses CLRI to disable interrupts and returns the prev interrupt
        state (in STATUS32) in a specific encoding (and not the raw value of
        STATUS32). This is usable with SETI in irq_restore(). However
        save_flags() reads the raw value of STATUS32 which doesn't pair with
        irq_save/restore() and thus needs fixing.
      Signed-off-by: default avatarEvgeny Voevodin <evgeny.voevodin@intel.com>
      [vgupta: updated changelog and also added some comments]
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      d9676fa1
  3. 14 Nov, 2015 1 commit
  4. 28 Oct, 2015 1 commit
  5. 17 Oct, 2015 2 commits
  6. 19 Jun, 2015 11 commits
  7. 02 Feb, 2015 1 commit
  8. 05 May, 2014 1 commit
  9. 30 Apr, 2014 1 commit
    • Vineet Gupta's avatar
      ARC: !PREEMPT: Ensure Return to kernel mode is IRQ safe · 8aa9e85a
      Vineet Gupta authored
      
      There was a very small race window where resume to kernel mode from a
      Exception Path (or pure kernel mode which is true for most of ARC
      exceptions anyways), was not disabling interrupts in restore_regs,
      clobbering the exception regs
      
      Anton found the culprit call flow (after many sleepless nights)
      
      | 1. we got a Trap from user land
      | 2. started to service it.
      | 3. While doing some stuff on user-land memory (I think it is padzero()),
      |     we got a DataTlbMiss
      | 4. On return from it we are taking "resume_kernel_mode" path
      | 5. NEED_RESHED is not set, so we go to "return from exception" path in
      |     restore regs.
      | 6. there seems to be IRQ happening
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      Cc: <stable@vger.kernel.org>   #3.10, 3.12, 3.13, 3.14
      Cc: Anton Kolesov <Anton.Kolesov@synopsys.com>
      Cc: Francois Bedard <Francois.Bedard@synopsys.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8aa9e85a
  10. 26 Mar, 2014 1 commit
  11. 06 Nov, 2013 3 commits
  12. 26 Aug, 2013 2 commits
    • Vineet Gupta's avatar
      ARC: Entry Handler tweaks: Optimize away redundant IRQ_DISABLE_SAVE · fce16bc3
      Vineet Gupta authored
      
      In the exception return path, for both U/K cases, intr are already
      disabled (for various existing reasons). So when we drop down to
      @restore_regs, we need not redo that.
      
      There was subtle issue - when intr were NOT being disabled for
      ret-to-kernel-but-no-preemption case - now fixed by moving the
      IRQ_DISABLE further up in @resume_kernel_mode.
      
      So what do we gain:
      
      * Shaves off a few insn in return path.
      
      * Eliminates the need for IRQ_DISABLE_SAVE assembler macro for ARCv2
        hence allows for entry code sharing.
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      fce16bc3
    • Vineet Gupta's avatar
      ARC: Exception Handlers Code consolidation · 37f3ac49
      Vineet Gupta authored
      
      After the recent cleanups, all the exception handlers now have same
      boilerplate prologue code. Move that into common macro.
      
      This reduces readability but helps greatly with sharing / duplicating
      entry code with ARCv2 ISA where the handlers are pretty much the same,
      just the entry prologue is different (due to hardware assist).
      
      Also while at it, add the missing FAKE_RET_FROM_EXCPN calls in couple of
      places to drop down to pure kernel mode (from exception mode) before
      jumping off into "C" code.
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      37f3ac49
  13. 26 Jun, 2013 2 commits
    • Vineet Gupta's avatar
      ARC: Remove explicit passing around of ECR · 38a9ff6d
      Vineet Gupta authored
      
      With ECR now part of pt_regs
      
      * No need to propagate from lowest asm handlers as arg
      * No need to save it in tsk->thread.cause_code
      * Avoid bit chopping to access the bit-fields
      
      More code consolidation, cleanup
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      38a9ff6d
    • Vineet Gupta's avatar
      ARC: pt_regs update #5: Use real ECR for pt_regs->event vs. synth values · 502a0c77
      Vineet Gupta authored
      pt_regs->event was set with artificial values to identify the low level
      system event (syscall trap / breakpoint trap / exceptions / interrupts)
      
      With r8 saving out of the way, the full word can be used to save real
      ECR (Exception Cause Register) which helps idenify the event naturally,
      including additional info such as cause code, param.
      Only for Interrupts, where ECR is not applicable, do we resort to
      synthetic non ECR values.
      
      SAVE_ALL_TRAP/EXCEPTIONS can now be merged as they both use ECR with
      different runtime values.
      
      The ptrace helpers now use the sub-fields of ECR to distinguish the
      events (e.g. vector 0x25 is trap, param 0 is syscall...)
      
      The following benefits will follow:
      
      (1) This centralizes the location of where ECR is saved and will allow
          the cleanup of task->thread.cause_code ECR placeholder which is set
          in non-uniform way. Then ARC VM code can safely rely on it being
          there for purpose of finer grained VM_E...
      502a0c77
  14. 22 Jun, 2013 4 commits
    • Vineet Gupta's avatar
      ARC: pt_regs update #4: r25 saved/restored unconditionally · 359105bd
      Vineet Gupta authored
      
      (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: default avatarVineet Gupta <vgupta@synopsys.com>
      359105bd
    • Vineet Gupta's avatar
    • Vineet Gupta's avatar
    • Vineet Gupta's avatar
      ARC: [mm] Remove @write argument to do_page_fault() · 3e1ae441
      Vineet Gupta authored
      
      This can be ascertained within do_page_fault() since it gets the full
      ECR (Exception Cause Register).
      
      Further, for both the callers of do_page_fault(): Prot-V / D-TLB-Miss,
      the cause sub-fields in ECR are same for same type of access, making the
      code much more simpler.
      
      D-TLB-Miss [LD] 0x00_21_01_00
      Prot-V     [LD] 0x00_23_01_00
                              ^^
      D-TLB-Miss [ST] 0x00_21_02_00
      Prot-V     [ST] 0x00_23_02_00
                              ^^
      D-TLB-Miss [EX] 0x00_21_03_00
      Prot-V     [EX] 0x00_23_03_00
                              ^^
      
      This helps code consolidation, which is even better when moving code from
      assembler to "C".
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      3e1ae441
  15. 07 May, 2013 2 commits
  16. 20 Mar, 2013 1 commit
    • Vineet Gupta's avatar
      ARC: Fix the typo in event identifier flags used by ptrace · 367f3fcd
      Vineet Gupta authored
      
      orig_r8_IS_EXCPN and orig_r8_IS_BRKPT were same values due to a
      copy/paste error. Although it looks bad and is wrong, it really doesn't
      affect gdb working.
      
      orig_r8_IS_BRKPT is the one relevant to debugging (breakpoints), since
      it is used to provide EFA vs. ERET to a ptrace "stop_pc" request.
      
      So when gdb has inserted a breakpoint, orig_r8_IS_BRKPT is already set,
      and anything else (i.e. orig_r8_IS_EXCPN) becoming same as it, really
      doesn't hurt gdb. The corollary case, could be nasty but nobody uses the
      ptrace "stop_pc" request in that case
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      367f3fcd
  17. 11 Mar, 2013 1 commit
  18. 15 Feb, 2013 4 commits