All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Nicholas Piggin <npiggin@gmail.com>
Subject: [PATCH v2 31/44] powerpc/64s/exception: Expand EXCEPTION_PROLOG_COMMON_1 and 2 into caller
Date: Fri,  2 Aug 2019 20:56:56 +1000	[thread overview]
Message-ID: <20190802105709.27696-32-npiggin@gmail.com> (raw)
In-Reply-To: <20190802105709.27696-1-npiggin@gmail.com>

No generated code change except BUG line number constants.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/kernel/exceptions-64s.S | 85 +++++++++++++---------------
 1 file changed, 40 insertions(+), 45 deletions(-)

diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 6ea9a7694bb2..e1a5a5e8d4f7 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -390,49 +390,6 @@ END_FTR_SECTION_NESTED(CPU_FTR_HAS_PPR,CPU_FTR_HAS_PPR,948)
 .endm
 #endif
 
-#define EXCEPTION_PROLOG_COMMON_1()					   \
-	std	r9,_CCR(r1);		/* save CR in stackframe	*/ \
-	std	r11,_NIP(r1);		/* save SRR0 in stackframe	*/ \
-	std	r12,_MSR(r1);		/* save SRR1 in stackframe	*/ \
-	std	r10,0(r1);		/* make stack chain pointer	*/ \
-	std	r0,GPR0(r1);		/* save r0 in stackframe	*/ \
-	std	r10,GPR1(r1);		/* save r1 in stackframe	*/ \
-
-/* Save original regs values from save area to stack frame. */
-#define EXCEPTION_PROLOG_COMMON_2(area, trap)				   \
-	ld	r9,area+EX_R9(r13);	/* move r9, r10 to stackframe	*/ \
-	ld	r10,area+EX_R10(r13);					   \
-	std	r9,GPR9(r1);						   \
-	std	r10,GPR10(r1);						   \
-	ld	r9,area+EX_R11(r13);	/* move r11 - r13 to stackframe	*/ \
-	ld	r10,area+EX_R12(r13);					   \
-	ld	r11,area+EX_R13(r13);					   \
-	std	r9,GPR11(r1);						   \
-	std	r10,GPR12(r1);						   \
-	std	r11,GPR13(r1);						   \
-BEGIN_FTR_SECTION_NESTED(66);						   \
-	ld	r10,area+EX_CFAR(r13);					   \
-	std	r10,ORIG_GPR3(r1);					   \
-END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66);			   \
-	GET_CTR(r10, area);						   \
-	std	r10,_CTR(r1);						   \
-	std	r2,GPR2(r1);		/* save r2 in stackframe	*/ \
-	SAVE_4GPRS(3, r1);		/* save r3 - r6 in stackframe   */ \
-	SAVE_2GPRS(7, r1);		/* save r7, r8 in stackframe	*/ \
-	mflr	r9;			/* Get LR, later save to stack	*/ \
-	ld	r2,PACATOC(r13);	/* get kernel TOC into r2	*/ \
-	std	r9,_LINK(r1);						   \
-	lbz	r10,PACAIRQSOFTMASK(r13);				   \
-	mfspr	r11,SPRN_XER;		/* save XER in stackframe	*/ \
-	std	r10,SOFTE(r1);						   \
-	std	r11,_XER(r1);						   \
-	li	r9,(trap)+1;						   \
-	std	r9,_TRAP(r1);		/* set trap number		*/ \
-	li	r10,0;							   \
-	ld	r11,exception_marker@toc(r2);				   \
-	std	r10,RESULT(r1);		/* clear regs->result		*/ \
-	std	r11,STACK_FRAME_OVERHEAD-16(r1); /* mark the frame	*/
-
 /*
  * On entry r13 points to the paca, r9-r13 are saved in the paca,
  * r9 contains the saved CR, r11 and r12 contain the saved SRR0 and
@@ -452,7 +409,13 @@ END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66);			   \
 	EMIT_BUG_ENTRY 1b,__FILE__,__LINE__,0
 3:
 	.endif
-	EXCEPTION_PROLOG_COMMON_1()
+
+	std	r9,_CCR(r1)		/* save CR in stackframe	*/
+	std	r11,_NIP(r1)		/* save SRR0 in stackframe	*/
+	std	r12,_MSR(r1)		/* save SRR1 in stackframe	*/
+	std	r10,0(r1)		/* make stack chain pointer	*/
+	std	r0,GPR0(r1)		/* save r0 in stackframe	*/
+	std	r10,GPR1(r1)		/* save r1 in stackframe	*/
 
 	.if \stack
 	.if \kaup
