- 30 May, 2016 1 commit
-
-
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:
Vineet Gupta <vgupta@synopsys.com>
-
- 22 Apr, 2016 1 commit
-
-
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:
Evgeny Voevodin <evgeny.voevodin@intel.com> [vgupta: updated changelog and also added some comments] Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
- 14 Nov, 2015 1 commit
-
-
Vineet Gupta authored
Bus errors from userspace on ARCompact based cores are handled by core as a high priority L2 interrupt but current code treated it as interrupt Handling an interrupt like exception is certainly not going to go unnoticed. (and it worked so far as we never saw a Bus error from userspace until IPPK guys tested a DDR controller with ECC error detection etc hence needed to explicitly trigger/handle such errors) - So move mem_service exception handler from common code into ARCv2 code. - In ARCompact code, define mem_service as L2 interrupt handler which just drops down to pure kernel mode and goes of to enqueue SIGBUS Reported-by:
Nelson Pereira <npereira@synopsys.com> Tested-by:
Ana Martins <amartins@synopsys.com> Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
- 28 Oct, 2015 1 commit
-
-
Vineet Gupta authored
For Run-on-reset, non masters need to spin wait. For Halt-on-reset they can jump to entry point directly. Also while at it, made reset vector handler as "the" entry point for kernel including host debugger based boot (which uses the ELF header entry point) Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
- 17 Oct, 2015 2 commits
-
-
Vineet Gupta authored
This is done by improving the laddering logic ! Before: if Exception goto excep_or_pure_k_ret if !Interrupt(L2) goto l1_chk else INTERRUPT_EPILOGUE 2 l1_chk: if !Interrupt(L1) (i.e. pure kernel mode) goto excep_or_pure_k_ret else INTERRUPT_EPILOGUE 1 excep_or_pure_k_ret: EXCEPTION_EPILOGUE Now: if !Interrupt(L1 or L2) (i.e. exception or pure kernel mode) goto excep_or_pure_k_ret ; guaranteed to be an interrupt if !Interrupt(L2) goto l1_ret else INTERRUPT_EPILOGUE 2 ; by virtue of above, no need to chk for L1 active l1_ret: INTERRUPT_EPILOGUE 1 excep_or_pure_k_ret: EXCEPTION_EPILOGUE Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
- 19 Jun, 2015 11 commits
-
-
Vineet Gupta authored
Returning from pure kernel mode and exception mode use the same code anyways. Remove one the duplicate blocks Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
This fixes the possible link/relo errors, since restore_regs will be provided by ISA code, but called from ARC common code. The .L prefix reassures binutils that it will be in same compilation unit. Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
-EXCEPTION_EPILOGUE introduced -EXCEPTION_PROLOGUE now also includes reg file saving Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
-common'ize macros for level 1 and level 2 interrupts Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
- 02 Feb, 2015 1 commit
-
-
Vineet Gupta authored
Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
- 05 May, 2014 1 commit
-
-
Terence Eden authored
[vgupta: fixed changelong + added Randy's suggestion] Signed-off-by:
Terence Eden <github.com@shkspr.mobi> Acked-by:
Randy Dunlap <rdunlap@infradead.org> Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
- 30 Apr, 2014 1 commit
-
-
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:
Vineet 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:
Linus Torvalds <torvalds@linux-foundation.org>
-
- 26 Mar, 2014 1 commit
-
-
Vineet Gupta authored
With commit 9df62f05 "arch: use ASM_NL instead of ';'" the generic macros can handle the arch specific newline quirk. Hence we can get rid of ARC asm macros and use the "C" style macros. Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
- 06 Nov, 2013 3 commits
-
-
Vineet Gupta authored
Lockdep required a small fix to stacktrace API which was incorrectly unwindign out of __switch_to for the current call frame. Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
Emulation not enabled is treated as if the fixup failed, so no need for special #ifdef checks. Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
switch the args (address, pt_regs) to match with all the other "C" exception handlers. This removes the awkwardness in EV_ProtV for page fault vs. unaligned access. Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
- 26 Aug, 2013 2 commits
-
-
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:
Vineet Gupta <vgupta@synopsys.com>
-
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:
Vineet Gupta <vgupta@synopsys.com>
-
- 26 Jun, 2013 2 commits
-
-
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:
Vineet Gupta <vgupta@synopsys.com>
-
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...
-
- 22 Jun, 2013 4 commits
-
-
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:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
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:
Vineet Gupta <vgupta@synopsys.com>
-
- 07 May, 2013 2 commits
-
-
Vineet Gupta authored
The fixup code correctly updates the callee-regs on stack, but fails to unwind it into actual register file. Thus userspace won't see the update. Reported-by:
Noam Camus <noamc@ezchip.com> Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
If CONFIG_ARC_MISALIGN_ACCESS is not enabled, or if the fixup fails, call the same error handler: same signal/si_code to user (SIGBUS) Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
- 20 Mar, 2013 1 commit
-
-
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:
Vineet Gupta <vgupta@synopsys.com>
-
- 11 Mar, 2013 1 commit
-
-
Vineet Gupta authored
When switching to clone() only ABI - I missed out pruning the low level asm syscall wrappers Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
- 15 Feb, 2013 4 commits
-
-
Vineet Gupta authored
Syscall restarting fixes made pt_regs->orig_r8 a short word, which was not reflected in the assembler code - thus could potentially break gdb debugging. Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
* Includes mapping of CCMs in address space * Annotations to move arbitrary code/data into CCM * Moving some of the critical code/data into CCM * Runtime detection/reporting Signed-off-by:
Vineet Gupta <vgupta@synopsys.com>
-
Vineet Gupta authored
ARC700 doesn't natively support unaligned access, but can be emulated -Unaligned Access Exception -Disassembly at the Fault address to find the exact insn (long/short) Also per Arnd's comment, we runtime control it using 2 sysctl knobs: * SYSCTL_ARCH_UNALIGN_ALLOW: Runtime enable/disble * SYSCTL_ARCH_UNALIGN_NO_WARN: Warn on each emulation attempt Originally contributed by Tim Yao <tim.yao@amlogic.com> Signed-off-by:
Vineet Gupta <vgupta@synopsys.com> Cc: Tim Yao <tim.yao@amlogic.com> Acked-by:
Arnd Bergmann <arnd@arndb.de>
-
Vineet Gupta authored
-Originally written by Rajeshwar Ranga -Derived off of generic unwinder in 2.6.19 and adapted to ARC Signed-off-by:
Vineet Gupta <vgupta@synopsys.com> Cc: Rajeshwar Ranga <rajeshwar.ranga@gmail.com>
-