aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/include/asm/kvm_ppc.h1
-rw-r--r--arch/powerpc/kvm/book3s.c3
-rw-r--r--arch/powerpc/kvm/emulate.c4
3 files changed, 7 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
index a288dd2fbb2c..07612189eb8b 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -37,6 +37,7 @@ enum emulation_result {
37 EMULATE_DO_MMIO, /* kvm_run filled with MMIO request */ 37 EMULATE_DO_MMIO, /* kvm_run filled with MMIO request */
38 EMULATE_DO_DCR, /* kvm_run filled with DCR request */ 38 EMULATE_DO_DCR, /* kvm_run filled with DCR request */
39 EMULATE_FAIL, /* can't emulate this instruction */ 39 EMULATE_FAIL, /* can't emulate this instruction */
40 EMULATE_AGAIN, /* something went wrong. go again */
40}; 41};
41 42
42extern int __kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu); 43extern int __kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu);
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 604af29b71ed..6416f227d345 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -789,6 +789,9 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
789 case EMULATE_DONE: 789 case EMULATE_DONE:
790 r = RESUME_GUEST_NV; 790 r = RESUME_GUEST_NV;
791 break; 791 break;
792 case EMULATE_AGAIN:
793 r = RESUME_GUEST;
794 break;
792 case EMULATE_FAIL: 795 case EMULATE_FAIL:
793 printk(KERN_CRIT "%s: emulation at %lx failed (%08x)\n", 796 printk(KERN_CRIT "%s: emulation at %lx failed (%08x)\n",
794 __func__, vcpu->arch.pc, vcpu->arch.last_inst); 797 __func__, vcpu->arch.pc, vcpu->arch.last_inst);
diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
index 11789dd33a13..2410ec2a756a 100644
--- a/arch/powerpc/kvm/emulate.c
+++ b/arch/powerpc/kvm/emulate.c
@@ -486,7 +486,9 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
486 486
487 if (emulated == EMULATE_FAIL) { 487 if (emulated == EMULATE_FAIL) {
488 emulated = kvmppc_core_emulate_op(run, vcpu, inst, &advance); 488 emulated = kvmppc_core_emulate_op(run, vcpu, inst, &advance);
489 if (emulated == EMULATE_FAIL) { 489 if (emulated == EMULATE_AGAIN) {
490 advance = 0;
491 } else if (emulated == EMULATE_FAIL) {
490 advance = 0; 492 advance = 0;
491 printk(KERN_ERR "Couldn't emulate instruction 0x%08x " 493 printk(KERN_ERR "Couldn't emulate instruction 0x%08x "
492 "(op %d xop %d)\n", inst, get_op(inst), get_xop(inst)); 494 "(op %d xop %d)\n", inst, get_op(inst), get_xop(inst));