From a0aba3983486592e9f912a64e9d1e9876feee9ad Mon Sep 17 00:00:00 2001 From: Frederic Weisbecker Date: Tue, 10 Nov 2009 11:03:12 +0100 Subject: [PATCH] --- yaml --- r: 169701 b: refs/heads/master c: 59d8eb53ea9947db7cad8ebc31b0fb54f23a9851 h: refs/heads/master i: 169699: 74a967ba090c06045c7fe0997916f2b3418fb424 v: v3 --- [refs] | 2 +- trunk/arch/x86/include/asm/debugreg.h | 5 +++++ trunk/arch/x86/kvm/x86.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 962bcaa21314..3f4e8afd1881 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f60d24d2ad04977b0bd9e3eb35dba2d2fa569af9 +refs/heads/master: 59d8eb53ea9947db7cad8ebc31b0fb54f23a9851 diff --git a/trunk/arch/x86/include/asm/debugreg.h b/trunk/arch/x86/include/asm/debugreg.h index f1b673f08239..0f6e92af4227 100644 --- a/trunk/arch/x86/include/asm/debugreg.h +++ b/trunk/arch/x86/include/asm/debugreg.h @@ -89,6 +89,11 @@ static inline void hw_breakpoint_disable(void) set_debugreg(0UL, 3); } +static inline int hw_breakpoint_active(void) +{ + return __get_cpu_var(dr7) & DR_GLOBAL_ENABLE_MASK; +} + extern void aout_dump_debugregs(struct user *dump); #ifdef CONFIG_KVM diff --git a/trunk/arch/x86/kvm/x86.c b/trunk/arch/x86/kvm/x86.c index 22dee7aa7813..3817220cc86b 100644 --- a/trunk/arch/x86/kvm/x86.c +++ b/trunk/arch/x86/kvm/x86.c @@ -3651,7 +3651,7 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) * care about the messed up debug address registers. But if * we have some of them active, restore the old state. */ - if (__get_cpu_var(dr7) & DR_GLOBAL_ENABLE_MASK) + if (hw_breakpoint_active()) hw_breakpoint_restore(); set_bit(KVM_REQ_KICK, &vcpu->requests);