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 39/41] powerpc/64s: move __replay_interrupt function below handlers
Date: Wed, 21 Sep 2016 17:44:05 +1000 [thread overview]
Message-ID: <20160921074407.4885-40-npiggin@gmail.com> (raw)
In-Reply-To: <20160921074407.4885-1-npiggin@gmail.com>
This is not an exception handler as such: it's called from
local_irq_enable(), not exception entry.
Also clean up some now redundant comments at the end of the
consolidation series.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/exceptions-64s.S | 99 +++++++++++++-----------------------
1 file changed, 36 insertions(+), 63 deletions(-)
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 9f96ec2..69a2379 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1319,42 +1319,6 @@ USE_FIXED_SECTION(virt_trampolines)
MASKED_INTERRUPT(H)
UNUSE_FIXED_SECTION(virt_trampolines)
-/*
- * Called from arch_local_irq_enable when an interrupt needs
- * to be resent. r3 contains 0x500, 0x900, 0xa00 or 0xe80 to indicate
- * which kind of interrupt. MSR:EE is already off. We generate a
- * stackframe like if a real interrupt had happened.
- *
- * Note: While MSR:EE is off, we need to make sure that _MSR
- * in the generated frame has EE set to 1 or the exception
- * handler will not properly re-enable them.
- */
-_GLOBAL(__replay_interrupt)
- /* We are going to jump to the exception common code which
- * will retrieve various register values from the PACA which
- * we don't give a damn about, so we don't bother storing them.
- */
- mfmsr r12
- mflr r11
- mfcr r9
- ori r12,r12,MSR_EE
- cmpwi r3,0x900
- beq decrementer_common
- cmpwi r3,0x500
- beq hardware_interrupt_common
-BEGIN_FTR_SECTION
- cmpwi r3,0xe80
- beq h_doorbell_common
- cmpwi r3,0xea0
- beq h_virt_irq_common
- cmpwi r3,0xe60
- beq hmi_exception_common
-FTR_SECTION_ELSE
- cmpwi r3,0xa00
- beq doorbell_super_common
-ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE)
- blr
-
#ifdef CONFIG_KVM_BOOK3S_64_HANDLER
TRAMP_HANDLER_BEGIN(kvmppc_skip_interrupt)
/*
@@ -1383,37 +1347,10 @@ TRAMP_HANDLER_BEGIN(kvmppc_skip_Hinterrupt)
TRAMP_HANDLER_END(kvmppc_skip_Hinterrupt)
#endif
-/*
- * Ensure that any handlers that get invoked from the exception prologs
- * above are below the first 64KB (0x10000) of the kernel image because
- * the prologs assemble the addresses of these handlers using the
- * LOAD_HANDLER macro, which uses an ori instruction.
- */
-
-/*** Common interrupt handlers ***/
-
-
- /*
- * Relocation-on interrupts: A subset of the interrupts can be delivered
- * with IR=1/DR=1, if AIL==2 and MSR.HV won't be changed by delivering
- * it. Addresses are the same as the original interrupt addresses, but
- * offset by 0xc000000000004000.
- * It's impossible to receive interrupts below 0x300 via this mechanism.
- * KVM: None of these traps are from the guest ; anything that escalated
- * to HV=1 from HV=0 is delivered via real mode handlers.
- */
-
- /*
- * This uses the standard macro, since the original 0x300 vector
- * only has extra guff for STAB-based processors -- which never
- * come here.
- */
-
TRAMP_HANDLER_BEGIN(ppc64_runlatch_on_trampoline)
b __ppc64_runlatch_on
TRAMP_HANDLER_END(ppc64_runlatch_on_trampoline)
- /* Equivalents to the above handlers for relocation-on interrupt vectors */
USE_FIXED_SECTION(virt_trampolines)
/*
* The __end_interrupts marker must be past the out-of-line (OOL)
@@ -1589,3 +1526,39 @@ END_FTR_SECTION_IFSET(CPU_FTR_CFAR)
1: addi r3,r1,STACK_FRAME_OVERHEAD
bl kernel_bad_stack
b 1b
+
+/*
+ * Called from arch_local_irq_enable when an interrupt needs
+ * to be resent. r3 contains 0x500, 0x900, 0xa00 or 0xe80 to indicate
+ * which kind of interrupt. MSR:EE is already off. We generate a
+ * stackframe like if a real interrupt had happened.
+ *
+ * Note: While MSR:EE is off, we need to make sure that _MSR
+ * in the generated frame has EE set to 1 or the exception
+ * handler will not properly re-enable them.
+ */
+_GLOBAL(__replay_interrupt)
+ /* We are going to jump to the exception common code which
+ * will retrieve various register values from the PACA which
+ * we don't give a damn about, so we don't bother storing them.
+ */
+ mfmsr r12
+ mflr r11
+ mfcr r9
+ ori r12,r12,MSR_EE
+ cmpwi r3,0x900
+ beq decrementer_common
+ cmpwi r3,0x500
+ beq hardware_interrupt_common
+BEGIN_FTR_SECTION
+ cmpwi r3,0xe80
+ beq h_doorbell_common
+ cmpwi r3,0xea0
+ beq h_virt_irq_common
+ cmpwi r3,0xe60
+ beq hmi_exception_common
+FTR_SECTION_ELSE
+ cmpwi r3,0xa00
+ beq doorbell_super_common
+ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE)
+ blr
--
2.9.3
next prev parent reply other threads:[~2016-09-21 7:46 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 ` [PATCH 23/41] powerpc/64s: consolidate Hypervisor Maintenance 0xe60 interrupt Nicholas Piggin
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 ` Nicholas Piggin [this message]
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-40-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).