powerpc/64s: Add EX_SIZE definition for paca exception save areas

Rather than open-coding it 4 times.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Move __ASSEMBLY__ guards into head-64.h where they're really needed]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
Nicholas Piggin 2017-05-21 23:15:46 +10:00 committed by Michael Ellerman
parent 4d7cd3b956
commit 8c38851415
3 changed files with 14 additions and 4 deletions

View File

@ -36,6 +36,7 @@
*/ */
#include <asm/head-64.h> #include <asm/head-64.h>
/* PACA save area offsets (exgen, exmc, etc) */
#define EX_R9 0 #define EX_R9 0
#define EX_R10 8 #define EX_R10 8
#define EX_R11 16 #define EX_R11 16
@ -51,6 +52,8 @@
#define EX_PPR 88 /* SMT thread status register (priority) */ #define EX_PPR 88 /* SMT thread status register (priority) */
#define EX_CTR 96 #define EX_CTR 96
#define EX_SIZE 13 /* size in u64 units */
#ifdef CONFIG_RELOCATABLE #ifdef CONFIG_RELOCATABLE
#define __EXCEPTION_RELON_PROLOG_PSERIES_1(label, h) \ #define __EXCEPTION_RELON_PROLOG_PSERIES_1(label, h) \
mfspr r11,SPRN_##h##SRR0; /* save SRR0 */ \ mfspr r11,SPRN_##h##SRR0; /* save SRR0 */ \

View File

@ -3,6 +3,7 @@
#include <asm/cache.h> #include <asm/cache.h>
#ifdef __ASSEMBLY__
/* /*
* We can't do CPP stringification and concatination directly into the section * We can't do CPP stringification and concatination directly into the section
* name for some reason, so these macros can do it for us. * name for some reason, so these macros can do it for us.
@ -415,4 +416,6 @@ end_##sname:
EXC_COMMON_BEGIN(name); \ EXC_COMMON_BEGIN(name); \
STD_EXCEPTION_COMMON(realvec + 0x2, name, hdlr); \ STD_EXCEPTION_COMMON(realvec + 0x2, name, hdlr); \
#endif /* __ASSEMBLY__ */
#endif /* _ASM_POWERPC_HEAD_64_H */ #endif /* _ASM_POWERPC_HEAD_64_H */

View File

@ -21,7 +21,11 @@
#include <asm/lppaca.h> #include <asm/lppaca.h>
#include <asm/mmu.h> #include <asm/mmu.h>
#include <asm/page.h> #include <asm/page.h>
#ifdef CONFIG_PPC_BOOK3E
#include <asm/exception-64e.h> #include <asm/exception-64e.h>
#else
#include <asm/exception-64s.h>
#endif
#ifdef CONFIG_KVM_BOOK3S_64_HANDLER #ifdef CONFIG_KVM_BOOK3S_64_HANDLER
#include <asm/kvm_book3s_asm.h> #include <asm/kvm_book3s_asm.h>
#endif #endif
@ -98,8 +102,8 @@ struct paca_struct {
* Now, starting in cacheline 2, the exception save areas * Now, starting in cacheline 2, the exception save areas
*/ */
/* used for most interrupts/exceptions */ /* used for most interrupts/exceptions */
u64 exgen[13] __attribute__((aligned(0x80))); u64 exgen[EX_SIZE] __attribute__((aligned(0x80)));
u64 exslb[13]; /* used for SLB/segment table misses u64 exslb[EX_SIZE]; /* used for SLB/segment table misses
* on the linear mapping */ * on the linear mapping */
/* SLB related definitions */ /* SLB related definitions */
u16 vmalloc_sllp; u16 vmalloc_sllp;
@ -183,8 +187,8 @@ struct paca_struct {
#ifdef CONFIG_PPC_STD_MMU_64 #ifdef CONFIG_PPC_STD_MMU_64
/* Non-maskable exceptions that are not performance critical */ /* Non-maskable exceptions that are not performance critical */
u64 exnmi[13]; /* used for system reset (nmi) */ u64 exnmi[EX_SIZE]; /* used for system reset (nmi) */
u64 exmc[13]; /* used for machine checks */ u64 exmc[EX_SIZE]; /* used for machine checks */
#endif #endif
#ifdef CONFIG_PPC_BOOK3S_64 #ifdef CONFIG_PPC_BOOK3S_64
/* Exclusive stacks for system reset and machine check exception. */ /* Exclusive stacks for system reset and machine check exception. */