diff options
author | Hollis Blanchard <hollisb@us.ibm.com> | 2008-07-25 13:54:49 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-10-15 10:15:16 +0200 |
commit | 6a0ab738ef42d87951b3980f61b1f4cbb14d4171 (patch) | |
tree | 8650adf6b8c2df9817c7d6dff2a2f8a4b4904abc /arch/powerpc/kvm/booke_guest.c | |
parent | b5e2fec0ebc3fcaff954092bb69444a67a904c0a (diff) |
KVM: ppc: guest breakpoint support
Allow host userspace to program hardware debug registers to set breakpoints
inside guests.
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/powerpc/kvm/booke_guest.c')
-rw-r--r-- | arch/powerpc/kvm/booke_guest.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/booke_guest.c b/arch/powerpc/kvm/booke_guest.c index 9c8ad850c6e3..3cca079975e1 100644 --- a/arch/powerpc/kvm/booke_guest.c +++ b/arch/powerpc/kvm/booke_guest.c @@ -410,6 +410,21 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, break; } + case BOOKE_INTERRUPT_DEBUG: { + u32 dbsr; + + vcpu->arch.pc = mfspr(SPRN_CSRR0); + + /* clear IAC events in DBSR register */ + dbsr = mfspr(SPRN_DBSR); + dbsr &= DBSR_IAC1 | DBSR_IAC2 | DBSR_IAC3 | DBSR_IAC4; + mtspr(SPRN_DBSR, dbsr); + + run->exit_reason = KVM_EXIT_DEBUG; + r = RESUME_HOST; + break; + } + default: printk(KERN_EMERG "exit_nr %d\n", exit_nr); BUG(); |