Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * dtlb_prot.S: DTLB protection trap strategy.
0004  *              This is included directly into the trap table.
0005  *
0006  * Copyright (C) 1996,1998 David S. Miller (davem@redhat.com)
0007  * Copyright (C) 1997,1998 Jakub Jelinek   (jj@ultra.linux.cz)
0008  */
0009 
0010 /* Ways we can get here:
0011  *
0012  * [TL == 0] 1) User stores to readonly pages.
0013  * [TL == 0] 2) Nucleus stores to user readonly pages.
0014  * [TL >  0] 3) Nucleus stores to user readonly stack frame.
0015  */
0016 
0017 /* PROT ** ICACHE line 1: User DTLB protection trap */
0018     mov     TLB_SFSR, %g1
0019     stxa        %g0, [%g1] ASI_DMMU     ! Clear FaultValid bit
0020     membar      #Sync               ! Synchronize stores
0021     rdpr        %pstate, %g5            ! Move into alt-globals
0022     wrpr        %g5, PSTATE_AG|PSTATE_MG, %pstate
0023     rdpr        %tl, %g1            ! Need a winfixup?
0024     cmp     %g1, 1              ! Trap level >1?
0025     mov     TLB_TAG_ACCESS, %g4     ! For reload of vaddr
0026 
0027 /* PROT ** ICACHE line 2: More real fault processing */
0028     ldxa        [%g4] ASI_DMMU, %g5     ! Put tagaccess in %g5
0029     srlx        %g5, PAGE_SHIFT, %g5
0030     sllx        %g5, PAGE_SHIFT, %g5        ! Clear context ID bits
0031     bgu,pn      %xcc, winfix_trampoline     ! Yes, perform winfixup
0032      mov        FAULT_CODE_DTLB | FAULT_CODE_WRITE, %g4
0033     ba,pt       %xcc, sparc64_realfault_common  ! Nope, normal fault
0034      nop
0035     nop
0036 
0037 /* PROT ** ICACHE line 3: Unused... */
0038     nop
0039     nop
0040     nop
0041     nop
0042     nop
0043     nop
0044     nop
0045     nop
0046 
0047 /* PROT ** ICACHE line 4: Unused... */
0048     nop
0049     nop
0050     nop
0051     nop
0052     nop
0053     nop
0054     nop
0055     nop