]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/powerpc/kvm/emulate.c
powerpc/kvm: support to handle sw breakpoint
[linux.git] / arch / powerpc / kvm / emulate.c
index e96b50d0bdab1f80f3374b35a7c9462a9fcc8a51..005222b580eaece3fcb1739b7810f04ae9c44a06 100644 (file)
@@ -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;
        }