powerpc: add definition for pt_regs offset within an interrupt frame

This is a common offset that currently uses the overloaded
STACK_FRAME_OVERHEAD constant. It's easier to read and more
flexible to use a specific regs offset for this.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221127124942.1665522-8-npiggin@gmail.com
This commit is contained in:
Nicholas Piggin 2022-11-27 22:49:32 +10:00 committed by Michael Ellerman
parent 37195b820d
commit c03be0a3f3
18 changed files with 100 additions and 100 deletions

View File

@ -124,6 +124,7 @@ struct pt_regs
#define STACK_FRAME_LR_SAVE 2 /* Location of LR in stack frame */ #define STACK_FRAME_LR_SAVE 2 /* Location of LR in stack frame */
#define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + \ #define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + \
STACK_FRAME_OVERHEAD + KERNEL_REDZONE_SIZE) STACK_FRAME_OVERHEAD + KERNEL_REDZONE_SIZE)
#define STACK_INT_FRAME_REGS STACK_FRAME_OVERHEAD
#define STACK_FRAME_MARKER 12 #define STACK_FRAME_MARKER 12
#ifdef CONFIG_PPC64_ELF_ABI_V2 #ifdef CONFIG_PPC64_ELF_ABI_V2
@ -143,6 +144,7 @@ struct pt_regs
#define STACK_FRAME_OVERHEAD 16 /* size of minimum stack frame */ #define STACK_FRAME_OVERHEAD 16 /* size of minimum stack frame */
#define STACK_FRAME_LR_SAVE 1 /* Location of LR in stack frame */ #define STACK_FRAME_LR_SAVE 1 /* Location of LR in stack frame */
#define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD) #define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD)
#define STACK_INT_FRAME_REGS STACK_FRAME_OVERHEAD
#define STACK_FRAME_MARKER 2 #define STACK_FRAME_MARKER 2
#define STACK_FRAME_MIN_SIZE STACK_FRAME_OVERHEAD #define STACK_FRAME_MIN_SIZE STACK_FRAME_OVERHEAD

View File

