linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 23/41] powerpc/64s: consolidate Hypervisor Maintenance 0xe60 interrupt
Date: Wed, 21 Sep 2016 17:43:49 +1000	[thread overview]
Message-ID: <20160921074407.4885-24-npiggin@gmail.com> (raw)
In-Reply-To: <20160921074407.4885-1-npiggin@gmail.com>

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

diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 7ff0f11..ec3e6dc 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -942,6 +942,62 @@ COMMON_HANDLER(emulation_assist_common, 0xe40, emulation_assist_interrupt)
 
 
 __VECTOR_HANDLER_REAL_OOL_HV_DIRECT(hmi_exception, 0xe60, 0xe80, hmi_exception_early)
+__TRAMP_HANDLER_REAL_OOL_MASKABLE_HV(hmi_exception, 0xe60)
+VECTOR_HANDLER_VIRT_BEGIN(unused, 0x4e60, 0x4e80)
+	b       .       /* Can't happen, see v2.07 Book III-S section 6.5 */
+VECTOR_HANDLER_VIRT_END(unused, 0x4e60, 0x4e80)
+TRAMP_KVM_HV(PACA_EXGEN, 0xe60)
+COMMON_HANDLER_BEGIN(hmi_exception_early)
+	EXCEPTION_PROLOG_1(PACA_EXGEN, KVMTEST_HV, 0xe60)
+	mr	r10,r1			/* Save r1			*/
+	ld	r1,PACAEMERGSP(r13)	/* Use emergency stack		*/
+	subi	r1,r1,INT_FRAME_SIZE	/* alloc stack frame		*/
+	std	r9,_CCR(r1)		/* save CR in stackframe	*/
+	mfspr	r11,SPRN_HSRR0		/* Save HSRR0 */
+	std	r11,_NIP(r1)		/* save HSRR0 in stackframe	*/
+	mfspr	r12,SPRN_HSRR1		/* Save SRR1 */
+	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	*/
+	EXCEPTION_PROLOG_COMMON_2(PACA_EXGEN)
+	EXCEPTION_PROLOG_COMMON_3(0xe60)
+	addi	r3,r1,STACK_FRAME_OVERHEAD
+	bl	hmi_exception_realmode
+	/* Windup the stack. */
+	/* Move original HSRR0 and HSRR1 into the respective regs */
+	ld	r9,_MSR(r1)
+	mtspr	SPRN_HSRR1,r9
+	ld	r3,_NIP(r1)
+	mtspr	SPRN_HSRR0,r3
+	ld	r9,_CTR(r1)
+	mtctr	r9
+	ld	r9,_XER(r1)
+	mtxer	r9
+	ld	r9,_LINK(r1)
+	mtlr	r9
+	REST_GPR(0, r1)
+	REST_8GPRS(2, r1)
+	REST_GPR(10, r1)
+	ld	r11,_CCR(r1)
+	mtcr	r11
+	REST_GPR(11, r1)
+	REST_2GPRS(12, r1)
+	/* restore original r1. */
+	ld	r1,GPR1(r1)
+
+	/*
+	 * Go to virtual mode and pull the HMI event information from
+	 * firmware.
+	 */
+	.globl hmi_exception_after_realmode
+hmi_exception_after_realmode:
+	SET_SCRATCH0(r13)
+	EXCEPTION_PROLOG_0(PACA_EXGEN)
+	b	tramp_real_hmi_exception
+COMMON_HANDLER_END(hmi_exception_early)
+COMMON_HANDLER_ASYNC(hmi_exception_common, 0xe60, handle_hmi_exception)
+
 
 __VECTOR_HANDLER_REAL_OOL_MASKABLE_HV(h_doorbell, 0xe80, 0xea0)
 
@@ -1087,9 +1143,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_CFAR)
 TRAMP_HANDLER_END(denorm_assist)
 
 	/* moved from 0xe00 */
-__TRAMP_HANDLER_REAL_OOL_MASKABLE_HV(hmi_exception, 0xe60)
-TRAMP_KVM_HV(PACA_EXGEN, 0xe60)
-
 __TRAMP_HANDLER_REAL_OOL_MASKABLE_HV(h_doorbell, 0xe80)
 TRAMP_KVM_HV(PACA_EXGEN, 0xe80)
 
