KVM: SVM: fill in kvm_run->debug.arch.dr[67]
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 4 May 2020 13:34:10 +0000 (09:34 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 4 May 2020 15:59:03 +0000 (11:59 -0400)
The corresponding code was added for VMX in commit 42dbaa5a057
("KVM: x86: Virtualize debug registers, 2008-12-15) but never for AMD.
Fix this.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/svm.c

index 2f379bacbb26a3750157f80456a8d6321fa53ad2..38f6aeefeb5537f78af2bcdf22e82dca51271543 100644 (file)
@@ -1752,6 +1752,8 @@ static int db_interception(struct vcpu_svm *svm)
        if (svm->vcpu.guest_debug &
            (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP)) {
                kvm_run->exit_reason = KVM_EXIT_DEBUG;
+               kvm_run->debug.arch.dr6 = svm->vmcb->save.dr6;
+               kvm_run->debug.arch.dr7 = svm->vmcb->save.dr7;
                kvm_run->debug.arch.pc =
                        svm->vmcb->save.cs.base + svm->vmcb->save.rip;
                kvm_run->debug.arch.exception = DB_VECTOR;