@ -72,7 +72,7 @@
#endif #endif
#define STACK_PT_REGS_OFFSET(sym, val) \ #define STACK_PT_REGS_OFFSET(sym, val) \
DEFINE(sym, STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, val)) DEFINE(sym, STACK_INT_FRAME_REGS + offsetof(struct pt_regs, val))
int main(void) int main(void)
{ {
@ -167,9 +167,8 @@ int main(void)
OFFSET(THREAD_CKVRSTATE, thread_struct, ckvr_state.vr); OFFSET(THREAD_CKVRSTATE, thread_struct, ckvr_state.vr);
OFFSET(THREAD_CKVRSAVE, thread_struct, ckvrsave); OFFSET(THREAD_CKVRSAVE, thread_struct, ckvrsave);
OFFSET(THREAD_CKFPSTATE, thread_struct, ckfp_state.fpr); OFFSET(THREAD_CKFPSTATE, thread_struct, ckfp_state.fpr);
/* Local pt_regs on stack for Transactional Memory funcs. */ /* Local pt_regs on stack in int frame form, plus 16 bytes for TM */
DEFINE(TM_FRAME_SIZE, STACK_FRAME_OVERHEAD + DEFINE(TM_FRAME_SIZE, STACK_INT_FRAME_SIZE + 16);
sizeof(struct pt_regs) + 16);
#endif /* CONFIG_PPC_TRANSACTIONAL_MEM */ #endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
OFFSET(TI_LOCAL_FLAGS, thread_info, local_flags); OFFSET(TI_LOCAL_FLAGS, thread_info, local_flags);

View File

@ -123,12 +123,12 @@ transfer_to_syscall:
kuep_lock kuep_lock
/* Calling convention has r3 = regs, r4 = orig r0 */ /* Calling convention has r3 = regs, r4 = orig r0 */
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
mr r4,r0 mr r4,r0
bl system_call_exception bl system_call_exception
ret_from_syscall: ret_from_syscall:
addi r4,r1,STACK_FRAME_OVERHEAD addi r4,r1,STACK_INT_FRAME_REGS
li r5,0 li r5,0
bl syscall_exit_prepare bl syscall_exit_prepare
#ifdef CONFIG_PPC_47x #ifdef CONFIG_PPC_47x
@ -293,7 +293,7 @@ _ASM_NOKPROBE_SYMBOL(fast_exception_return)
.globl interrupt_return .globl interrupt_return
interrupt_return: interrupt_return:
lwz r4,_MSR(r1) lwz r4,_MSR(r1)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
andi. r0,r4,MSR_PR andi. r0,r4,MSR_PR
beq .Lkernel_interrupt_return beq .Lkernel_interrupt_return
bl interrupt_exit_user_prepare bl interrupt_exit_user_prepare

View File

@ -455,7 +455,7 @@ exc_##n##_bad_stack: \
EXCEPTION_COMMON(trapnum) \ EXCEPTION_COMMON(trapnum) \
ack(r8); \ ack(r8); \
CHECK_NAPPING(); \ CHECK_NAPPING(); \
addi r3,r1,STACK_FRAME_OVERHEAD; \ addi r3,r1,STACK_INT_FRAME_REGS; \
bl hdlr; \ bl hdlr; \
b interrupt_return b interrupt_return
@ -504,7 +504,7 @@ __end_interrupts:
EXCEPTION_COMMON_CRIT(0x100) EXCEPTION_COMMON_CRIT(0x100)
bl special_reg_save bl special_reg_save
CHECK_NAPPING(); CHECK_NAPPING();
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl unknown_nmi_exception bl unknown_nmi_exception
b ret_from_crit_except b ret_from_crit_except
@ -515,7 +515,7 @@ __end_interrupts:
EXCEPTION_COMMON_MC(0x000) EXCEPTION_COMMON_MC(0x000)
bl special_reg_save bl special_reg_save
CHECK_NAPPING(); CHECK_NAPPING();
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl machine_check_exception bl machine_check_exception
b ret_from_mc_except b ret_from_mc_except
@ -570,7 +570,7 @@ __end_interrupts:
std r14,_ESR(r1) std r14,_ESR(r1)
ld r14,PACA_EXGEN+EX_R14(r13) ld r14,PACA_EXGEN+EX_R14(r13)
EXCEPTION_COMMON(0x700) EXCEPTION_COMMON(0x700)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl program_check_exception bl program_check_exception
REST_NVGPRS(r1) REST_NVGPRS(r1)
b interrupt_return b interrupt_return
@ -586,7 +586,7 @@ __end_interrupts:
beq- 1f beq- 1f
bl load_up_fpu bl load_up_fpu
b fast_interrupt_return b fast_interrupt_return
1: addi r3,r1,STACK_FRAME_OVERHEAD 1: addi r3,r1,STACK_INT_FRAME_REGS
bl kernel_fp_unavailable_exception bl kernel_fp_unavailable_exception
b interrupt_return b interrupt_return
@ -606,7 +606,7 @@ BEGIN_FTR_SECTION
1: 1:
END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
#endif #endif
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl altivec_unavailable_exception bl altivec_unavailable_exception
b interrupt_return b interrupt_return
@ -616,7 +616,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
BOOKE_INTERRUPT_ALTIVEC_ASSIST, BOOKE_INTERRUPT_ALTIVEC_ASSIST,
PROLOG_ADDITION_NONE) PROLOG_ADDITION_NONE)
EXCEPTION_COMMON(0x220) EXCEPTION_COMMON(0x220)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
#ifdef CONFIG_ALTIVEC #ifdef CONFIG_ALTIVEC
BEGIN_FTR_SECTION BEGIN_FTR_SECTION
bl altivec_assist_exception bl altivec_assist_exception
@ -643,7 +643,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
EXCEPTION_COMMON_CRIT(0x9f0) EXCEPTION_COMMON_CRIT(0x9f0)
bl special_reg_save bl special_reg_save
CHECK_NAPPING(); CHECK_NAPPING();
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
#ifdef CONFIG_BOOKE_WDT #ifdef CONFIG_BOOKE_WDT
bl WatchdogException bl WatchdogException
#else #else
@ -664,7 +664,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
NORMAL_EXCEPTION_PROLOG(0xf20, BOOKE_INTERRUPT_AP_UNAVAIL, NORMAL_EXCEPTION_PROLOG(0xf20, BOOKE_INTERRUPT_AP_UNAVAIL,
PROLOG_ADDITION_NONE) PROLOG_ADDITION_NONE)
EXCEPTION_COMMON(0xf20) EXCEPTION_COMMON(0xf20)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl unknown_exception bl unknown_exception
b interrupt_return b interrupt_return
@ -731,7 +731,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
ld r14,PACA_EXCRIT+EX_R14(r13) ld r14,PACA_EXCRIT+EX_R14(r13)
ld r15,PACA_EXCRIT+EX_R15(r13) ld r15,PACA_EXCRIT+EX_R15(r13)
EXCEPTION_COMMON_CRIT(0xd00) EXCEPTION_COMMON_CRIT(0xd00)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl DebugException bl DebugException
REST_NVGPRS(r1) REST_NVGPRS(r1)
b interrupt_return b interrupt_return
@ -802,7 +802,7 @@ kernel_dbg_exc:
ld r14,PACA_EXDBG+EX_R14(r13) ld r14,PACA_EXDBG+EX_R14(r13)
ld r15,PACA_EXDBG+EX_R15(r13) ld r15,PACA_EXDBG+EX_R15(r13)
EXCEPTION_COMMON_DBG(0xd08) EXCEPTION_COMMON_DBG(0xd08)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl DebugException bl DebugException
REST_NVGPRS(r1) REST_NVGPRS(r1)
b interrupt_return b interrupt_return
@ -812,7 +812,7 @@ kernel_dbg_exc:
PROLOG_ADDITION_NONE) PROLOG_ADDITION_NONE)
EXCEPTION_COMMON(0x260) EXCEPTION_COMMON(0x260)
CHECK_NAPPING() CHECK_NAPPING()
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
/* /*
* XXX: Returning from performance_monitor_exception taken as a * XXX: Returning from performance_monitor_exception taken as a
* soft-NMI (Linux irqs disabled) may be risky to use interrupt_return * soft-NMI (Linux irqs disabled) may be risky to use interrupt_return
@ -834,7 +834,7 @@ kernel_dbg_exc:
EXCEPTION_COMMON_CRIT(0x2a0) EXCEPTION_COMMON_CRIT(0x2a0)
bl special_reg_save bl special_reg_save
CHECK_NAPPING(); CHECK_NAPPING();
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl unknown_nmi_exception bl unknown_nmi_exception
b ret_from_crit_except b ret_from_crit_except
@ -846,7 +846,7 @@ kernel_dbg_exc:
GDBELL_EXCEPTION_PROLOG(0x2c0, BOOKE_INTERRUPT_GUEST_DBELL, GDBELL_EXCEPTION_PROLOG(0x2c0, BOOKE_INTERRUPT_GUEST_DBELL,
PROLOG_ADDITION_NONE) PROLOG_ADDITION_NONE)
EXCEPTION_COMMON(0x2c0) EXCEPTION_COMMON(0x2c0)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl unknown_exception bl unknown_exception
b interrupt_return b interrupt_return
@ -857,7 +857,7 @@ kernel_dbg_exc:
EXCEPTION_COMMON_CRIT(0x2e0) EXCEPTION_COMMON_CRIT(0x2e0)
bl special_reg_save bl special_reg_save
CHECK_NAPPING(); CHECK_NAPPING();
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl unknown_nmi_exception bl unknown_nmi_exception
b ret_from_crit_except b ret_from_crit_except
@ -866,7 +866,7 @@ kernel_dbg_exc:
NORMAL_EXCEPTION_PROLOG(0x310, BOOKE_INTERRUPT_HV_SYSCALL, NORMAL_EXCEPTION_PROLOG(0x310, BOOKE_INTERRUPT_HV_SYSCALL,
PROLOG_ADDITION_NONE) PROLOG_ADDITION_NONE)
EXCEPTION_COMMON(0x310) EXCEPTION_COMMON(0x310)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl unknown_exception bl unknown_exception
b interrupt_return b interrupt_return
@ -875,7 +875,7 @@ kernel_dbg_exc:
NORMAL_EXCEPTION_PROLOG(0x320, BOOKE_INTERRUPT_HV_PRIV, NORMAL_EXCEPTION_PROLOG(0x320, BOOKE_INTERRUPT_HV_PRIV,
PROLOG_ADDITION_NONE) PROLOG_ADDITION_NONE)
EXCEPTION_COMMON(0x320) EXCEPTION_COMMON(0x320)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl unknown_exception bl unknown_exception
b interrupt_return b interrupt_return
@ -884,7 +884,7 @@ kernel_dbg_exc:
NORMAL_EXCEPTION_PROLOG(0x340, BOOKE_INTERRUPT_LRAT_ERROR, NORMAL_EXCEPTION_PROLOG(0x340, BOOKE_INTERRUPT_LRAT_ERROR,
PROLOG_ADDITION_NONE) PROLOG_ADDITION_NONE)
EXCEPTION_COMMON(0x340) EXCEPTION_COMMON(0x340)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl unknown_exception bl unknown_exception
b interrupt_return b interrupt_return
@ -979,7 +979,7 @@ masked_interrupt_book3e_0x2c0:
* original values stashed away in the PACA * original values stashed away in the PACA
*/ */
storage_fault_common: storage_fault_common:
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl do_page_fault bl do_page_fault
b interrupt_return b interrupt_return
@ -988,7 +988,7 @@ storage_fault_common:
* continues here. * continues here.
*/ */
alignment_more: alignment_more:
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl alignment_exception bl alignment_exception
REST_NVGPRS(r1) REST_NVGPRS(r1)
b interrupt_return b interrupt_return
@ -1069,7 +1069,7 @@ bad_stack_book3e:
ZEROIZE_GPR(12) ZEROIZE_GPR(12)
std r12,0(r11) std r12,0(r11)
LOAD_PACA_TOC() LOAD_PACA_TOC()
1: addi r3,r1,STACK_FRAME_OVERHEAD 1: addi r3,r1,STACK_INT_FRAME_REGS
bl kernel_bad_stack bl kernel_bad_stack
b 1b b 1b

