]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: pass correct DR6 for GD userspace exit
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 6 May 2020 09:59:39 +0000 (05:59 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 8 May 2020 11:44:31 +0000 (07:44 -0400)
commit6620055163ccac8d6b7cd05ae50cc7911cb68a3c
treeb900146bb6cabb366b4cdb1219704caf7d5006b9
parent9402532a2acee14c75970c98be688f710e0cbc87
KVM: VMX: pass correct DR6 for GD userspace exit

When KVM_EXIT_DEBUG is raised for the disabled-breakpoints case (DR7.GD),
DR6 was incorrectly copied from the value in the VM.  Instead,
DR6.BD should be set in order to catch this case.

On AMD this does not need any special code because the processor triggers
a #DB exception that is intercepted.  However, the testcase would fail
without the previous patch because both DR6.BS and DR6.BD would be set.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c
tools/testing/selftests/kvm/x86_64/debug_regs.c