diff options
Diffstat (limited to 'arch/powerpc/kvm/booke_interrupts.S')
-rw-r--r-- | arch/powerpc/kvm/booke_interrupts.S | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/arch/powerpc/kvm/booke_interrupts.S b/arch/powerpc/kvm/booke_interrupts.S index f4bb55c96517..2c6deb5ef2fe 100644 --- a/arch/powerpc/kvm/booke_interrupts.S +++ b/arch/powerpc/kvm/booke_interrupts.S | |||
@@ -54,8 +54,7 @@ | |||
54 | (1<<BOOKE_INTERRUPT_DTLB_MISS) | \ | 54 | (1<<BOOKE_INTERRUPT_DTLB_MISS) | \ |
55 | (1<<BOOKE_INTERRUPT_ALIGNMENT)) | 55 | (1<<BOOKE_INTERRUPT_ALIGNMENT)) |
56 | 56 | ||
57 | .macro KVM_HANDLER ivor_nr scratch srr0 | 57 | .macro __KVM_HANDLER ivor_nr scratch srr0 |
58 | _GLOBAL(kvmppc_handler_\ivor_nr) | ||
59 | /* Get pointer to vcpu and record exit number. */ | 58 | /* Get pointer to vcpu and record exit number. */ |
60 | mtspr \scratch , r4 | 59 | mtspr \scratch , r4 |
61 | mfspr r4, SPRN_SPRG_THREAD | 60 | mfspr r4, SPRN_SPRG_THREAD |
@@ -76,6 +75,43 @@ _GLOBAL(kvmppc_handler_\ivor_nr) | |||
76 | bctr | 75 | bctr |
77 | .endm | 76 | .endm |
78 | 77 | ||
78 | .macro KVM_HANDLER ivor_nr scratch srr0 | ||
79 | _GLOBAL(kvmppc_handler_\ivor_nr) | ||
80 | __KVM_HANDLER \ivor_nr \scratch \srr0 | ||
81 | .endm | ||
82 | |||
83 | .macro KVM_DBG_HANDLER ivor_nr scratch srr0 | ||
84 | _GLOBAL(kvmppc_handler_\ivor_nr) | ||
85 | mtspr \scratch, r4 | ||
86 | mfspr r4, SPRN_SPRG_THREAD | ||
87 | lwz r4, THREAD_KVM_VCPU(r4) | ||
88 | stw r3, VCPU_CRIT_SAVE(r4) | ||
89 | mfcr r3 | ||
90 | mfspr r4, SPRN_CSRR1 | ||
91 | andi. r4, r4, MSR_PR | ||
92 | bne 1f | ||
93 | /* debug interrupt happened in enter/exit path */ | ||
94 | mfspr r4, SPRN_CSRR1 | ||
95 | rlwinm r4, r4, 0, ~MSR_DE | ||
96 | mtspr SPRN_CSRR1, r4 | ||
97 | lis r4, 0xffff | ||
98 | ori r4, r4, 0xffff | ||
99 | mtspr SPRN_DBSR, r4 | ||
100 | mfspr r4, SPRN_SPRG_THREAD | ||
101 | lwz r4, THREAD_KVM_VCPU(r4) | ||
102 | mtcr r3 | ||
103 | lwz r3, VCPU_CRIT_SAVE(r4) | ||
104 | mfspr r4, \scratch | ||
105 | rfci | ||
106 | 1: /* debug interrupt happened in guest */ | ||
107 | mtcr r3 | ||
108 | mfspr r4, SPRN_SPRG_THREAD | ||
109 | lwz r4, THREAD_KVM_VCPU(r4) | ||
110 | lwz r3, VCPU_CRIT_SAVE(r4) | ||
111 | mfspr r4, \scratch | ||
112 | __KVM_HANDLER \ivor_nr \scratch \srr0 | ||
113 | .endm | ||
114 | |||
79 | .macro KVM_HANDLER_ADDR ivor_nr | 115 | .macro KVM_HANDLER_ADDR ivor_nr |
80 | .long kvmppc_handler_\ivor_nr | 116 | .long kvmppc_handler_\ivor_nr |
81 | .endm | 117 | .endm |
@@ -100,7 +136,7 @@ KVM_HANDLER BOOKE_INTERRUPT_FIT SPRN_SPRG_RSCRATCH0 SPRN_SRR0 | |||
100 | KVM_HANDLER BOOKE_INTERRUPT_WATCHDOG SPRN_SPRG_RSCRATCH_CRIT SPRN_CSRR0 | 136 | KVM_HANDLER BOOKE_INTERRUPT_WATCHDOG SPRN_SPRG_RSCRATCH_CRIT SPRN_CSRR0 |
101 | KVM_HANDLER BOOKE_INTERRUPT_DTLB_MISS SPRN_SPRG_RSCRATCH0 SPRN_SRR0 | 137 | KVM_HANDLER BOOKE_INTERRUPT_DTLB_MISS SPRN_SPRG_RSCRATCH0 SPRN_SRR0 |
102 | KVM_HANDLER BOOKE_INTERRUPT_ITLB_MISS SPRN_SPRG_RSCRATCH0 SPRN_SRR0 | 138 | KVM_HANDLER BOOKE_INTERRUPT_ITLB_MISS SPRN_SPRG_RSCRATCH0 SPRN_SRR0 |
103 | KVM_HANDLER BOOKE_INTERRUPT_DEBUG SPRN_SPRG_RSCRATCH_CRIT SPRN_CSRR0 | 139 | KVM_DBG_HANDLER BOOKE_INTERRUPT_DEBUG SPRN_SPRG_RSCRATCH_CRIT SPRN_CSRR0 |
104 | KVM_HANDLER BOOKE_INTERRUPT_SPE_UNAVAIL SPRN_SPRG_RSCRATCH0 SPRN_SRR0 | 140 | KVM_HANDLER BOOKE_INTERRUPT_SPE_UNAVAIL SPRN_SPRG_RSCRATCH0 SPRN_SRR0 |
105 | KVM_HANDLER BOOKE_INTERRUPT_SPE_FP_DATA SPRN_SPRG_RSCRATCH0 SPRN_SRR0 | 141 | KVM_HANDLER BOOKE_INTERRUPT_SPE_FP_DATA SPRN_SPRG_RSCRATCH0 SPRN_SRR0 |
106 | KVM_HANDLER BOOKE_INTERRUPT_SPE_FP_ROUND SPRN_SPRG_RSCRATCH0 SPRN_SRR0 | 142 | KVM_HANDLER BOOKE_INTERRUPT_SPE_FP_ROUND SPRN_SPRG_RSCRATCH0 SPRN_SRR0 |