View File

@ -1061,7 +1061,7 @@ EXC_COMMON_BEGIN(system_reset_common)
subi r1,r1,INT_FRAME_SIZE subi r1,r1,INT_FRAME_SIZE
__GEN_COMMON_BODY system_reset __GEN_COMMON_BODY system_reset
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl system_reset_exception bl system_reset_exception
/* Clear MSR_RI before setting SRR0 and SRR1. */ /* Clear MSR_RI before setting SRR0 and SRR1. */
@ -1208,7 +1208,7 @@ EXC_COMMON_BEGIN(machine_check_early_common)
BEGIN_FTR_SECTION BEGIN_FTR_SECTION
bl enable_machine_check bl enable_machine_check
END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
BEGIN_FTR_SECTION BEGIN_FTR_SECTION
bl machine_check_early_boot bl machine_check_early_boot
END_FTR_SECTION(0, 1) // nop out after boot END_FTR_SECTION(0, 1) // nop out after boot
@ -1298,7 +1298,7 @@ EXC_COMMON_BEGIN(machine_check_common)
* save area: PACA_EXMC instead of PACA_EXGEN. * save area: PACA_EXMC instead of PACA_EXGEN.
*/ */
GEN_COMMON machine_check GEN_COMMON machine_check
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl machine_check_exception_async bl machine_check_exception_async
b interrupt_return_srr b interrupt_return_srr
@ -1364,14 +1364,14 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)
* This is the NMI version of the handler because we are called from * This is the NMI version of the handler because we are called from
* the early handler which is a true NMI. * the early handler which is a true NMI.
*/ */
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl machine_check_exception bl machine_check_exception
/* /*
* We will not reach here. Even if we did, there is no way out. * We will not reach here. Even if we did, there is no way out.
* Call unrecoverable_exception and die. * Call unrecoverable_exception and die.
*/ */
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl unrecoverable_exception bl unrecoverable_exception
b . b .
@ -1422,7 +1422,7 @@ EXC_VIRT_END(data_access, 0x4300, 0x80)
EXC_COMMON_BEGIN(data_access_common) EXC_COMMON_BEGIN(data_access_common)
GEN_COMMON data_access GEN_COMMON data_access
ld r4,_DSISR(r1) ld r4,_DSISR(r1)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
andis. r0,r4,DSISR_DABRMATCH@h andis. r0,r4,DSISR_DABRMATCH@h
bne- 1f bne- 1f
#ifdef CONFIG_PPC_64S_HASH_MMU #ifdef CONFIG_PPC_64S_HASH_MMU
@ -1479,7 +1479,7 @@ EXC_COMMON_BEGIN(data_access_slb_common)
#ifdef CONFIG_PPC_64S_HASH_MMU #ifdef CONFIG_PPC_64S_HASH_MMU
BEGIN_MMU_FTR_SECTION BEGIN_MMU_FTR_SECTION
/* HPT case, do SLB fault */ /* HPT case, do SLB fault */
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl do_slb_fault bl do_slb_fault
cmpdi r3,0 cmpdi r3,0
bne- 1f bne- 1f
@ -1493,7 +1493,7 @@ ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX)
li r3,-EFAULT li r3,-EFAULT
#endif #endif
std r3,RESULT(r1) std r3,RESULT(r1)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl do_bad_segment_interrupt bl do_bad_segment_interrupt
b interrupt_return_srr b interrupt_return_srr
@ -1525,7 +1525,7 @@ EXC_VIRT_BEGIN(instruction_access, 0x4400, 0x80)
EXC_VIRT_END(instruction_access, 0x4400, 0x80) EXC_VIRT_END(instruction_access, 0x4400, 0x80)
EXC_COMMON_BEGIN(instruction_access_common) EXC_COMMON_BEGIN(instruction_access_common)
GEN_COMMON instruction_access GEN_COMMON instruction_access
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
#ifdef CONFIG_PPC_64S_HASH_MMU #ifdef CONFIG_PPC_64S_HASH_MMU
BEGIN_MMU_FTR_SECTION BEGIN_MMU_FTR_SECTION
bl do_hash_fault bl do_hash_fault
@ -1567,7 +1567,7 @@ EXC_COMMON_BEGIN(instruction_access_slb_common)
#ifdef CONFIG_PPC_64S_HASH_MMU #ifdef CONFIG_PPC_64S_HASH_MMU
BEGIN_MMU_FTR_SECTION BEGIN_MMU_FTR_SECTION
/* HPT case, do SLB fault */ /* HPT case, do SLB fault */
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl do_slb_fault bl do_slb_fault
cmpdi r3,0 cmpdi r3,0
bne- 1f bne- 1f
@ -1581,7 +1581,7 @@ ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX)
li r3,-EFAULT li r3,-EFAULT
#endif #endif
std r3,RESULT(r1) std r3,RESULT(r1)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl do_bad_segment_interrupt bl do_bad_segment_interrupt
b interrupt_return_srr b interrupt_return_srr
@ -1635,7 +1635,7 @@ EXC_VIRT_BEGIN(hardware_interrupt, 0x4500, 0x100)
EXC_VIRT_END(hardware_interrupt, 0x4500, 0x100) EXC_VIRT_END(hardware_interrupt, 0x4500, 0x100)
EXC_COMMON_BEGIN(hardware_interrupt_common) EXC_COMMON_BEGIN(hardware_interrupt_common)
GEN_COMMON hardware_interrupt GEN_COMMON hardware_interrupt
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl do_IRQ bl do_IRQ
BEGIN_FTR_SECTION BEGIN_FTR_SECTION
b interrupt_return_hsrr b interrupt_return_hsrr
@ -1665,7 +1665,7 @@ EXC_VIRT_BEGIN(alignment, 0x4600, 0x100)
EXC_VIRT_END(alignment, 0x4600, 0x100) EXC_VIRT_END(alignment, 0x4600, 0x100)
EXC_COMMON_BEGIN(alignment_common) EXC_COMMON_BEGIN(alignment_common)
GEN_COMMON alignment GEN_COMMON alignment
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl alignment_exception bl alignment_exception
REST_NVGPRS(r1) /* instruction emulation may change GPRs */ REST_NVGPRS(r1) /* instruction emulation may change GPRs */
b interrupt_return_srr b interrupt_return_srr
@ -1731,7 +1731,7 @@ EXC_COMMON_BEGIN(program_check_common)
__GEN_COMMON_BODY program_check __GEN_COMMON_BODY program_check
.Ldo_program_check: .Ldo_program_check:
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl program_check_exception bl program_check_exception
REST_NVGPRS(r1) /* instruction emulation may change GPRs */ REST_NVGPRS(r1) /* instruction emulation may change GPRs */
b interrupt_return_srr b interrupt_return_srr
@ -1762,7 +1762,7 @@ EXC_VIRT_END(fp_unavailable, 0x4800, 0x100)
EXC_COMMON_BEGIN(fp_unavailable_common) EXC_COMMON_BEGIN(fp_unavailable_common)
GEN_COMMON fp_unavailable GEN_COMMON fp_unavailable
bne 1f /* if from user, just load it up */ bne 1f /* if from user, just load it up */
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl kernel_fp_unavailable_exception bl kernel_fp_unavailable_exception
0: trap 0: trap
EMIT_BUG_ENTRY 0b, __FILE__, __LINE__, 0 EMIT_BUG_ENTRY 0b, __FILE__, __LINE__, 0
@ -1780,7 +1780,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_TM)
b fast_interrupt_return_srr b fast_interrupt_return_srr
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
2: /* User process was in a transaction */ 2: /* User process was in a transaction */
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl fp_unavailable_tm bl fp_unavailable_tm
b interrupt_return_srr b interrupt_return_srr
#endif #endif
@ -1824,7 +1824,7 @@ EXC_VIRT_BEGIN(decrementer, 0x4900, 0x80)
EXC_VIRT_END(decrementer, 0x4900, 0x80) EXC_VIRT_END(decrementer, 0x4900, 0x80)
EXC_COMMON_BEGIN(decrementer_common) EXC_COMMON_BEGIN(decrementer_common)
GEN_COMMON decrementer GEN_COMMON decrementer
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl timer_interrupt bl timer_interrupt
b interrupt_return_srr b interrupt_return_srr
@ -1909,7 +1909,7 @@ EXC_VIRT_BEGIN(doorbell_super, 0x4a00, 0x100)
EXC_VIRT_END(doorbell_super, 0x4a00, 0x100) EXC_VIRT_END(doorbell_super, 0x4a00, 0x100)
EXC_COMMON_BEGIN(doorbell_super_common) EXC_COMMON_BEGIN(doorbell_super_common)
GEN_COMMON doorbell_super GEN_COMMON doorbell_super
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
#ifdef CONFIG_PPC_DOORBELL #ifdef CONFIG_PPC_DOORBELL
bl doorbell_exception bl doorbell_exception
#else #else
@ -2076,7 +2076,7 @@ EXC_VIRT_BEGIN(single_step, 0x4d00, 0x100)
EXC_VIRT_END(single_step, 0x4d00, 0x100) EXC_VIRT_END(single_step, 0x4d00, 0x100)
EXC_COMMON_BEGIN(single_step_common) EXC_COMMON_BEGIN(single_step_common)
GEN_COMMON single_step GEN_COMMON single_step
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl single_step_exception bl single_step_exception
b interrupt_return_srr b interrupt_return_srr
@ -2110,7 +2110,7 @@ EXC_VIRT_BEGIN(h_data_storage, 0x4e00, 0x20)
EXC_VIRT_END(h_data_storage, 0x4e00, 0x20) EXC_VIRT_END(h_data_storage, 0x4e00, 0x20)
EXC_COMMON_BEGIN(h_data_storage_common) EXC_COMMON_BEGIN(h_data_storage_common)
GEN_COMMON h_data_storage GEN_COMMON h_data_storage
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
BEGIN_MMU_FTR_SECTION BEGIN_MMU_FTR_SECTION
bl do_bad_page_fault_segv bl do_bad_page_fault_segv
MMU_FTR_SECTION_ELSE MMU_FTR_SECTION_ELSE
@ -2139,7 +2139,7 @@ EXC_VIRT_BEGIN(h_instr_storage, 0x4e20, 0x20)
EXC_VIRT_END(h_instr_storage, 0x4e20, 0x20) EXC_VIRT_END(h_instr_storage, 0x4e20, 0x20)
EXC_COMMON_BEGIN(h_instr_storage_common) EXC_COMMON_BEGIN(h_instr_storage_common)
GEN_COMMON h_instr_storage GEN_COMMON h_instr_storage
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl unknown_exception bl unknown_exception
b interrupt_return_hsrr b interrupt_return_hsrr
@ -2162,7 +2162,7 @@ EXC_VIRT_BEGIN(emulation_assist, 0x4e40, 0x20)
EXC_VIRT_END(emulation_assist, 0x4e40, 0x20) EXC_VIRT_END(emulation_assist, 0x4e40, 0x20)
EXC_COMMON_BEGIN(emulation_assist_common) EXC_COMMON_BEGIN(emulation_assist_common)
GEN_COMMON emulation_assist GEN_COMMON emulation_assist
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl emulation_assist_interrupt bl emulation_assist_interrupt
REST_NVGPRS(r1) /* instruction emulation may change GPRs */ REST_NVGPRS(r1) /* instruction emulation may change GPRs */
b interrupt_return_hsrr b interrupt_return_hsrr
@ -2222,7 +2222,7 @@ EXC_COMMON_BEGIN(hmi_exception_early_common)
__GEN_COMMON_BODY hmi_exception_early __GEN_COMMON_BODY hmi_exception_early
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl hmi_exception_realmode bl hmi_exception_realmode
cmpdi cr0,r3,0 cmpdi cr0,r3,0
bne 1f bne 1f
@ -2240,7 +2240,7 @@ EXC_COMMON_BEGIN(hmi_exception_early_common)
EXC_COMMON_BEGIN(hmi_exception_common) EXC_COMMON_BEGIN(hmi_exception_common)
GEN_COMMON hmi_exception GEN_COMMON hmi_exception
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl handle_hmi_exception bl handle_hmi_exception
b interrupt_return_hsrr b interrupt_return_hsrr
@ -2274,7 +2274,7 @@ EXC_VIRT_BEGIN(h_doorbell, 0x4e80, 0x20)
EXC_VIRT_END(h_doorbell, 0x4e80, 0x20) EXC_VIRT_END(h_doorbell, 0x4e80, 0x20)
EXC_COMMON_BEGIN(h_doorbell_common) EXC_COMMON_BEGIN(h_doorbell_common)
GEN_COMMON h_doorbell GEN_COMMON h_doorbell
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
#ifdef CONFIG_PPC_DOORBELL #ifdef CONFIG_PPC_DOORBELL
bl doorbell_exception bl doorbell_exception
#else #else
@ -2310,7 +2310,7 @@ EXC_VIRT_BEGIN(h_virt_irq, 0x4ea0, 0x20)
EXC_VIRT_END(h_virt_irq, 0x4ea0, 0x20) EXC_VIRT_END(h_virt_irq, 0x4ea0, 0x20)
EXC_COMMON_BEGIN(h_virt_irq_common) EXC_COMMON_BEGIN(h_virt_irq_common)
GEN_COMMON h_virt_irq GEN_COMMON h_virt_irq
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl do_IRQ bl do_IRQ
b interrupt_return_hsrr b interrupt_return_hsrr
@ -2356,7 +2356,7 @@ EXC_VIRT_BEGIN(performance_monitor, 0x4f00, 0x20)
EXC_VIRT_END(performance_monitor, 0x4f00, 0x20) EXC_VIRT_END(performance_monitor, 0x4f00, 0x20)
EXC_COMMON_BEGIN(performance_monitor_common) EXC_COMMON_BEGIN(performance_monitor_common)
GEN_COMMON performance_monitor GEN_COMMON performance_monitor
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
lbz r4,PACAIRQSOFTMASK(r13) lbz r4,PACAIRQSOFTMASK(r13)
cmpdi r4,IRQS_ENABLED cmpdi r4,IRQS_ENABLED
bne 1f bne 1f
@ -2410,14 +2410,14 @@ BEGIN_FTR_SECTION
b fast_interrupt_return_srr b fast_interrupt_return_srr
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
2: /* User process was in a transaction */ 2: /* User process was in a transaction */
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl altivec_unavailable_tm bl altivec_unavailable_tm
b interrupt_return_srr b interrupt_return_srr
#endif #endif
1: 1:
END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
#endif #endif
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl altivec_unavailable_exception bl altivec_unavailable_exception
b interrupt_return_srr b interrupt_return_srr
@ -2458,14 +2458,14 @@ BEGIN_FTR_SECTION
b load_up_vsx b load_up_vsx
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
2: /* User process was in a transaction */ 2: /* User process was in a transaction */
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl vsx_unavailable_tm bl vsx_unavailable_tm
b interrupt_return_srr b interrupt_return_srr
#endif #endif
1: 1:
END_FTR_SECTION_IFSET(CPU_FTR_VSX) END_FTR_SECTION_IFSET(CPU_FTR_VSX)
#endif #endif
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl vsx_unavailable_exception bl vsx_unavailable_exception
b interrupt_return_srr b interrupt_return_srr
@ -2492,7 +2492,7 @@ EXC_VIRT_BEGIN(facility_unavailable, 0x4f60, 0x20)
EXC_VIRT_END(facility_unavailable, 0x4f60, 0x20) EXC_VIRT_END(facility_unavailable, 0x4f60, 0x20)
EXC_COMMON_BEGIN(facility_unavailable_common) EXC_COMMON_BEGIN(facility_unavailable_common)
GEN_COMMON facility_unavailable GEN_COMMON facility_unavailable
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl facility_unavailable_exception bl facility_unavailable_exception
REST_NVGPRS(r1) /* instruction emulation may change GPRs */ REST_NVGPRS(r1) /* instruction emulation may change GPRs */
b interrupt_return_srr b interrupt_return_srr
@ -2520,7 +2520,7 @@ EXC_VIRT_BEGIN(h_facility_unavailable, 0x4f80, 0x20)
EXC_VIRT_END(h_facility_unavailable, 0x4f80, 0x20) EXC_VIRT_END(h_facility_unavailable, 0x4f80, 0x20)
EXC_COMMON_BEGIN(h_facility_unavailable_common) EXC_COMMON_BEGIN(h_facility_unavailable_common)
GEN_COMMON h_facility_unavailable GEN_COMMON h_facility_unavailable
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl facility_unavailable_exception bl facility_unavailable_exception
REST_NVGPRS(r1) /* XXX Shouldn't be necessary in practice */ REST_NVGPRS(r1) /* XXX Shouldn't be necessary in practice */
b interrupt_return_hsrr b interrupt_return_hsrr
@ -2550,7 +2550,7 @@ EXC_REAL_END(cbe_system_error, 0x1200, 0x100)
EXC_VIRT_NONE(0x5200, 0x100) EXC_VIRT_NONE(0x5200, 0x100)
EXC_COMMON_BEGIN(cbe_system_error_common) EXC_COMMON_BEGIN(cbe_system_error_common)
GEN_COMMON cbe_system_error GEN_COMMON cbe_system_error
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl cbe_system_error_exception bl cbe_system_error_exception
b interrupt_return_hsrr b interrupt_return_hsrr
@ -2581,7 +2581,7 @@ EXC_VIRT_BEGIN(instruction_breakpoint, 0x5300, 0x100)
EXC_VIRT_END(instruction_breakpoint, 0x5300, 0x100) EXC_VIRT_END(instruction_breakpoint, 0x5300, 0x100)
EXC_COMMON_BEGIN(instruction_breakpoint_common) EXC_COMMON_BEGIN(instruction_breakpoint_common)
GEN_COMMON instruction_breakpoint GEN_COMMON instruction_breakpoint
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl instruction_breakpoint_exception bl instruction_breakpoint_exception
b interrupt_return_srr b interrupt_return_srr
@ -2703,7 +2703,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_CFAR)
EXC_COMMON_BEGIN(denorm_exception_common) EXC_COMMON_BEGIN(denorm_exception_common)
GEN_COMMON denorm_exception GEN_COMMON denorm_exception
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl unknown_exception bl unknown_exception
b interrupt_return_hsrr b interrupt_return_hsrr
@ -2720,7 +2720,7 @@ EXC_REAL_END(cbe_maintenance, 0x1600, 0x100)
EXC_VIRT_NONE(0x5600, 0x100) EXC_VIRT_NONE(0x5600, 0x100)
EXC_COMMON_BEGIN(cbe_maintenance_common) EXC_COMMON_BEGIN(cbe_maintenance_common)
GEN_COMMON cbe_maintenance GEN_COMMON cbe_maintenance
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl cbe_maintenance_exception bl cbe_maintenance_exception
b interrupt_return_hsrr b interrupt_return_hsrr
@ -2745,7 +2745,7 @@ EXC_VIRT_BEGIN(altivec_assist, 0x5700, 0x100)
EXC_VIRT_END(altivec_assist, 0x5700, 0x100) EXC_VIRT_END(altivec_assist, 0x5700, 0x100)
EXC_COMMON_BEGIN(altivec_assist_common) EXC_COMMON_BEGIN(altivec_assist_common)
GEN_COMMON altivec_assist GEN_COMMON altivec_assist
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
#ifdef CONFIG_ALTIVEC #ifdef CONFIG_ALTIVEC
bl altivec_assist_exception bl altivec_assist_exception
REST_NVGPRS(r1) /* instruction emulation may change GPRs */ REST_NVGPRS(r1) /* instruction emulation may change GPRs */
@ -2767,7 +2767,7 @@ EXC_REAL_END(cbe_thermal, 0x1800, 0x100)
EXC_VIRT_NONE(0x5800, 0x100) EXC_VIRT_NONE(0x5800, 0x100)
EXC_COMMON_BEGIN(cbe_thermal_common) EXC_COMMON_BEGIN(cbe_thermal_common)
GEN_COMMON cbe_thermal GEN_COMMON cbe_thermal
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl cbe_thermal_exception bl cbe_thermal_exception
b interrupt_return_hsrr b interrupt_return_hsrr
@ -2800,7 +2800,7 @@ EXC_COMMON_BEGIN(soft_nmi_common)
subi r1,r1,INT_FRAME_SIZE subi r1,r1,INT_FRAME_SIZE
__GEN_COMMON_BODY soft_nmi __GEN_COMMON_BODY soft_nmi
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl soft_nmi_interrupt bl soft_nmi_interrupt
/* Clear MSR_RI before setting SRR0 and SRR1. */ /* Clear MSR_RI before setting SRR0 and SRR1. */

