aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2014-01-04 12:47:17 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2014-01-17 04:22:12 -0500
commit8246bf52c75aa9b9b336a84f31ed2248754d0f71 (patch)
tree099477dbaefe4a61c5c117097b54cf922acdd23d /arch
parent73aaf249ee2287b4686ff079dcbdbbb658156e64 (diff)
KVM: VMX: Fix DR6 update on #DB exception
According to the SDM, only bits 0-3 of DR6 "may" be cleared by "certain" debug exception. So do update them on #DB exception in KVM, but leave the rest alone, only setting BD and BS in addition to already set bits in DR6. This also aligns us with kvm_vcpu_check_singlestep. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/vmx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 79b360e4fed1..c8eb27ff1a2d 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -4869,7 +4869,8 @@ static int handle_exception(struct kvm_vcpu *vcpu)
4869 dr6 = vmcs_readl(EXIT_QUALIFICATION); 4869 dr6 = vmcs_readl(EXIT_QUALIFICATION);
4870 if (!(vcpu->guest_debug & 4870 if (!(vcpu->guest_debug &
4871 (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP))) { 4871 (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP))) {
4872 vcpu->arch.dr6 = dr6 | DR6_FIXED_1; 4872 vcpu->arch.dr6 &= ~15;
4873 vcpu->arch.dr6 |= dr6;
4873 kvm_queue_exception(vcpu, DB_VECTOR); 4874 kvm_queue_exception(vcpu, DB_VECTOR);
4874 return 1; 4875 return 1;
4875 } 4876 }