diff options
-rw-r--r-- | arch/powerpc/include/asm/kvm_ppc.h | 8 | ||||
-rw-r--r-- | arch/powerpc/kvm/book3s.c | 17 | ||||
-rw-r--r-- | arch/powerpc/kvm/booke.c | 16 |
3 files changed, 35 insertions, 6 deletions
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h index 2214ee61f668..cbee4538307f 100644 --- a/arch/powerpc/include/asm/kvm_ppc.h +++ b/arch/powerpc/include/asm/kvm_ppc.h | |||
@@ -132,6 +132,14 @@ extern void kvmppc_core_dequeue_dec(struct kvm_vcpu *vcpu); | |||
132 | extern void kvmppc_core_queue_external(struct kvm_vcpu *vcpu, | 132 | extern void kvmppc_core_queue_external(struct kvm_vcpu *vcpu, |
133 | struct kvm_interrupt *irq); | 133 | struct kvm_interrupt *irq); |
134 | extern void kvmppc_core_dequeue_external(struct kvm_vcpu *vcpu); | 134 | extern void kvmppc_core_dequeue_external(struct kvm_vcpu *vcpu); |
135 | extern void kvmppc_core_queue_dtlb_miss(struct kvm_vcpu *vcpu, ulong dear_flags, | ||
136 | ulong esr_flags); | ||
137 | extern void kvmppc_core_queue_data_storage(struct kvm_vcpu *vcpu, | ||
138 | ulong dear_flags, | ||
139 | ulong esr_flags); | ||
140 | extern void kvmppc_core_queue_itlb_miss(struct kvm_vcpu *vcpu); | ||
141 | extern void kvmppc_core_queue_inst_storage(struct kvm_vcpu *vcpu, | ||
142 | ulong esr_flags); | ||
135 | extern void kvmppc_core_flush_tlb(struct kvm_vcpu *vcpu); | 143 | extern void kvmppc_core_flush_tlb(struct kvm_vcpu *vcpu); |
136 | extern int kvmppc_core_check_requests(struct kvm_vcpu *vcpu); | 144 | extern int kvmppc_core_check_requests(struct kvm_vcpu *vcpu); |
137 | 145 | ||
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index de8da3387e90..dd03f6b299ba 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c | |||
@@ -230,6 +230,23 @@ void kvmppc_core_dequeue_external(struct kvm_vcpu *vcpu) | |||
230 | kvmppc_book3s_dequeue_irqprio(vcpu, BOOK3S_INTERRUPT_EXTERNAL_LEVEL); | 230 | kvmppc_book3s_dequeue_irqprio(vcpu, BOOK3S_INTERRUPT_EXTERNAL_LEVEL); |
231 | } | 231 | } |
232 | 232 | ||
233 | void kvmppc_core_queue_data_storage(struct kvm_vcpu *vcpu, ulong dar, | ||
234 | ulong flags) | ||
235 | { | ||
236 | kvmppc_set_dar(vcpu, dar); | ||
237 | kvmppc_set_dsisr(vcpu, flags); | ||
238 | kvmppc_book3s_queue_irqprio(vcpu, BOOK3S_INTERRUPT_DATA_STORAGE); | ||
239 | } | ||
240 | |||
241 | void kvmppc_core_queue_inst_storage(struct kvm_vcpu *vcpu, ulong flags) | ||
242 | { | ||
243 | u64 msr = kvmppc_get_msr(vcpu); | ||
244 | msr &= ~(SRR1_ISI_NOPT | SRR1_ISI_N_OR_G | SRR1_ISI_PROT); | ||
245 | msr |= flags & (SRR1_ISI_NOPT | SRR1_ISI_N_OR_G | SRR1_ISI_PROT); | ||
246 | kvmppc_set_msr_fast(vcpu, msr); | ||
247 | kvmppc_book3s_queue_irqprio(vcpu, BOOK3S_INTERRUPT_INST_STORAGE); | ||
248 | } | ||
249 | |||
233 | int kvmppc_book3s_irqprio_deliver(struct kvm_vcpu *vcpu, unsigned int priority) | 250 | int kvmppc_book3s_irqprio_deliver(struct kvm_vcpu *vcpu, unsigned int priority) |
234 | { | 251 | { |
235 | int deliver = 1; | 252 | int deliver = 1; |
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 2f697b49073b..f30948a17c03 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c | |||
@@ -185,24 +185,28 @@ static void kvmppc_booke_queue_irqprio(struct kvm_vcpu *vcpu, | |||
185 | set_bit(priority, &vcpu->arch.pending_exceptions); | 185 | set_bit(priority, &vcpu->arch.pending_exceptions); |
186 | } | 186 | } |
187 | 187 | ||
188 | static void kvmppc_core_queue_dtlb_miss(struct kvm_vcpu *vcpu, | 188 | void kvmppc_core_queue_dtlb_miss(struct kvm_vcpu *vcpu, |
189 | ulong dear_flags, ulong esr_flags) | 189 | ulong dear_flags, ulong esr_flags) |
190 | { | 190 | { |
191 | vcpu->arch.queued_dear = dear_flags; | 191 | vcpu->arch.queued_dear = dear_flags; |
192 | vcpu->arch.queued_esr = esr_flags; | 192 | vcpu->arch.queued_esr = esr_flags; |
193 | kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DTLB_MISS); | 193 | kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DTLB_MISS); |
194 | } | 194 | } |
195 | 195 | ||
196 | static void kvmppc_core_queue_data_storage(struct kvm_vcpu *vcpu, | 196 | void kvmppc_core_queue_data_storage(struct kvm_vcpu *vcpu, |
197 | ulong dear_flags, ulong esr_flags) | 197 | ulong dear_flags, ulong esr_flags) |
198 | { | 198 | { |
199 | vcpu->arch.queued_dear = dear_flags; | 199 | vcpu->arch.queued_dear = dear_flags; |
200 | vcpu->arch.queued_esr = esr_flags; | 200 | vcpu->arch.queued_esr = esr_flags; |
201 | kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DATA_STORAGE); | 201 | kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DATA_STORAGE); |
202 | } | 202 | } |
203 | 203 | ||
204 | static void kvmppc_core_queue_inst_storage(struct kvm_vcpu *vcpu, | 204 | void kvmppc_core_queue_itlb_miss(struct kvm_vcpu *vcpu) |
205 | ulong esr_flags) | 205 | { |
206 | kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_ITLB_MISS); | ||
207 | } | ||
208 | |||
209 | void kvmppc_core_queue_inst_storage(struct kvm_vcpu *vcpu, ulong esr_flags) | ||
206 | { | 210 | { |
207 | vcpu->arch.queued_esr = esr_flags; | 211 | vcpu->arch.queued_esr = esr_flags; |
208 | kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_INST_STORAGE); | 212 | kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_INST_STORAGE); |