View File

@ -127,7 +127,7 @@ _ASM_NOKPROBE_SYMBOL(\name\()_virt)
mfspr r10,SPRN_XER mfspr r10,SPRN_XER
addi r2, r2, -THREAD addi r2, r2, -THREAD
stw r10,_XER(r1) stw r10,_XER(r1)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
.endm .endm
.macro prepare_transfer_to_handler .macro prepare_transfer_to_handler

View File

@ -972,10 +972,10 @@ _GLOBAL(__giveup_spe)
li r4,THREAD_ACC li r4,THREAD_ACC
evstddx evr6, r4, r3 /* save off accumulator */ evstddx evr6, r4, r3 /* save off accumulator */
beq 1f beq 1f
lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5) lwz r4,_MSR-STACK_INT_FRAME_REGS(r5)
lis r3,MSR_SPE@h lis r3,MSR_SPE@h
andc r4,r4,r3 /* disable SPE for previous task */ andc r4,r4,r3 /* disable SPE for previous task */
stw r4,_MSR-STACK_FRAME_OVERHEAD(r5) stw r4,_MSR-STACK_INT_FRAME_REGS(r5)
1: 1:
blr blr
#endif /* CONFIG_SPE */ #endif /* CONFIG_SPE */

View File

@ -99,7 +99,7 @@ END_BTB_FLUSH_SECTION
mfspr r10,SPRN_XER mfspr r10,SPRN_XER
addi r2, r2, -THREAD addi r2, r2, -THREAD
stw r10,_XER(r1) stw r10,_XER(r1)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
.endm .endm
.macro prepare_transfer_to_handler .macro prepare_transfer_to_handler

