Lines Matching +full:sw +full:- +full:exception

1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * TLB Exception Handling for ARC
5 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
8 * -MMU v1: moved out legacy code into a seperate file
9 * -MMU v3: PD{0,1} bits layout changed: They don't overlap anymore,
13 * -For MMU V2, we need not do heuristics at the time of commiting a D-TLB
14 * entry, so that it doesn't knock out it's I-TLB entry
15 * -Some more fine tuning:
19 * -Practically rewrote the I/D TLB Miss handlers
26 * -Passing ECR (Exception Cause REG) to do_page_fault( ) for printing
30 * -Added Debug Code to check if sw-ASID == hw-ASID
42 #include <asm/tlb-mmu1.h>
45 ;-----------------------------------------------------------------
46 ; ARC700 Exception Handling doesn't auto-switch stack and it only provides
49 ; For Non-SMP, the scratch AUX reg is repurposed to cache task PGD, so a
50 ; "global" is used to free-up FIRST core reg to be able to code the rest of
51 ; exception prologue (IRQ auto-disabled on Exceptions, so it's IRQ-safe).
61 ; To save the rest of 3 regs - per cpu, the global is made "per-cpu".
62 ; Epilogue thus has to locate the "per-cpu" storage for regs.
63 ; To avoid cache line bouncing the per-cpu global is aligned/sized per
68 ;--------------------------------------------------------------------------
70 ; scratch memory to save [r0-r3] used to code TLB refill Handler
98 ; VERIFY if the ASID in MMU-PID Reg is same as
126 std r0, [sp, -16]
127 std r2, [sp, -8]
138 ldd r0, [sp, -16]
139 ldd r2, [sp, -8]
154 ; Linux keeps ASID (Address Space ID) in task->active_mm->context.asid
157 ; In bizzare scenrios SW and HW ASID can get out-of-sync which is trouble.
199 ;-----------------------------------------------------------------------------
200 ; This macro does the page-table lookup for the faulting address.
201 ; OUT: r0 = PTE faulted on, r1 = ptr to PTE, r2 = Faulting V-address
229 ; (1) x = addr >> PAGE_SHIFT -> masks page-off bits from @fault-addr
230 ; (2) y = x & (PTRS_PER_PTE - 1) -> to get index
240 lsr r0, r2, ( PAGE_SHIFT - PTE_SIZE_LOG )
241 and r0, r0, ( (PTRS_PER_PTE - 1) << PTE_SIZE_LOG )
249 ;-----------------------------------------------------------------
251 ; A one-word PTE entry is programmed as two-word TLB Entry [PD0:PD1] in mmu
252 ; (for PAE40, two-words PTE, while three-word TLB Entry [PD0:PD1:PD1HI])
278 ;-----------------------------------------------------------------
300 ;-----------------------------------------------------------------------------
301 ; I-TLB Miss Exception Handler
302 ;-----------------------------------------------------------------------------
308 ;----------------------------------------------------------------
309 ; Get the PTE corresponding to V-addr accessed, r2 is setup with EFA
312 ;----------------------------------------------------------------
329 EV_TLBMissI_fast_ret: ; additional label for VDK OS-kit instrumentation
334 ;-----------------------------------------------------------------------------
335 ; D-TLB Miss Exception Handler
336 ;-----------------------------------------------------------------------------
342 ;----------------------------------------------------------------
343 ; Get the PTE corresponding to V-addr accessed
347 ;----------------------------------------------------------------
355 ; -If PAGE_GLOBAL set, they refer to kernel-only flags (vmalloc)
356 ; -Otherwise they are user-mode permissions, and those are exactly
370 ;----------------------------------------------------------------
379 ; MMU with 2 way set assoc J-TLB, needs some help in pathetic case of
387 EV_TLBMissD_fast_ret: ; additional label for VDK OS-kit instrumentation
390 ;-------- Common routine to call Linux Page Fault Handler -----------
394 ; Set Z flag if exception in U mode. Hardware micro-ops do this on any
395 ; taken interrupt/exception, and thus is already the case at the entry
404 ; Restore the 4-scratch regs saved by fast path miss handler
407 ; Slow path TLB Miss handled as a regular ARC Exception
408 ; (stack switching / save the complete reg-file).