aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm
diff options
context:
space:
mode:
authorBharat Bhushan <r65777@freescale.com>2012-06-20 01:56:54 -0400
committerAlexander Graf <agraf@suse.de>2012-07-11 11:39:36 -0400
commit75c44bbb20807b5148eae19642a0fdb8db20c344 (patch)
tree074de8da38e837aaa08ba045bf05a8a08a55b01a /arch/powerpc/kvm
parent6328e593c3df5e81ad7d18a2752ef2235391e9cc (diff)
booke: Added crit/mc exception handler for e500v2
Watchdog is taken at critical exception level. So this patch is tested with host watchdog exception happening when guest is running. Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r--arch/powerpc/kvm/booke_interrupts.S55
1 files changed, 27 insertions, 28 deletions
diff --git a/arch/powerpc/kvm/booke_interrupts.S b/arch/powerpc/kvm/booke_interrupts.S
index 8feec2ff3928..09456c4719f3 100644
--- a/arch/powerpc/kvm/booke_interrupts.S
+++ b/arch/powerpc/kvm/booke_interrupts.S
@@ -53,16 +53,21 @@
53 (1<<BOOKE_INTERRUPT_PROGRAM) | \ 53 (1<<BOOKE_INTERRUPT_PROGRAM) | \
54 (1<<BOOKE_INTERRUPT_DTLB_MISS)) 54 (1<<BOOKE_INTERRUPT_DTLB_MISS))
55 55
56.macro KVM_HANDLER ivor_nr 56.macro KVM_HANDLER ivor_nr scratch srr0
57_GLOBAL(kvmppc_handler_\ivor_nr) 57_GLOBAL(kvmppc_handler_\ivor_nr)
58 /* Get pointer to vcpu and record exit number. */ 58 /* Get pointer to vcpu and record exit number. */
59 mtspr SPRN_SPRG_WSCRATCH0, r4 59 mtspr \scratch , r4
60 mfspr r4, SPRN_SPRG_RVCPU 60 mfspr r4, SPRN_SPRG_RVCPU
61 stw r3, VCPU_GPR(r3)(r4)
61 stw r5, VCPU_GPR(r5)(r4) 62 stw r5, VCPU_GPR(r5)(r4)
62 stw r6, VCPU_GPR(r6)(r4) 63 stw r6, VCPU_GPR(r6)(r4)
64 mfspr r3, \scratch
63 mfctr r5 65 mfctr r5
64 lis r6, kvmppc_resume_host@h 66 stw r3, VCPU_GPR(r4)(r4)
65 stw r5, VCPU_CTR(r4) 67 stw r5, VCPU_CTR(r4)
68 mfspr r3, \srr0
69 lis r6, kvmppc_resume_host@h
70 stw r3, VCPU_PC(r4)
66 li r5, \ivor_nr 71 li r5, \ivor_nr
67 ori r6, r6, kvmppc_resume_host@l 72 ori r6, r6, kvmppc_resume_host@l
68 mtctr r6 73 mtctr r6
@@ -70,37 +75,35 @@ _GLOBAL(kvmppc_handler_\ivor_nr)
70.endm 75.endm
71 76
72_GLOBAL(kvmppc_handlers_start) 77_GLOBAL(kvmppc_handlers_start)
73KVM_HANDLER BOOKE_INTERRUPT_CRITICAL 78KVM_HANDLER BOOKE_INTERRUPT_CRITICAL SPRN_SPRG_RSCRATCH_CRIT SPRN_CSRR0
74KVM_HANDLER BOOKE_INTERRUPT_MACHINE_CHECK 79KVM_HANDLER BOOKE_INTERRUPT_MACHINE_CHECK SPRN_SPRG_RSCRATCH_MC SPRN_MCSRR0
75KVM_HANDLER BOOKE_INTERRUPT_DATA_STORAGE 80KVM_HANDLER BOOKE_INTERRUPT_DATA_STORAGE SPRN_SPRG_RSCRATCH0 SPRN_SRR0
76KVM_HANDLER BOOKE_INTERRUPT_INST_STORAGE 81KVM_HANDLER BOOKE_INTERRUPT_INST_STORAGE SPRN_SPRG_RSCRATCH0 SPRN_SRR0
77KVM_HANDLER BOOKE_INTERRUPT_EXTERNAL 82KVM_HANDLER BOOKE_INTERRUPT_EXTERNAL SPRN_SPRG_RSCRATCH0 SPRN_SRR0
78KVM_HANDLER BOOKE_INTERRUPT_ALIGNMENT 83KVM_HANDLER BOOKE_INTERRUPT_ALIGNMENT SPRN_SPRG_RSCRATCH0 SPRN_SRR0
79KVM_HANDLER BOOKE_INTERRUPT_PROGRAM 84KVM_HANDLER BOOKE_INTERRUPT_PROGRAM SPRN_SPRG_RSCRATCH0 SPRN_SRR0
80KVM_HANDLER BOOKE_INTERRUPT_FP_UNAVAIL 85KVM_HANDLER BOOKE_INTERRUPT_FP_UNAVAIL SPRN_SPRG_RSCRATCH0 SPRN_SRR0
81KVM_HANDLER BOOKE_INTERRUPT_SYSCALL 86KVM_HANDLER BOOKE_INTERRUPT_SYSCALL SPRN_SPRG_RSCRATCH0 SPRN_SRR0
82KVM_HANDLER BOOKE_INTERRUPT_AP_UNAVAIL 87KVM_HANDLER BOOKE_INTERRUPT_AP_UNAVAIL SPRN_SPRG_RSCRATCH0 SPRN_SRR0
83KVM_HANDLER BOOKE_INTERRUPT_DECREMENTER 88KVM_HANDLER BOOKE_INTERRUPT_DECREMENTER SPRN_SPRG_RSCRATCH0 SPRN_SRR0
84KVM_HANDLER BOOKE_INTERRUPT_FIT 89KVM_HANDLER BOOKE_INTERRUPT_FIT SPRN_SPRG_RSCRATCH0 SPRN_SRR0
85KVM_HANDLER BOOKE_INTERRUPT_WATCHDOG 90KVM_HANDLER BOOKE_INTERRUPT_WATCHDOG SPRN_SPRG_RSCRATCH_CRIT SPRN_CSRR0
86KVM_HANDLER BOOKE_INTERRUPT_DTLB_MISS 91KVM_HANDLER BOOKE_INTERRUPT_DTLB_MISS SPRN_SPRG_RSCRATCH0 SPRN_SRR0
87KVM_HANDLER BOOKE_INTERRUPT_ITLB_MISS 92KVM_HANDLER BOOKE_INTERRUPT_ITLB_MISS SPRN_SPRG_RSCRATCH0 SPRN_SRR0
88KVM_HANDLER BOOKE_INTERRUPT_DEBUG 93KVM_HANDLER BOOKE_INTERRUPT_DEBUG SPRN_SPRG_RSCRATCH_CRIT SPRN_CSRR0
89KVM_HANDLER BOOKE_INTERRUPT_SPE_UNAVAIL 94KVM_HANDLER BOOKE_INTERRUPT_SPE_UNAVAIL SPRN_SPRG_RSCRATCH0 SPRN_SRR0
90KVM_HANDLER BOOKE_INTERRUPT_SPE_FP_DATA 95KVM_HANDLER BOOKE_INTERRUPT_SPE_FP_DATA SPRN_SPRG_RSCRATCH0 SPRN_SRR0
91KVM_HANDLER BOOKE_INTERRUPT_SPE_FP_ROUND 96KVM_HANDLER BOOKE_INTERRUPT_SPE_FP_ROUND SPRN_SPRG_RSCRATCH0 SPRN_SRR0
92 97
93_GLOBAL(kvmppc_handler_len) 98_GLOBAL(kvmppc_handler_len)
94 .long kvmppc_handler_1 - kvmppc_handler_0 99 .long kvmppc_handler_1 - kvmppc_handler_0
95 100
96
97/* Registers: 101/* Registers:
98 * SPRG_SCRATCH0: guest r4 102 * SPRG_SCRATCH0: guest r4
99 * r4: vcpu pointer 103 * r4: vcpu pointer
100 * r5: KVM exit number 104 * r5: KVM exit number
101 */ 105 */
102_GLOBAL(kvmppc_resume_host) 106_GLOBAL(kvmppc_resume_host)
103 stw r3, VCPU_GPR(r3)(r4)
104 mfcr r3 107 mfcr r3
105 stw r3, VCPU_CR(r4) 108 stw r3, VCPU_CR(r4)
106 stw r7, VCPU_GPR(r7)(r4) 109 stw r7, VCPU_GPR(r7)(r4)
@@ -181,10 +184,6 @@ _GLOBAL(kvmppc_resume_host)
181 stw r3, VCPU_LR(r4) 184 stw r3, VCPU_LR(r4)
182 mfxer r3 185 mfxer r3
183 stw r3, VCPU_XER(r4) 186 stw r3, VCPU_XER(r4)
184 mfspr r3, SPRN_SPRG_RSCRATCH0
185 stw r3, VCPU_GPR(r4)(r4)
186 mfspr r3, SPRN_SRR0
187 stw r3, VCPU_PC(r4)
188 187
189 /* Restore host stack pointer and PID before IVPR, since the host 188 /* Restore host stack pointer and PID before IVPR, since the host
190 * exception handlers use them. */ 189 * exception handlers use them. */