diff options
author | Nadav Amit <namit@cs.technion.ac.il> | 2014-07-16 18:19:31 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-07-21 07:43:09 -0400 |
commit | 4161a569065b17954848069d5209182083ce876b (patch) | |
tree | b9c283d8e7b6937cbbd7016a4431e8eca2407134 /arch/x86/kvm | |
parent | 6c6cb69b8e974049cca2cc4480052fb9e7df767b (diff) |
KVM: x86: emulator injects #DB when RFLAGS.RF is set
If the RFLAGS.RF is set, then no #DB should occur on instruction breakpoints.
However, the KVM emulator injects #DB regardless to RFLAGS.RF. This patch fixes
this behavior. KVM, however, still appears not to update RFLAGS.RF correctly,
regardless of this patch.
Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/x86.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 1fd806cb96d4..cc4f65f39b87 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -5158,7 +5158,8 @@ static bool kvm_vcpu_check_breakpoint(struct kvm_vcpu *vcpu, int *r) | |||
5158 | } | 5158 | } |
5159 | } | 5159 | } |
5160 | 5160 | ||
5161 | if (unlikely(vcpu->arch.dr7 & DR7_BP_EN_MASK)) { | 5161 | if (unlikely(vcpu->arch.dr7 & DR7_BP_EN_MASK) && |
5162 | !(kvm_get_rflags(vcpu) & X86_EFLAGS_RF)) { | ||
5162 | dr6 = kvm_vcpu_check_hw_bp(eip, 0, | 5163 | dr6 = kvm_vcpu_check_hw_bp(eip, 0, |
5163 | vcpu->arch.dr7, | 5164 | vcpu->arch.dr7, |
5164 | vcpu->arch.db); | 5165 | vcpu->arch.db); |