@@ -468,7 +431,39 @@ END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66);			   \
 	.endif
 	.endif
 
-	EXCEPTION_PROLOG_COMMON_2(\area, \vec)
+	/* Save original regs values from save area to stack frame. */
+	ld	r9,\area+EX_R9(r13)	/* move r9, r10 to stackframe	*/
+	ld	r10,\area+EX_R10(r13)
+	std	r9,GPR9(r1)
+	std	r10,GPR10(r1)
+	ld	r9,\area+EX_R11(r13)	/* move r11 - r13 to stackframe	*/
+	ld	r10,\area+EX_R12(r13)
+	ld	r11,\area+EX_R13(r13)
+	std	r9,GPR11(r1)
+	std	r10,GPR12(r1)
+	std	r11,GPR13(r1)
+BEGIN_FTR_SECTION_NESTED(66)
+	ld	r10,\area+EX_CFAR(r13)
+	std	r10,ORIG_GPR3(r1)
+END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66)
+	GET_CTR(r10, \area)
+	std	r10,_CTR(r1)
+	std	r2,GPR2(r1)		/* save r2 in stackframe	*/
+	SAVE_4GPRS(3, r1)		/* save r3 - r6 in stackframe   */
+	SAVE_2GPRS(7, r1)		/* save r7, r8 in stackframe	*/
+	mflr	r9			/* Get LR, later save to stack	*/
+	ld	r2,PACATOC(r13)		/* get kernel TOC into r2	*/
+	std	r9,_LINK(r1)
+	lbz	r10,PACAIRQSOFTMASK(r13)
+	mfspr	r11,SPRN_XER		/* save XER in stackframe	*/
+	std	r10,SOFTE(r1)
+	std	r11,_XER(r1)
+	li	r9,(\vec)+1
+	std	r9,_TRAP(r1)		/* set trap number		*/
+	li	r10,0
+	ld	r11,exception_marker@toc(r2)
+	std	r10,RESULT(r1)		/* clear regs->result		*/
+	std	r11,STACK_FRAME_OVERHEAD-16(r1) /* mark the frame	*/
 
 	.if \stack
 	ACCOUNT_STOLEN_TIME
-- 
2.22.0


  parent reply	other threads:[~2019-08-02 12:13 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-02 10:56 [PATCH v2 00/44] powerpc/64s/exception: cleanup and macrofiy, Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 01/44] powerpc/64s/exception: machine check fwnmi remove HV case Nicholas Piggin
