diff options
Diffstat (limited to 'arch/powerpc/kvm/booke_guest.c')
-rw-r--r-- | arch/powerpc/kvm/booke_guest.c | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/arch/powerpc/kvm/booke_guest.c b/arch/powerpc/kvm/booke_guest.c index 6d9884a6884a..9c8ad850c6e3 100644 --- a/arch/powerpc/kvm/booke_guest.c +++ b/arch/powerpc/kvm/booke_guest.c | |||
@@ -49,6 +49,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { | |||
49 | { "inst_emu", VCPU_STAT(emulated_inst_exits) }, | 49 | { "inst_emu", VCPU_STAT(emulated_inst_exits) }, |
50 | { "dec", VCPU_STAT(dec_exits) }, | 50 | { "dec", VCPU_STAT(dec_exits) }, |
51 | { "ext_intr", VCPU_STAT(ext_intr_exits) }, | 51 | { "ext_intr", VCPU_STAT(ext_intr_exits) }, |
52 | { "halt_wakeup", VCPU_STAT(halt_wakeup) }, | ||
52 | { NULL } | 53 | { NULL } |
53 | }; | 54 | }; |
54 | 55 | ||
@@ -226,39 +227,6 @@ void kvmppc_check_and_deliver_interrupts(struct kvm_vcpu *vcpu) | |||
226 | } | 227 | } |
227 | } | 228 | } |
228 | 229 | ||
229 | static int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu) | ||
230 | { | ||
231 | enum emulation_result er; | ||
232 | int r; | ||
233 | |||
234 | er = kvmppc_emulate_instruction(run, vcpu); | ||
235 | switch (er) { | ||
236 | case EMULATE_DONE: | ||
237 | /* Future optimization: only reload non-volatiles if they were | ||
238 | * actually modified. */ | ||
239 | r = RESUME_GUEST_NV; | ||
240 | break; | ||
241 | case EMULATE_DO_MMIO: | ||
242 | run->exit_reason = KVM_EXIT_MMIO; | ||
243 | /* We must reload nonvolatiles because "update" load/store | ||
244 | * instructions modify register state. */ | ||
245 | /* Future optimization: only reload non-volatiles if they were | ||
246 | * actually modified. */ | ||
247 | r = RESUME_HOST_NV; | ||
248 | break; | ||
249 | case EMULATE_FAIL: | ||
250 | /* XXX Deliver Program interrupt to guest. */ | ||
251 | printk(KERN_EMERG "%s: emulation failed (%08x)\n", __func__, | ||
252 | vcpu->arch.last_inst); | ||
253 | r = RESUME_HOST; | ||
254 | break; | ||
255 | default: | ||
256 | BUG(); | ||
257 | } | ||
258 | |||
259 | return r; | ||
260 | } | ||
261 | |||
262 | /** | 230 | /** |
263 | * kvmppc_handle_exit | 231 | * kvmppc_handle_exit |
264 | * | 232 | * |
@@ -338,6 +306,11 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
338 | } | 306 | } |
339 | break; | 307 | break; |
340 | 308 | ||
309 | case BOOKE_INTERRUPT_FP_UNAVAIL: | ||
310 | kvmppc_queue_exception(vcpu, exit_nr); | ||
311 | r = RESUME_GUEST; | ||
312 | break; | ||
313 | |||
341 | case BOOKE_INTERRUPT_DATA_STORAGE: | 314 | case BOOKE_INTERRUPT_DATA_STORAGE: |
342 | vcpu->arch.dear = vcpu->arch.fault_dear; | 315 | vcpu->arch.dear = vcpu->arch.fault_dear; |
343 | vcpu->arch.esr = vcpu->arch.fault_esr; | 316 | vcpu->arch.esr = vcpu->arch.fault_esr; |