powerpc/64: Interrupts save PPR on stack rather than thread_struct
PPR is the odd register out when it comes to interrupt handling, it is saved in current->thread.ppr while all others are saved on the stack. The difficulty with this is that accessing thread.ppr can cause a SLB fault, but the SLB fault handler implementation in C change had assumed the normal exception entry handlers would not cause an SLB fault. Fix this by allocating room in the interrupt stack to save PPR. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
3eeacd9f4e
commit
4c2de74cc8
@@ -236,11 +236,10 @@
|
||||
* PPR save/restore macros used in exceptions_64s.S
|
||||
* Used for P7 or later processors
|
||||
*/
|
||||
#define SAVE_PPR(area, ra, rb) \
|
||||
#define SAVE_PPR(area, ra) \
|
||||
BEGIN_FTR_SECTION_NESTED(940) \
|
||||
ld ra,PACACURRENT(r13); \
|
||||
ld rb,area+EX_PPR(r13); /* Read PPR from paca */ \
|
||||
std rb,TASKTHREADPPR(ra); \
|
||||
ld ra,area+EX_PPR(r13); /* Read PPR from paca */ \
|
||||
std ra,_PPR(r1); \
|
||||
END_FTR_SECTION_NESTED(CPU_FTR_HAS_PPR,CPU_FTR_HAS_PPR,940)
|
||||
|
||||
#define RESTORE_PPR_PACA(area, ra) \
|
||||
@@ -508,7 +507,7 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)
|
||||
3: EXCEPTION_PROLOG_COMMON_1(); \
|
||||
beq 4f; /* if from kernel mode */ \
|
||||
ACCOUNT_CPU_USER_ENTRY(r13, r9, r10); \
|
||||
SAVE_PPR(area, r9, r10); \
|
||||
SAVE_PPR(area, r9); \
|
||||
4: EXCEPTION_PROLOG_COMMON_2(area) \
|
||||
EXCEPTION_PROLOG_COMMON_3(n) \
|
||||
ACCOUNT_STOLEN_TIME
|
||||
|
@@ -32,9 +32,9 @@
|
||||
/* Default SMT priority is set to 3. Use 11- 13bits to save priority. */
|
||||
#define PPR_PRIORITY 3
|
||||
#ifdef __ASSEMBLY__
|
||||
#define INIT_PPR (PPR_PRIORITY << 50)
|
||||
#define DEFAULT_PPR (PPR_PRIORITY << 50)
|
||||
#else
|
||||
#define INIT_PPR ((u64)PPR_PRIORITY << 50)
|
||||
#define DEFAULT_PPR ((u64)PPR_PRIORITY << 50)
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* CONFIG_PPC64 */
|
||||
|
||||
@@ -341,7 +341,6 @@ struct thread_struct {
|
||||
* onwards.
|
||||
*/
|
||||
int dscr_inherit;
|
||||
unsigned long ppr; /* used to save/restore SMT priority */
|
||||
unsigned long tidr;
|
||||
#endif
|
||||
#ifdef CONFIG_PPC_BOOK3S_64
|
||||
@@ -389,7 +388,6 @@ struct thread_struct {
|
||||
.regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \
|
||||
.addr_limit = KERNEL_DS, \
|
||||
.fpexc_mode = 0, \
|
||||
.ppr = INIT_PPR, \
|
||||
.fscr = FSCR_TAR | FSCR_EBB \
|
||||
}
|
||||
#endif
|
||||
|
@@ -51,6 +51,10 @@ struct pt_regs
|
||||
unsigned long result;
|
||||
};
|
||||
};
|
||||
|
||||
#ifdef CONFIG_PPC64
|
||||
unsigned long ppr;
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user