2019-09-02  3:29   ` Michael Ellerman
2019-08-02 10:56 ` [PATCH v2 02/44] powerpc/64s/exception: machine check remove bitrotted comment Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 03/44] powerpc/64s/exception: machine check fix KVM guest test Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 04/44] powerpc/64s/exception: machine check adjust RFI target Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 05/44] powerpc/64s/exception: machine check pseries should always run the early handler Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 06/44] powerpc/64s/exception: machine check remove machine_check_pSeries_0 branch Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 07/44] powerpc/64s/exception: machine check use correct cfar for late handler Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 08/44] powerpc/64s/powernv: machine check dump SLB contents Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 09/44] powerpc/64s/pseries: machine check convert to use common event code Nicholas Piggin
2019-08-08  5:01   ` kbuild test robot
2019-08-16 22:25     ` Michael Ellerman
2019-08-19 13:09       ` Nicholas Piggin
2019-08-08  5:50   ` kbuild test robot
2019-08-02 10:56 ` [PATCH v2 10/44] powerpc/64s/exception: machine check pseries should skip the late handler for kernel MCEs Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 11/44] powerpc/64s/exception: machine check restructure to reuse common macros Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 12/44] powerpc/64s/exception: machine check move tramp code Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 13/44] powerpc/64s/exception: simplify machine check early path Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 14/44] powerpc/64s/exception: machine check move unrecoverable handling out of line Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 15/44] powerpc/64s/exception: untangle early machine check handler branch Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 16/44] powerpc/64s/exception: machine check improve labels and comments Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 17/44] powerpc/64s/exception: Fix DAR load for handle_page_fault error case Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 18/44] powerpc/64s/exception: move head-64.h exception code to exception-64s.S Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 19/44] powerpc/64s/exception: Add EXC_HV_OR_STD, which selects HSRR if HVMODE Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 20/44] powerpc/64s/exception: Fix performance monitor virt handler Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 21/44] powerpc/64s/exception: remove 0xb00 handler Nicholas Piggin
2019-08-21 12:18   ` Michael Ellerman
2019-08-02 10:56 ` [PATCH v2 22/44] powerpc/64s/exception: Replace PROLOG macros and EXC helpers with a gas macro Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 23/44] powerpc/64s/exception: remove EXCEPTION_PROLOG_0/1, rename _2 Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 24/44] powerpc/64s/exception: Add the virt variant of the denorm interrupt handler Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 25/44] powerpc/64s/exception: INT_HANDLER support HDAR/HDSISR and use it in HDSI Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 26/44] powerpc/64s/exception: Add INT_KVM_HANDLER gas macro Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 27/44] powerpc/64s/exception: KVM_HANDLER reorder arguments to match other macros Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 28/44] powerpc/64s/exception: Merge EXCEPTION_PROLOG_COMMON_2/3 Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 29/44] powerpc/64s/exception: Add INT_COMMON gas macro to generate common exception code Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 30/44] powerpc/64s/exception: Expand EXCEPTION_COMMON macro into caller Nicholas Piggin
2019-08-02 10:56 ` Nicholas Piggin [this message]
2019-08-02 10:56 ` [PATCH v2 32/44] powerpc/64s/exception: INT_COMMON add DAR, DSISR, reconcile options Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 33/44] powerpc/64s/exception: move interrupt entry code above the common handler Nicholas Piggin
2019-08-02 10:56 ` [PATCH v2 34/44] powerpc/64s/exception: program check handler do not branch into a macro Nicholas Piggin
2019-08-02 10:57 ` [PATCH v2 35/44] powerpc/64s/exception: Remove pointless KVM handler name bifurcation Nicholas Piggin
2019-08-02 10:57 ` [PATCH v2 36/44] powerpc/64s/exception: reduce page fault unnecessary loads Nicholas Piggin
2019-08-02 10:57 ` [PATCH v2 37/44] powerpc/64s/exception: Introduce INT_DEFINE parameter block for code generation Nicholas Piggin
2019-08-02 10:57 ` [PATCH v2 38/44] powerpc/64s/exception: Add GEN_COMMON macro that uses INT_DEFINE parameters Nicholas Piggin
2019-08-02 10:57 ` [PATCH v2 39/44] powerpc/64s/exception: Add GEN_KVM " Nicholas Piggin
2019-08-02 10:57 ` [PATCH v2 40/44] powerpc/64s/exception: Expand EXC_COMMON and EXC_COMMON_ASYNC macros Nicholas Piggin
2019-08-02 10:57 ` [PATCH v2 41/44] powerpc/64s/exception: Move all interrupt handlers to new style code gen macros Nicholas Piggin
2019-08-02 10:57 ` [PATCH v2 42/44] powerpc/64s/exception: Remove old INT_ENTRY macro Nicholas Piggin
2019-08-02 10:57 ` [PATCH v2 43/44] powerpc/64s/exception: Remove old INT_COMMON macro Nicholas Piggin
2019-08-02 10:57 ` [PATCH v2 44/44] powerpc/64s/exception: Remove old INT_KVM_HANDLER Nicholas Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190802105709.27696-32-npiggin@gmail.com \
    --to=npiggin@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.