aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/exceptions-64e.S
diff options
context:
space:
mode:
authorMihai Caraman <mihai.caraman@freescale.com>2012-08-05 23:27:04 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-09-05 01:35:43 -0400
commit5473eb1c07009956be5f4df65d51f8e24d8eb1de (patch)
tree69ca3a9ea3aee261bc1db482d63ed82b34df5bdd /arch/powerpc/kernel/exceptions-64e.S
parenta1310757218e0757ee77d2ce05c43028430ed9dd (diff)
powerpc/booke64: Use GSRR registers in Guest Doorbell interrupts
Guest Doorbell interrupts use guest save and restore registers. Add a new Guest Doorbell exception type to accommodate GSRR0/1 SPRs usage in exception prolog and fix the exception handler. Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/exceptions-64e.S')
-rw-r--r--arch/powerpc/kernel/exceptions-64e.S21
1 files changed, 19 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
index 0243b1b29031..0f58a95fd216 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -59,6 +59,10 @@
59#define SPRN_GEN_SRR0 SPRN_SRR0 59#define SPRN_GEN_SRR0 SPRN_SRR0
60#define SPRN_GEN_SRR1 SPRN_SRR1 60#define SPRN_GEN_SRR1 SPRN_SRR1
61 61
62#define GDBELL_SET_KSTACK GEN_SET_KSTACK
63#define SPRN_GDBELL_SRR0 SPRN_GSRR0
64#define SPRN_GDBELL_SRR1 SPRN_GSRR1
65
62#define CRIT_SET_KSTACK \ 66#define CRIT_SET_KSTACK \
63 ld r1,PACA_CRIT_STACK(r13); \ 67 ld r1,PACA_CRIT_STACK(r13); \
64 subi r1,r1,SPECIAL_EXC_FRAME_SIZE; 68 subi r1,r1,SPECIAL_EXC_FRAME_SIZE;
@@ -89,10 +93,13 @@
89#define MC_EXCEPTION_PROLOG(n, addition) \ 93#define MC_EXCEPTION_PROLOG(n, addition) \
90 EXCEPTION_PROLOG(n, MC, addition##_MC(n)) 94 EXCEPTION_PROLOG(n, MC, addition##_MC(n))
91 95
96#define GDBELL_EXCEPTION_PROLOG(n, addition) \
97 EXCEPTION_PROLOG(n, GDBELL, addition##_GDBELL(n))
92 98
93/* Variants of the "addition" argument for the prolog 99/* Variants of the "addition" argument for the prolog
94 */ 100 */
95#define PROLOG_ADDITION_NONE_GEN(n) 101#define PROLOG_ADDITION_NONE_GEN(n)
102#define PROLOG_ADDITION_NONE_GDBELL(n)
96#define PROLOG_ADDITION_NONE_CRIT(n) 103#define PROLOG_ADDITION_NONE_CRIT(n)
97#define PROLOG_ADDITION_NONE_DBG(n) 104#define PROLOG_ADDITION_NONE_DBG(n)
98#define PROLOG_ADDITION_NONE_MC(n) 105#define PROLOG_ADDITION_NONE_MC(n)
@@ -543,8 +550,18 @@ kernel_dbg_exc:
543// b ret_from_crit_except 550// b ret_from_crit_except
544 b . 551 b .
545 552
546/* Guest Doorbell */ 553/*
547 MASKABLE_EXCEPTION(0x2c0, guest_doorbell, .unknown_exception, ACK_NONE) 554 * Guest doorbell interrupt
555 * This general exception use GSRRx save/restore registers
556 */
557 START_EXCEPTION(guest_doorbell);
558 GDBELL_EXCEPTION_PROLOG(0x2c0, PROLOG_ADDITION_NONE)
559 EXCEPTION_COMMON(0x2c0, PACA_EXGEN, INTS_KEEP)
560 addi r3,r1,STACK_FRAME_OVERHEAD
561 bl .save_nvgprs
562 INTS_RESTORE_HARD
563 bl .unknown_exception
564 b .ret_from_except
548 565
549/* Guest Doorbell critical Interrupt */ 566/* Guest Doorbell critical Interrupt */
550 START_EXCEPTION(guest_doorbell_crit); 567 START_EXCEPTION(guest_doorbell_crit);