]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kvm/emulate.c
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[karo-tx-linux.git] / arch / powerpc / kvm / emulate.c
index e96b50d0bdab1f80f3374b35a7c9462a9fcc8a51..5cc2e7af3a7b96322b9f768a7aadb867ea6b7560 100644 (file)
@@ -219,7 +219,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
        /* this default type might be overwritten by subcategories */
        kvmppc_set_exit_type(vcpu, EMULATED_INST_EXITS);
 
-       emulated = kvmppc_get_last_inst(vcpu, false, &inst);
+       emulated = kvmppc_get_last_inst(vcpu, INST_GENERIC, &inst);
        if (emulated != EMULATE_DONE)
                return emulated;
 
@@ -274,6 +274,21 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
                }
                break;
 
+       case 0:
+               /*
+                * Instruction with primary opcode 0. Based on PowerISA
+                * these are illegal instructions.
+                */
+               if (inst == KVMPPC_INST_SW_BREAKPOINT) {
+                       run->exit_reason = KVM_EXIT_DEBUG;
+                       run->debug.arch.address = kvmppc_get_pc(vcpu);
+                       emulated = EMULATE_EXIT_USER;
+                       advance = 0;
+               } else
+                       emulated = EMULATE_FAIL;
+
+               break;
+
        default:
                emulated = EMULATE_FAIL;
        }