@@ -1234,7 +1287,6 @@ TRAMP_HANDLER_END(kvmppc_skip_Hinterrupt)
 /*** Common interrupt handlers ***/
 
 
-COMMON_HANDLER_ASYNC(hmi_exception_common, 0xe60, handle_hmi_exception)
 #ifdef CONFIG_PPC_DOORBELL
 COMMON_HANDLER_ASYNC(h_doorbell_common, 0xe80, doorbell_exception)
 #else
@@ -1270,10 +1322,6 @@ COMMON_HANDLER(altivec_assist_common, 0x1700, unknown_exception)
 
 
 
-VECTOR_HANDLER_VIRT_BEGIN(unused, 0x4e60, 0x4e80)
-	b       .       /* Can't happen, see v2.07 Book III-S section 6.5 */
-VECTOR_HANDLER_VIRT_END(unused, 0x4e60, 0x4e80)
-
 __VECTOR_HANDLER_VIRT_OOL_MASKABLE_HV(h_doorbell, 0x4e80, 0x4ea0)
 
 __VECTOR_HANDLER_VIRT_OOL_MASKABLE_HV(h_virt_irq, 0x4ea0, 0x4ec0)
@@ -1413,56 +1461,6 @@ COMMON_HANDLER(cbe_thermal_common, 0x1800, cbe_thermal_exception)
 #endif /* CONFIG_CBE_RAS */
 
 
-COMMON_HANDLER_BEGIN(hmi_exception_early)
-	EXCEPTION_PROLOG_1(PACA_EXGEN, KVMTEST_HV, 0xe60)
-	mr	r10,r1			/* Save r1			*/
-	ld	r1,PACAEMERGSP(r13)	/* Use emergency stack		*/
-	subi	r1,r1,INT_FRAME_SIZE	/* alloc stack frame		*/
-	std	r9,_CCR(r1)		/* save CR in stackframe	*/
-	mfspr	r11,SPRN_HSRR0		/* Save HSRR0 */
-	std	r11,_NIP(r1)		/* save HSRR0 in stackframe	*/
-	mfspr	r12,SPRN_HSRR1		/* Save SRR1 */
-	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	*/
-	EXCEPTION_PROLOG_COMMON_2(PACA_EXGEN)
-	EXCEPTION_PROLOG_COMMON_3(0xe60)
-	addi	r3,r1,STACK_FRAME_OVERHEAD
-	bl	hmi_exception_realmode
-	/* Windup the stack. */
-	/* Move original HSRR0 and HSRR1 into the respective regs */
-	ld	r9,_MSR(r1)
-	mtspr	SPRN_HSRR1,r9
-	ld	r3,_NIP(r1)
-	mtspr	SPRN_HSRR0,r3
-	ld	r9,_CTR(r1)
-	mtctr	r9
-	ld	r9,_XER(r1)
-	mtxer	r9
-	ld	r9,_LINK(r1)
-	mtlr	r9
-	REST_GPR(0, r1)
-	REST_8GPRS(2, r1)
-	REST_GPR(10, r1)
-	ld	r11,_CCR(r1)
-	mtcr	r11
-	REST_GPR(11, r1)
-	REST_2GPRS(12, r1)
-	/* restore original r1. */
-	ld	r1,GPR1(r1)
-
-	/*
-	 * Go to virtual mode and pull the HMI event information from
-	 * firmware.
-	 */
-	.globl hmi_exception_after_realmode
-hmi_exception_after_realmode:
-	SET_SCRATCH0(r13)
-	EXCEPTION_PROLOG_0(PACA_EXGEN)
-	b	tramp_real_hmi_exception
-COMMON_HANDLER_END(hmi_exception_early)
-
 #ifdef CONFIG_PPC_970_NAP
 TRAMP_HANDLER_BEGIN(power4_fixup_nap)
 	andc	r9,r9,r10
