提交 59d8eb53 编写于 作者: F Frederic Weisbecker

hw-breakpoints: Wrap in the KVM breakpoint active state check

Wrap in the cpu dr7 check that tells if we have active
breakpoints that need to be restored in the cpu.

This wrapper makes the check more self-explainable and also
reusable for any further other uses.
Reported-by: NJan Kiszka <jan.kiszka@web.de>
Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: "K. Prasad" <prasad@linux.vnet.ibm.com>
上级 f60d24d2
......@@ -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
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册