]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/x86/kvm/vmx.c
KVM: x86: Wire-up hardware breakpoints for guest debugging
[net-next-2.6.git] / arch / x86 / kvm / vmx.c
index 0989776ee7b050dd3ec000056552d782e17226f5..cee81c9a6653bd06b3fa20c13da9c962b25092b5 100644 (file)
@@ -1017,6 +1017,11 @@ static int set_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg)
        if (!(vcpu->guest_debug & KVM_GUESTDBG_ENABLE))
                vcpu->guest_debug = 0;
 
+       if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP)
+               vmcs_writel(GUEST_DR7, dbg->arch.debugreg[7]);
+       else
+               vmcs_writel(GUEST_DR7, vcpu->arch.dr7);
+
        flags = vmcs_readl(GUEST_RFLAGS);
        if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
                flags |= X86_EFLAGS_TF | X86_EFLAGS_RF;