diff options
Diffstat (limited to 'arch/powerpc/include/asm/exception-64s.h')
-rw-r--r-- | arch/powerpc/include/asm/exception-64s.h | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h index 35fb5b11955a..4fdae1c182df 100644 --- a/arch/powerpc/include/asm/exception-64s.h +++ b/arch/powerpc/include/asm/exception-64s.h | |||
@@ -48,11 +48,12 @@ | |||
48 | #define EX_CCR 52 | 48 | #define EX_CCR 52 |
49 | #define EX_CFAR 56 | 49 | #define EX_CFAR 56 |
50 | #define EX_PPR 64 | 50 | #define EX_PPR 64 |
51 | #define EX_LR 72 | ||
51 | #if defined(CONFIG_RELOCATABLE) | 52 | #if defined(CONFIG_RELOCATABLE) |
52 | #define EX_CTR 72 | 53 | #define EX_CTR 80 |
53 | #define EX_SIZE 10 /* size in u64 units */ | 54 | #define EX_SIZE 11 /* size in u64 units */ |
54 | #else | 55 | #else |
55 | #define EX_SIZE 9 /* size in u64 units */ | 56 | #define EX_SIZE 10 /* size in u64 units */ |
56 | #endif | 57 | #endif |
57 | 58 | ||
58 | /* | 59 | /* |
@@ -61,14 +62,6 @@ | |||
61 | #define MAX_MCE_DEPTH 4 | 62 | #define MAX_MCE_DEPTH 4 |
62 | 63 | ||
63 | /* | 64 | /* |
64 | * EX_LR is only used in EXSLB and where it does not overlap with EX_DAR | ||
65 | * EX_CCR similarly with DSISR, but being 4 byte registers there is a hole | ||
66 | * in the save area so it's not necessary to overlap them. Could be used | ||
67 | * for future savings though if another 4 byte register was to be saved. | ||
68 | */ | ||
69 | #define EX_LR EX_DAR | ||
70 | |||
71 | /* | ||
72 | * EX_R3 is only used by the bad_stack handler. bad_stack reloads and | 65 | * EX_R3 is only used by the bad_stack handler. bad_stack reloads and |
73 | * saves DAR from SPRN_DAR, and EX_DAR is not used. So EX_R3 can overlap | 66 | * saves DAR from SPRN_DAR, and EX_DAR is not used. So EX_R3 can overlap |
74 | * with EX_DAR. | 67 | * with EX_DAR. |
@@ -243,10 +236,22 @@ | |||
243 | * PPR save/restore macros used in exceptions_64s.S | 236 | * PPR save/restore macros used in exceptions_64s.S |
244 | * Used for P7 or later processors | 237 | * Used for P7 or later processors |
245 | */ | 238 | */ |
246 | #define SAVE_PPR(area, ra, rb) \ | 239 | #define SAVE_PPR(area, ra) \ |
240 | BEGIN_FTR_SECTION_NESTED(940) \ | ||
241 | ld ra,area+EX_PPR(r13); /* Read PPR from paca */ \ | ||
242 | std ra,RESULT(r1); /* Store PPR in RESULT for now */ \ | ||
243 | END_FTR_SECTION_NESTED(CPU_FTR_HAS_PPR,CPU_FTR_HAS_PPR,940) | ||
244 | |||
245 | /* | ||
246 | * This is called after we are finished accessing 'area', so we can now take | ||
247 | * SLB faults accessing the thread struct, which will use PACA_EXSLB area. | ||
248 | * This is required because the large_addr_slb handler uses EXSLB and it also | ||
249 | * uses the common exception macros including this PPR saving. | ||
250 | */ | ||
251 | #define MOVE_PPR_TO_THREAD(ra, rb) \ | ||
247 | BEGIN_FTR_SECTION_NESTED(940) \ | 252 | BEGIN_FTR_SECTION_NESTED(940) \ |
248 | ld ra,PACACURRENT(r13); \ | 253 | ld ra,PACACURRENT(r13); \ |
249 | ld rb,area+EX_PPR(r13); /* Read PPR from paca */ \ | 254 | ld rb,RESULT(r1); /* Read PPR from stack */ \ |
250 | std rb,TASKTHREADPPR(ra); \ | 255 | std rb,TASKTHREADPPR(ra); \ |
251 | END_FTR_SECTION_NESTED(CPU_FTR_HAS_PPR,CPU_FTR_HAS_PPR,940) | 256 | END_FTR_SECTION_NESTED(CPU_FTR_HAS_PPR,CPU_FTR_HAS_PPR,940) |
252 | 257 | ||
@@ -515,9 +520,11 @@ END_FTR_SECTION_NESTED(ftr,ftr,943) | |||
515 | 3: EXCEPTION_PROLOG_COMMON_1(); \ | 520 | 3: EXCEPTION_PROLOG_COMMON_1(); \ |
516 | beq 4f; /* if from kernel mode */ \ | 521 | beq 4f; /* if from kernel mode */ \ |
517 | ACCOUNT_CPU_USER_ENTRY(r13, r9, r10); \ | 522 | ACCOUNT_CPU_USER_ENTRY(r13, r9, r10); \ |
518 | SAVE_PPR(area, r9, r10); \ | 523 | SAVE_PPR(area, r9); \ |
519 | 4: EXCEPTION_PROLOG_COMMON_2(area) \ | 524 | 4: EXCEPTION_PROLOG_COMMON_2(area) \ |
520 | EXCEPTION_PROLOG_COMMON_3(n) \ | 525 | beq 5f; /* if from kernel mode */ \ |
526 | MOVE_PPR_TO_THREAD(r9, r10); \ | ||
527 | 5: EXCEPTION_PROLOG_COMMON_3(n) \ | ||
521 | ACCOUNT_STOLEN_TIME | 528 | ACCOUNT_STOLEN_TIME |
522 | 529 | ||
523 | /* Save original regs values from save area to stack frame. */ | 530 | /* Save original regs values from save area to stack frame. */ |