aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/debugreg.h4
-rw-r--r--arch/x86/kernel/hw_breakpoint.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/include/asm/debugreg.h b/arch/x86/include/asm/debugreg.h
index fdabd8435765..8240f76b531e 100644
--- a/arch/x86/include/asm/debugreg.h
+++ b/arch/x86/include/asm/debugreg.h
@@ -75,7 +75,7 @@
75 */ 75 */
76#ifdef __KERNEL__ 76#ifdef __KERNEL__
77 77
78DECLARE_PER_CPU(unsigned long, dr7); 78DECLARE_PER_CPU(unsigned long, cpu_dr7);
79 79
80static inline void hw_breakpoint_disable(void) 80static inline void hw_breakpoint_disable(void)
81{ 81{
@@ -91,7 +91,7 @@ static inline void hw_breakpoint_disable(void)
91 91
92static inline int hw_breakpoint_active(void) 92static inline int hw_breakpoint_active(void)
93{ 93{
94 return __get_cpu_var(dr7) & DR_GLOBAL_ENABLE_MASK; 94 return __get_cpu_var(cpu_dr7) & DR_GLOBAL_ENABLE_MASK;
95} 95}
96 96
97extern void aout_dump_debugregs(struct user *dump); 97extern void aout_dump_debugregs(struct user *dump);
diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c
index 4d267fb77828..92ea5aad0b5c 100644
--- a/arch/x86/kernel/hw_breakpoint.c
+++ b/arch/x86/kernel/hw_breakpoint.c
@@ -46,8 +46,8 @@
46#include <asm/debugreg.h> 46#include <asm/debugreg.h>
47 47
48/* Per cpu debug control register value */ 48/* Per cpu debug control register value */
49DEFINE_PER_CPU(unsigned long, dr7); 49DEFINE_PER_CPU(unsigned long, cpu_dr7);
50EXPORT_PER_CPU_SYMBOL(dr7); 50EXPORT_PER_CPU_SYMBOL(cpu_dr7);
51 51
52/* Per cpu debug address registers values */ 52/* Per cpu debug address registers values */
53static DEFINE_PER_CPU(unsigned long, cpu_debugreg[HBP_NUM]); 53static DEFINE_PER_CPU(unsigned long, cpu_debugreg[HBP_NUM]);
@@ -118,7 +118,7 @@ int arch_install_hw_breakpoint(struct perf_event *bp)
118 set_debugreg(info->address, i); 118 set_debugreg(info->address, i);
119 __get_cpu_var(cpu_debugreg[i]) = info->address; 119 __get_cpu_var(cpu_debugreg[i]) = info->address;
120 120
121 dr7 = &__get_cpu_var(dr7); 121 dr7 = &__get_cpu_var(cpu_dr7);
122 *dr7 |= encode_dr7(i, info->len, info->type); 122 *dr7 |= encode_dr7(i, info->len, info->type);
123 123
124 set_debugreg(*dr7, 7); 124 set_debugreg(*dr7, 7);
@@ -153,7 +153,7 @@ void arch_uninstall_hw_breakpoint(struct perf_event *bp)
153 if (WARN_ONCE(i == HBP_NUM, "Can't find any breakpoint slot")) 153 if (WARN_ONCE(i == HBP_NUM, "Can't find any breakpoint slot"))
154 return; 154 return;
155 155
156 dr7 = &__get_cpu_var(dr7); 156 dr7 = &__get_cpu_var(cpu_dr7);
157 *dr7 &= ~encode_dr7(i, info->len, info->type); 157 *dr7 &= ~encode_dr7(i, info->len, info->type);
158 158
159 set_debugreg(*dr7, 7); 159 set_debugreg(*dr7, 7);
@@ -437,7 +437,7 @@ void hw_breakpoint_restore(void)
437 set_debugreg(__get_cpu_var(cpu_debugreg[2]), 2); 437 set_debugreg(__get_cpu_var(cpu_debugreg[2]), 2);
438 set_debugreg(__get_cpu_var(cpu_debugreg[3]), 3); 438 set_debugreg(__get_cpu_var(cpu_debugreg[3]), 3);
439 set_debugreg(current->thread.debugreg6, 6); 439 set_debugreg(current->thread.debugreg6, 6);
440 set_debugreg(__get_cpu_var(dr7), 7); 440 set_debugreg(__get_cpu_var(cpu_dr7), 7);
441} 441}
442EXPORT_SYMBOL_GPL(hw_breakpoint_restore); 442EXPORT_SYMBOL_GPL(hw_breakpoint_restore);
443 443