diff options
Diffstat (limited to 'arch/powerpc/include/asm/exception-64e.h')
-rw-r--r-- | arch/powerpc/include/asm/exception-64e.h | 52 |
1 files changed, 34 insertions, 18 deletions
diff --git a/arch/powerpc/include/asm/exception-64e.h b/arch/powerpc/include/asm/exception-64e.h index 6d53f311d942..ac13addb8495 100644 --- a/arch/powerpc/include/asm/exception-64e.h +++ b/arch/powerpc/include/asm/exception-64e.h | |||
@@ -48,30 +48,33 @@ | |||
48 | #define EX_R14 (4 * 8) | 48 | #define EX_R14 (4 * 8) |
49 | #define EX_R15 (5 * 8) | 49 | #define EX_R15 (5 * 8) |
50 | 50 | ||
51 | /* The TLB miss exception uses different slots */ | 51 | /* |
52 | * The TLB miss exception uses different slots. | ||
53 | * | ||
54 | * The bolted variant uses only the first six fields, | ||
55 | * which in combination with pgd and kernel_pgd fits in | ||
56 | * one 64-byte cache line. | ||
57 | */ | ||
52 | 58 | ||
53 | #define EX_TLB_R10 ( 0 * 8) | 59 | #define EX_TLB_R10 ( 0 * 8) |
54 | #define EX_TLB_R11 ( 1 * 8) | 60 | #define EX_TLB_R11 ( 1 * 8) |
55 | #define EX_TLB_R12 ( 2 * 8) | 61 | #define EX_TLB_R14 ( 2 * 8) |
56 | #define EX_TLB_R13 ( 3 * 8) | 62 | #define EX_TLB_R15 ( 3 * 8) |
57 | #define EX_TLB_R14 ( 4 * 8) | 63 | #define EX_TLB_R16 ( 4 * 8) |
58 | #define EX_TLB_R15 ( 5 * 8) | 64 | #define EX_TLB_CR ( 5 * 8) |
59 | #define EX_TLB_R16 ( 6 * 8) | 65 | #define EX_TLB_R12 ( 6 * 8) |
60 | #define EX_TLB_CR ( 7 * 8) | 66 | #define EX_TLB_R13 ( 7 * 8) |
61 | #define EX_TLB_DEAR ( 8 * 8) /* Level 0 and 2 only */ | 67 | #define EX_TLB_DEAR ( 8 * 8) /* Level 0 and 2 only */ |
62 | #define EX_TLB_ESR ( 9 * 8) /* Level 0 and 2 only */ | 68 | #define EX_TLB_ESR ( 9 * 8) /* Level 0 and 2 only */ |
63 | #define EX_TLB_SRR0 (10 * 8) | 69 | #define EX_TLB_SRR0 (10 * 8) |
64 | #define EX_TLB_SRR1 (11 * 8) | 70 | #define EX_TLB_SRR1 (11 * 8) |
65 | #define EX_TLB_MMUCR0 (12 * 8) /* Level 0 */ | ||
66 | #define EX_TLB_MAS1 (12 * 8) /* Level 0 */ | ||
67 | #define EX_TLB_MAS2 (13 * 8) /* Level 0 */ | ||
68 | #ifdef CONFIG_BOOK3E_MMU_TLB_STATS | 71 | #ifdef CONFIG_BOOK3E_MMU_TLB_STATS |
69 | #define EX_TLB_R8 (14 * 8) | 72 | #define EX_TLB_R8 (12 * 8) |
70 | #define EX_TLB_R9 (15 * 8) | 73 | #define EX_TLB_R9 (13 * 8) |
71 | #define EX_TLB_LR (16 * 8) | 74 | #define EX_TLB_LR (14 * 8) |
72 | #define EX_TLB_SIZE (17 * 8) | 75 | #define EX_TLB_SIZE (15 * 8) |
73 | #else | 76 | #else |
74 | #define EX_TLB_SIZE (14 * 8) | 77 | #define EX_TLB_SIZE (12 * 8) |
75 | #endif | 78 | #endif |
76 | 79 | ||
77 | #define START_EXCEPTION(label) \ | 80 | #define START_EXCEPTION(label) \ |
@@ -168,6 +171,16 @@ exc_##label##_book3e: | |||
168 | ld r9,EX_TLB_R9(r12); \ | 171 | ld r9,EX_TLB_R9(r12); \ |
169 | ld r8,EX_TLB_R8(r12); \ | 172 | ld r8,EX_TLB_R8(r12); \ |
170 | mtlr r16; | 173 | mtlr r16; |
174 | #define TLB_MISS_PROLOG_STATS_BOLTED \ | ||
175 | mflr r10; \ | ||
176 | std r8,PACA_EXTLB+EX_TLB_R8(r13); \ | ||
177 | std r9,PACA_EXTLB+EX_TLB_R9(r13); \ | ||
178 | std r10,PACA_EXTLB+EX_TLB_LR(r13); | ||
179 | #define TLB_MISS_RESTORE_STATS_BOLTED \ | ||
180 | ld r16,PACA_EXTLB+EX_TLB_LR(r13); \ | ||
181 | ld r9,PACA_EXTLB+EX_TLB_R9(r13); \ | ||
182 | ld r8,PACA_EXTLB+EX_TLB_R8(r13); \ | ||
183 | mtlr r16; | ||
171 | #define TLB_MISS_STATS_D(name) \ | 184 | #define TLB_MISS_STATS_D(name) \ |
172 | addi r9,r13,MMSTAT_DSTATS+name; \ | 185 | addi r9,r13,MMSTAT_DSTATS+name; \ |
173 | bl .tlb_stat_inc; | 186 | bl .tlb_stat_inc; |
@@ -183,17 +196,20 @@ exc_##label##_book3e: | |||
183 | 61: addi r9,r13,MMSTAT_ISTATS+name; \ | 196 | 61: addi r9,r13,MMSTAT_ISTATS+name; \ |
184 | 62: bl .tlb_stat_inc; | 197 | 62: bl .tlb_stat_inc; |
185 | #define TLB_MISS_STATS_SAVE_INFO \ | 198 | #define TLB_MISS_STATS_SAVE_INFO \ |
186 | std r14,EX_TLB_ESR(r12); /* save ESR */ \ | 199 | std r14,EX_TLB_ESR(r12); /* save ESR */ |
187 | 200 | #define TLB_MISS_STATS_SAVE_INFO_BOLTED \ | |
188 | 201 | std r14,PACA_EXTLB+EX_TLB_ESR(r13); /* save ESR */ | |
189 | #else | 202 | #else |
190 | #define TLB_MISS_PROLOG_STATS | 203 | #define TLB_MISS_PROLOG_STATS |
191 | #define TLB_MISS_RESTORE_STATS | 204 | #define TLB_MISS_RESTORE_STATS |
205 | #define TLB_MISS_PROLOG_STATS_BOLTED | ||
206 | #define TLB_MISS_RESTORE_STATS_BOLTED | ||
192 | #define TLB_MISS_STATS_D(name) | 207 | #define TLB_MISS_STATS_D(name) |
193 | #define TLB_MISS_STATS_I(name) | 208 | #define TLB_MISS_STATS_I(name) |
194 | #define TLB_MISS_STATS_X(name) | 209 | #define TLB_MISS_STATS_X(name) |
195 | #define TLB_MISS_STATS_Y(name) | 210 | #define TLB_MISS_STATS_Y(name) |
196 | #define TLB_MISS_STATS_SAVE_INFO | 211 | #define TLB_MISS_STATS_SAVE_INFO |
212 | #define TLB_MISS_STATS_SAVE_INFO_BOLTED | ||
197 | #endif | 213 | #endif |
198 | 214 | ||
199 | #define SET_IVOR(vector_number, vector_offset) \ | 215 | #define SET_IVOR(vector_number, vector_offset) \ |