aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/debugreg.h
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-11-10 11:03:12 +0100
committerFrederic Weisbecker <fweisbec@gmail.com>2009-11-10 11:23:43 +0100
commit59d8eb53ea9947db7cad8ebc31b0fb54f23a9851 (patch)
tree99a1e3f7e2ba5ccf139b46a5d120c47af17d79a1 /arch/x86/include/asm/debugreg.h
parenthw-breakpoints: Fix broken hw-breakpoint sample module (diff)
downloadlinux-dev-59d8eb53ea9947db7cad8ebc31b0fb54f23a9851.tar.xz
linux-dev-59d8eb53ea9947db7cad8ebc31b0fb54f23a9851.zip
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: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Avi Kivity <avi@redhat.com> Cc: "K. Prasad" <prasad@linux.vnet.ibm.com>
Diffstat (limited to 'arch/x86/include/asm/debugreg.h')
-rw-r--r--arch/x86/include/asm/debugreg.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/include/asm/debugreg.h b/arch/x86/include/asm/debugreg.h
index f1b673f08239..0f6e92af4227 100644
--- a/arch/x86/include/asm/debugreg.h
+++ b/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