View File

@ -78,7 +78,7 @@ _ASM_NOKPROBE_SYMBOL(system_call_vectored_\name)
std r12,_CCR(r1) std r12,_CCR(r1)
std r3,ORIG_GPR3(r1) std r3,ORIG_GPR3(r1)
/* Calling convention has r3 = regs, r4 = orig r0 */ /* Calling convention has r3 = regs, r4 = orig r0 */
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
mr r4,r0 mr r4,r0
LOAD_REG_IMMEDIATE(r11, STACK_FRAME_REGS_MARKER) LOAD_REG_IMMEDIATE(r11, STACK_FRAME_REGS_MARKER)
std r11,-16(r3) /* "regshere" marker */ std r11,-16(r3) /* "regshere" marker */
@ -99,7 +99,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
bl system_call_exception bl system_call_exception
.Lsyscall_vectored_\name\()_exit: .Lsyscall_vectored_\name\()_exit:
addi r4,r1,STACK_FRAME_OVERHEAD addi r4,r1,STACK_INT_FRAME_REGS
li r5,1 /* scv */ li r5,1 /* scv */
bl syscall_exit_prepare bl syscall_exit_prepare
std r1,PACA_EXIT_SAVE_R1(r13) /* save r1 for restart */ std r1,PACA_EXIT_SAVE_R1(r13) /* save r1 for restart */
@ -176,7 +176,7 @@ _ASM_NOKPROBE_SYMBOL(syscall_vectored_\name\()_restart)
ld r1,PACA_EXIT_SAVE_R1(r13) ld r1,PACA_EXIT_SAVE_R1(r13)
LOAD_PACA_TOC() LOAD_PACA_TOC()
ld r3,RESULT(r1) ld r3,RESULT(r1)
addi r4,r1,STACK_FRAME_OVERHEAD addi r4,r1,STACK_INT_FRAME_REGS
li r11,IRQS_ALL_DISABLED li r11,IRQS_ALL_DISABLED
stb r11,PACAIRQSOFTMASK(r13) stb r11,PACAIRQSOFTMASK(r13)
bl syscall_exit_restart bl syscall_exit_restart
@ -251,7 +251,7 @@ END_BTB_FLUSH_SECTION
std r12,_CCR(r1) std r12,_CCR(r1)
std r3,ORIG_GPR3(r1) std r3,ORIG_GPR3(r1)
/* Calling convention has r3 = regs, r4 = orig r0 */ /* Calling convention has r3 = regs, r4 = orig r0 */
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
mr r4,r0 mr r4,r0
LOAD_REG_IMMEDIATE(r11, STACK_FRAME_REGS_MARKER) LOAD_REG_IMMEDIATE(r11, STACK_FRAME_REGS_MARKER)
std r11,-16(r3) /* "regshere" marker */ std r11,-16(r3) /* "regshere" marker */
@ -278,7 +278,7 @@ END_BTB_FLUSH_SECTION
bl system_call_exception bl system_call_exception
.Lsyscall_exit: .Lsyscall_exit:
addi r4,r1,STACK_FRAME_OVERHEAD addi r4,r1,STACK_INT_FRAME_REGS
li r5,0 /* !scv */ li r5,0 /* !scv */
bl syscall_exit_prepare bl syscall_exit_prepare
std r1,PACA_EXIT_SAVE_R1(r13) /* save r1 for restart */ std r1,PACA_EXIT_SAVE_R1(r13) /* save r1 for restart */
@ -357,7 +357,7 @@ _ASM_NOKPROBE_SYMBOL(syscall_restart)
ld r1,PACA_EXIT_SAVE_R1(r13) ld r1,PACA_EXIT_SAVE_R1(r13)
LOAD_PACA_TOC() LOAD_PACA_TOC()
ld r3,RESULT(r1) ld r3,RESULT(r1)
addi r4,r1,STACK_FRAME_OVERHEAD addi r4,r1,STACK_INT_FRAME_REGS
li r11,IRQS_ALL_DISABLED li r11,IRQS_ALL_DISABLED
stb r11,PACAIRQSOFTMASK(r13) stb r11,PACAIRQSOFTMASK(r13)
bl syscall_exit_restart bl syscall_exit_restart
@ -388,7 +388,7 @@ _ASM_NOKPROBE_SYMBOL(fast_interrupt_return_srr)
andi. r0,r5,MSR_RI andi. r0,r5,MSR_RI
li r3,0 /* 0 return value, no EMULATE_STACK_STORE */ li r3,0 /* 0 return value, no EMULATE_STACK_STORE */
bne+ .Lfast_kernel_interrupt_return_srr bne+ .Lfast_kernel_interrupt_return_srr
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl unrecoverable_exception bl unrecoverable_exception
b . /* should not get here */ b . /* should not get here */
#else #else
@ -406,7 +406,7 @@ _ASM_NOKPROBE_SYMBOL(interrupt_return_\srr\())
beq interrupt_return_\srr\()_kernel beq interrupt_return_\srr\()_kernel
interrupt_return_\srr\()_user: /* make backtraces match the _kernel variant */ interrupt_return_\srr\()_user: /* make backtraces match the _kernel variant */
_ASM_NOKPROBE_SYMBOL(interrupt_return_\srr\()_user) _ASM_NOKPROBE_SYMBOL(interrupt_return_\srr\()_user)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl interrupt_exit_user_prepare bl interrupt_exit_user_prepare
cmpdi r3,0 cmpdi r3,0
bne- .Lrestore_nvgprs_\srr bne- .Lrestore_nvgprs_\srr
@ -503,7 +503,7 @@ _ASM_NOKPROBE_SYMBOL(interrupt_return_\srr\()_user_restart)
GET_PACA(r13) GET_PACA(r13)
ld r1,PACA_EXIT_SAVE_R1(r13) ld r1,PACA_EXIT_SAVE_R1(r13)
LOAD_PACA_TOC() LOAD_PACA_TOC()
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
li r11,IRQS_ALL_DISABLED li r11,IRQS_ALL_DISABLED
stb r11,PACAIRQSOFTMASK(r13) stb r11,PACAIRQSOFTMASK(r13)
bl interrupt_exit_user_restart bl interrupt_exit_user_restart
@ -518,7 +518,7 @@ RESTART_TABLE(.Linterrupt_return_\srr\()_user_rst_start, .Linterrupt_return_\srr
.balign IFETCH_ALIGN_BYTES .balign IFETCH_ALIGN_BYTES
interrupt_return_\srr\()_kernel: interrupt_return_\srr\()_kernel:
_ASM_NOKPROBE_SYMBOL(interrupt_return_\srr\()_kernel) _ASM_NOKPROBE_SYMBOL(interrupt_return_\srr\()_kernel)
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
bl interrupt_exit_kernel_prepare bl interrupt_exit_kernel_prepare
std r1,PACA_EXIT_SAVE_R1(r13) /* save r1 for restart */ std r1,PACA_EXIT_SAVE_R1(r13) /* save r1 for restart */
@ -684,7 +684,7 @@ _ASM_NOKPROBE_SYMBOL(interrupt_return_\srr\()_kernel_restart)
GET_PACA(r13) GET_PACA(r13)
ld r1,PACA_EXIT_SAVE_R1(r13) ld r1,PACA_EXIT_SAVE_R1(r13)
LOAD_PACA_TOC() LOAD_PACA_TOC()
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
li r11,IRQS_ALL_DISABLED li r11,IRQS_ALL_DISABLED
stb r11,PACAIRQSOFTMASK(r13) stb r11,PACAIRQSOFTMASK(r13)
bl interrupt_exit_kernel_restart bl interrupt_exit_kernel_restart

View File

@ -191,7 +191,7 @@ static int kgdb_break_match(struct pt_regs *regs)
void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p) void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
{ {
struct pt_regs *regs = (struct pt_regs *)(p->thread.ksp + struct pt_regs *regs = (struct pt_regs *)(p->thread.ksp +
STACK_FRAME_OVERHEAD); STACK_INT_FRAME_REGS);
unsigned long *ptr = gdb_regs; unsigned long *ptr = gdb_regs;
int reg; int reg;

View File

@ -85,7 +85,7 @@ optprobe_template_op_address:
TEMPLATE_FOR_IMM_LOAD_INSNS TEMPLATE_FOR_IMM_LOAD_INSNS
/* 2. pt_regs pointer in r4 */ /* 2. pt_regs pointer in r4 */
addi r4,r1,STACK_FRAME_OVERHEAD addi r4,r1,STACK_INT_FRAME_REGS
.global optprobe_template_call_handler .global optprobe_template_call_handler
optprobe_template_call_handler: optprobe_template_call_handler:
@ -96,7 +96,7 @@ optprobe_template_call_handler:
* Parameters for instruction emulation: * Parameters for instruction emulation:
* 1. Pass SP in register r3. * 1. Pass SP in register r3.
*/ */
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_INT_FRAME_REGS
.global optprobe_template_insn .global optprobe_template_insn
optprobe_template_insn: optprobe_template_insn:

View File

@ -22,7 +22,7 @@
*/ */
_GLOBAL(ppc_save_regs) _GLOBAL(ppc_save_regs)
/* This allows stack frame accessor macros and offsets to be used */ /* This allows stack frame accessor macros and offsets to be used */
subi r3,r3,STACK_FRAME_OVERHEAD subi r3,r3,STACK_INT_FRAME_REGS
PPC_STL r0,GPR0(r3) PPC_STL r0,GPR0(r3)
#ifdef CONFIG_PPC32 #ifdef CONFIG_PPC32
stmw r2,GPR2(r3) stmw r2,GPR2(r3)

View File

@ -2260,12 +2260,12 @@ void __no_sanitize_address show_stack(struct task_struct *tsk,
/* /*
* See if this is an exception frame. * See if this is an exception frame.
* We look for the "regshere" marker in the current frame. * We look for the "regs" marker in the current frame.
*/ */
if (validate_sp(sp, tsk, STACK_FRAME_WITH_PT_REGS) if (validate_sp(sp, tsk, STACK_FRAME_WITH_PT_REGS)
&& stack[STACK_FRAME_MARKER] == STACK_FRAME_REGS_MARKER) { && stack[STACK_FRAME_MARKER] == STACK_FRAME_REGS_MARKER) {
struct pt_regs *regs = (struct pt_regs *) struct pt_regs *regs = (struct pt_regs *)
(sp + STACK_FRAME_OVERHEAD); (sp + STACK_INT_FRAME_REGS);
lr = regs->link; lr = regs->link;
printk("%s--- interrupt: %lx at %pS\n", printk("%s--- interrupt: %lx at %pS\n",

View File

@ -117,7 +117,7 @@ _GLOBAL(tm_reclaim)
std r2, STK_GOT(r1) std r2, STK_GOT(r1)
stdu r1, -TM_FRAME_SIZE(r1) stdu r1, -TM_FRAME_SIZE(r1)
/* We've a struct pt_regs at [r1+STACK_FRAME_OVERHEAD]. */ /* We've a struct pt_regs at [r1+STACK_INT_FRAME_REGS]. */
std r3, STK_PARAM(R3)(r1) std r3, STK_PARAM(R3)(r1)
SAVE_NVGPRS(r1) SAVE_NVGPRS(r1)
@ -222,7 +222,7 @@ _GLOBAL(tm_reclaim)
* Make r7 look like an exception frame so that we can use the neat * Make r7 look like an exception frame so that we can use the neat
* GPRx(n) macros. r7 is NOT a pt_regs ptr! * GPRx(n) macros. r7 is NOT a pt_regs ptr!
*/ */
subi r7, r7, STACK_FRAME_OVERHEAD subi r7, r7, STACK_INT_FRAME_REGS
/* Sync the userland GPRs 2-12, 14-31 to thread->regs: */ /* Sync the userland GPRs 2-12, 14-31 to thread->regs: */
SAVE_GPR(0, r7) /* user r0 */ SAVE_GPR(0, r7) /* user r0 */
@ -359,7 +359,7 @@ _GLOBAL(__tm_recheckpoint)
stdu r1, -TM_FRAME_SIZE(r1) stdu r1, -TM_FRAME_SIZE(r1)
/* /*
* We've a struct pt_regs at [r1+STACK_FRAME_OVERHEAD]. * We've a struct pt_regs at [r1+STACK_INT_FRAME_REGS].
* This is used for backing up the NVGPRs: * This is used for backing up the NVGPRs:
*/ */
SAVE_NVGPRS(r1) SAVE_NVGPRS(r1)
@ -379,7 +379,7 @@ _GLOBAL(__tm_recheckpoint)
* Make r7 look like an exception frame so that we can use the neat * Make r7 look like an exception frame so that we can use the neat
* GPRx(n) macros. r7 is now NOT a pt_regs ptr! * GPRx(n) macros. r7 is now NOT a pt_regs ptr!
*/ */
subi r7, r7, STACK_FRAME_OVERHEAD subi r7, r7, STACK_INT_FRAME_REGS
/* We need to setup MSR for FP/VMX/VSX register save instructions. */ /* We need to setup MSR for FP/VMX/VSX register save instructions. */
mfmsr r6 mfmsr r6

View File

@ -110,7 +110,7 @@
.endif .endif
/* Load &pt_regs in r6 for call below */ /* Load &pt_regs in r6 for call below */
addi r6, r1, STACK_FRAME_OVERHEAD addi r6, r1, STACK_INT_FRAME_REGS
.endm .endm
.macro ftrace_regs_exit allregs .macro ftrace_regs_exit allregs

View File

@ -16,7 +16,7 @@ _GLOBAL(exec_instr)
/* /*
* Stack frame layout (INT_FRAME_SIZE bytes) * Stack frame layout (INT_FRAME_SIZE bytes)
* In-memory pt_regs (SP + STACK_FRAME_OVERHEAD) * In-memory pt_regs (SP + STACK_INT_FRAME_REGS)
* Scratch space (SP + 8) * Scratch space (SP + 8)
* Back chain (SP + 0) * Back chain (SP + 0)
*/ */

View File

@ -67,7 +67,7 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *re
* This looks like an interrupt frame for an * This looks like an interrupt frame for an
* interrupt that occurred in the kernel * interrupt that occurred in the kernel
*/ */
regs = (struct pt_regs *)(sp + STACK_FRAME_OVERHEAD); regs = (struct pt_regs *)(sp + STACK_INT_FRAME_REGS);
next_ip = regs->nip; next_ip = regs->nip;
lr = regs->link; lr = regs->link;
level = 0; level = 0;

View File

@ -1782,14 +1782,13 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr,
xmon_print_symbol(ip, " ", "\n"); xmon_print_symbol(ip, " ", "\n");
} }
/* Look for "regshere" marker to see if this is /* Look for "regs" marker to see if this is
an exception frame. */ an exception frame. */
if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long)) if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long))
&& marker == STACK_FRAME_REGS_MARKER) { && marker == STACK_FRAME_REGS_MARKER) {
if (mread(sp + STACK_FRAME_OVERHEAD, &regs, sizeof(regs)) if (mread(sp + STACK_INT_FRAME_REGS, &regs, sizeof(regs)) != sizeof(regs)) {
!= sizeof(regs)) {
printf("Couldn't read registers at %lx\n", printf("Couldn't read registers at %lx\n",
sp + STACK_FRAME_OVERHEAD); sp + STACK_INT_FRAME_REGS);
break; break;
} }
printf("--- Exception: %lx %s at ", regs.trap, printf("--- Exception: %lx %s at ", regs.trap,