~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/exception-64e.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/powerpc/include/asm/exception-64e.h (Architecture ppc) and /arch/i386/include/asm-i386/exception-64e.h (Architecture i386)


  1 /* SPDX-License-Identifier: GPL-2.0-or-later *      1 
  2 /*                                                
  3  *  Definitions for use by exception code on B    
  4  *                                                
  5  *  Copyright (C) 2008 Ben. Herrenschmidt (ben    
  6  */                                               
  7 #ifndef _ASM_POWERPC_EXCEPTION_64E_H              
  8 #define _ASM_POWERPC_EXCEPTION_64E_H              
  9                                                   
 10 /*                                                
 11  * SPRGs usage an other considerations...         
 12  *                                                
 13  * Since TLB miss and other standard exception    
 14  * critical exceptions which can themselves be    
 15  * checks, and since the two later can themsel    
 16  * hitting the linear mapping for the kernel s    
 17  * creative on how we use SPRGs.                  
 18  *                                                
 19  * The base idea is that we have one SRPG rese    
 20  * for machine check interrupts. Those are use    
 21  * then be used to get the PACA, and store as     
 22  * to save in there. That includes saving the     
 23  * handler for linear mapping misses and the a    
 24  * the above re-entrancy issue.                   
 25  *                                                
 26  * So here's the current usage pattern. It's d    
 27  * SPRGs are user-readable though, thus we mig    
 28  * this later. In order to do that more easily    
 29  * for naming them                                
 30  *                                                
 31  * WARNING: Some of these SPRGs are user reada    
 32  * about it as some point by making sure they     
 33  * critical data                                  
 34  */                                               
 35                                                   
 36 #define PACA_EXGDBELL PACA_EXGEN                  
 37                                                   
 38 /* We are out of SPRGs so we save some things     
 39  * exception frame is smaller than the CRIT or    
 40  */                                               
 41 #define EX_R1           (0 * 8)                   
 42 #define EX_CR           (1 * 8)                   
 43 #define EX_R10          (2 * 8)                   
 44 #define EX_R11          (3 * 8)                   
 45 #define EX_R14          (4 * 8)                   
 46 #define EX_R15          (5 * 8)                   
 47                                                   
 48 /*                                                
 49  * The TLB miss exception uses different slots    
 50  *                                                
 51  * The bolted variant uses only the first six     
 52  * which in combination with pgd and kernel_pg    
 53  * one 64-byte cache line.                        
 54  */                                               
 55                                                   
 56 #define EX_TLB_R10      ( 0 * 8)                  
 57 #define EX_TLB_R11      ( 1 * 8)                  
 58 #define EX_TLB_R14      ( 2 * 8)                  
 59 #define EX_TLB_R15      ( 3 * 8)                  
 60 #define EX_TLB_R16      ( 4 * 8)                  
 61 #define EX_TLB_CR       ( 5 * 8)                  
 62 #define EX_TLB_R12      ( 6 * 8)                  
 63 #define EX_TLB_R13      ( 7 * 8)                  
 64 #define EX_TLB_DEAR     ( 8 * 8) /* Level 0 an    
 65 #define EX_TLB_ESR      ( 9 * 8) /* Level 0 an    
 66 #define EX_TLB_SRR0     (10 * 8)                  
 67 #define EX_TLB_SRR1     (11 * 8)                  
 68 #define EX_TLB_R7       (12 * 8)                  
 69 #define EX_TLB_SIZE     (13 * 8)                  
 70                                                   
 71 #define START_EXCEPTION(label)                    
 72         .globl exc_##label##_book3e;              
 73 exc_##label##_book3e:                             
 74                                                   
 75 /* TLB miss exception prolog                      
 76  *                                                
 77  * This prolog handles re-entrancy (up to 3 le    
 78  * though we currently don't test for overflow    
 79  * re-entrancy safe working space of r10...r16    
 80  * as the exception area pointer in the PACA f    
 81  * and r13 containing the PACA pointer.           
 82  *                                                
 83  * SRR0 and SRR1 are saved, but DEAR and ESR a    
 84  * as-is for instruction exceptions. It's up t    
 85  * to save them as well if required.              
 86  */                                               
 87 #define TLB_MISS_PROLOG                           
 88         mtspr   SPRN_SPRG_TLB_SCRATCH,r12;        
 89         mfspr   r12,SPRN_SPRG_TLB_EXFRAME;        
 90         std     r10,EX_TLB_R10(r12);              
 91         mfcr    r10;                              
 92         std     r11,EX_TLB_R11(r12);              
 93         mfspr   r11,SPRN_SPRG_TLB_SCRATCH;        
 94         std     r13,EX_TLB_R13(r12);              
 95         mfspr   r13,SPRN_SPRG_PACA;               
 96         std     r14,EX_TLB_R14(r12);              
 97         addi    r14,r12,EX_TLB_SIZE;              
 98         std     r15,EX_TLB_R15(r12);              
 99         mfspr   r15,SPRN_SRR1;                    
