aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorNadav Amit <namit@cs.technion.ac.il>2014-11-02 11:54:44 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2014-11-07 15:44:03 +0100
commit7305eb5d8cf147ce4178e723c95de15e2f001429 (patch)
tree030acd2f20dfaf9bd080332ffc634d039cef203e /arch/x86/kvm/vmx.c
parentKVM: x86: Emulator should set DR6 upon GD like real CPU (diff)
downloadlinux-dev-7305eb5d8cf147ce4178e723c95de15e2f001429.tar.xz
linux-dev-7305eb5d8cf147ce4178e723c95de15e2f001429.zip
KVM: x86: Clear DR6[0:3] on #DB during handle_dr
DR6[0:3] (previous breakpoint indications) are cleared when #DB is injected during handle_exception, just as real hardware does. Similarily, handle_dr should clear DR6[0:3]. Signed-off-by: Nadav Amit <namit@cs.technion.ac.il> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '')
-rw-r--r--arch/x86/kvm/vmx.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index f9d56c1945de..ad5e0806e1e1 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -5125,6 +5125,7 @@ static int handle_dr(struct kvm_vcpu *vcpu)
vcpu->run->exit_reason = KVM_EXIT_DEBUG;
return 0;
} else {
+ vcpu->arch.dr6 &= ~15;
vcpu->arch.dr6 |= DR6_BD | DR6_RTM;
kvm_queue_exception(vcpu, DB_VECTOR);
return 1;