-- 
2.9.3

  parent reply	other threads:[~2016-09-21  7:45 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21  7:43 [PATCH v2 00/41] powerpc/64: use asm sections for head/exception layout Nicholas Piggin
2016-09-21  7:43 ` [PATCH 01/41] powerpc/64s: exception vector macros Nicholas Piggin
2016-09-21  7:43 ` [PATCH 02/41] powerpc/64s: consolidate exception handler alignment Nicholas Piggin
2016-09-21  7:43 ` [PATCH 03/41] powerpc/64: use gas sections for arranging exception vectors Nicholas Piggin
2016-09-22  4:40   ` Nicholas Piggin
2016-09-21  7:43 ` [PATCH 04/41] powerpc/64s: consolidate System Reset 0x100 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 05/41] powerpc/64s: consolidate Machine Check 0x200 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 06/41] powerpc/64s: consolidate Data Storage 0x300 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 07/41] powerpc/64s: consolidate Data Segment 0x380 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 08/41] powerpc/64s: consolidate Instruction Storage 0x400 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 09/41] powerpc/64s: consolidate Instruction Segment 0x480 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 10/41] powerpc/64s: consolidate External 0x500 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 11/41] powerpc/64s: consolidate Alignment 0x600 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 12/41] powerpc/64s: consolidate Program 0x700 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 13/41] powerpc/64s: consolidate FP Unavailable 0x800 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 14/41] powerpc/64s: consolidate Decrementer 0x900 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 15/41] powerpc/64s: consolidate Hypervisor Decrementer 0x980 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 16/41] powerpc/64s: consolidate Directed Privileged Doorbell 0xa00 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 17/41] powerpc/64s: consolidate Reserved 0xb00 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 18/41] powerpc/64s: consolidate System Call 0xc00 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 19/41] powerpc/64s: consolidate Trace 0xd00 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 20/41] powerpc/64s: consolidate Hypervisor Data Storage 0xe00 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 21/41] powerpc/64s: consolidate Hypervisor Instruction Storage 0xe20 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 22/41] powerpc/64s: consolidate Hypervisor Emulation Assistance 0xe40 interrupt Nicholas Piggin
2016-09-21  7:43 ` Nicholas Piggin [this message]
2016-09-21  7:43 ` [PATCH 24/41] powerpc/64s: consolidate Directed Hypervisor Doorbell 0xe80 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 25/41] powerpc/64s: consolidate Hypervisor Virtualization 0xea0 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 26/41] powerpc/64s: consolidate Reserved 0xec0, 0xee0 interrupts Nicholas Piggin
2016-09-21  7:43 ` [PATCH 27/41] powerpc/64s: consolidate Performance Monitor 0xf00 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 28/41] powerpc/64s: consolidate Vector Unavailable 0xf20 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 29/41] powerpc/64s: consolidate VSX Unavailable 0xf40 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 30/41] powerpc/64s: consolidate Facility Unavailable 0xf60 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 31/41] powerpc/64s: consolidate Hypervisor Facility Unavailable 0xf80 interrupt Nicholas Piggin
2016-09-21  7:43 ` [PATCH 32/41] powerpc/64s: consolidate Reserved 0xfa0-0x1200 interrupts Nicholas Piggin
2016-09-21  7:43 ` [PATCH 33/41] powerpc/64s: consolidate CBE System Error 0x1200 interrupt Nicholas Piggin
2016-09-21  7:44 ` [PATCH 34/41] powerpc/64s: consolidate Instruction Breakpoint 0x1300 interrupt Nicholas Piggin
2016-09-21  7:44 ` [PATCH 35/41] powerpc/64s: consolidate Softpatch 0x1500 interrupt Nicholas Piggin
2016-09-21  7:44 ` [PATCH 36/41] powerpc/64s: consolidate Debug 0x1600 interrupt Nicholas Piggin
2016-09-21  7:44 ` [PATCH 37/41] powerpc/64s: consolidate Altivec 0x1700 interrupt Nicholas Piggin
2016-09-21  7:44 ` [PATCH 38/41] powerpc/64s: consolidate CBE Thermal 0x1800 interrupt Nicholas Piggin
2016-09-21  7:44 ` [PATCH 39/41] powerpc/64s: move __replay_interrupt function below handlers Nicholas Piggin
2016-09-21  7:44 ` [PATCH 40/41] powerpc/64s: use single macro for both parts of OOL exception Nicholas Piggin
2016-09-21  7:44 ` [PATCH 41/41] powerpc/64s: remove unused exception code, small cleanups 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=20160921074407.4885-24-npiggin@gmail.com \
    --to=npiggin@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).