100         std     r16,EX_TLB_R16(r12);              
101         mfspr   r16,SPRN_SRR0;                    
102         std     r10,EX_TLB_CR(r12);               
103         std     r11,EX_TLB_R12(r12);              
104         mtspr   SPRN_SPRG_TLB_EXFRAME,r14;        
105         std     r15,EX_TLB_SRR1(r12);             
106         std     r16,EX_TLB_SRR0(r12);             
107                                                   
108 /* And these are the matching epilogs that res    
109  *                                                
110  * There are 3 epilogs:                           
111  *                                                
112  * - SUCCESS       : Unwinds one level            
113  * - ERROR         : restore from level 0 and     
114  * - ERROR_SPECIAL : restore from current leve    
115  *                                                
116  * Normal errors use ERROR, that is, they rest    
117  * and trigger a fault. However, there is a sp    
118  * errors. Those should basically never happen    
119  * want the error to point out the context tha    
120  * fault, not the initial level 0 (basically,     
121  * like that). For userland errors on the line    
122  * difference since those are always level 0 a    
123  */                                               
124                                                   
125 #define TLB_MISS_RESTORE(freg)                    
126         ld      r14,EX_TLB_CR(r12);               
127         ld      r10,EX_TLB_R10(r12);              
128         ld      r15,EX_TLB_SRR0(r12);             
129         ld      r16,EX_TLB_SRR1(r12);             
130         mtspr   SPRN_SPRG_TLB_EXFRAME,freg;       
131         ld      r11,EX_TLB_R11(r12);              
132         mtcr    r14;                              
133         ld      r13,EX_TLB_R13(r12);              
134         ld      r14,EX_TLB_R14(r12);              
135         mtspr   SPRN_SRR0,r15;                    
136         ld      r15,EX_TLB_R15(r12);              
137         mtspr   SPRN_SRR1,r16;                    
138         ld      r16,EX_TLB_R16(r12);              
139         ld      r12,EX_TLB_R12(r12);              
140                                                   
141 #define TLB_MISS_EPILOG_SUCCESS                   
142         TLB_MISS_RESTORE(r12)                     
143                                                   
144 #define TLB_MISS_EPILOG_ERROR                     
145         addi    r12,r13,PACA_EXTLB;               
146         TLB_MISS_RESTORE(r12)                     
147                                                   
148 #define TLB_MISS_EPILOG_ERROR_SPECIAL             
149         addi    r11,r13,PACA_EXTLB;               
150         TLB_MISS_RESTORE(r11)                     
151                                                   
152 #ifndef __ASSEMBLY__                              
153 extern unsigned int interrupt_base_book3e;        
154 #endif                                            
155                                                   
156 #define SET_IVOR(vector_number, vector_offset)    
157         LOAD_REG_ADDR(r3,interrupt_base_book3e    
158         ori     r3,r3,vector_offset@l;            
159         mtspr   SPRN_IVOR##vector_number,r3;      
160 /*                                                
161  * powerpc relies on return from interrupt/sys    
162  * (which rfi is) to support ARCH_HAS_MEMBARRI    
163  * synchronisation instructions.                  
164  */                                               
165 #define RFI_TO_KERNEL                             
166         rfi                                       
167                                                   
168 #define RFI_TO_USER                               
169         rfi                                       
170                                                   
171 #endif /* _ASM_POWERPC_EXCEPTION_64E_H */         
172                                                   
173                                                   

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php