aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/hw_breakpoint.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c
index b5cb0c59ea87..7114ba220fd4 100644
--- a/arch/x86/kernel/hw_breakpoint.c
+++ b/arch/x86/kernel/hw_breakpoint.c
@@ -167,29 +167,6 @@ void arch_uninstall_hw_breakpoint(struct perf_event *bp)
167 set_dr_addr_mask(0, i); 167 set_dr_addr_mask(0, i);
168} 168}
169 169
170static int get_hbp_len(u8 hbp_len)
171{
172 unsigned int len_in_bytes = 0;
173
174 switch (hbp_len) {
175 case X86_BREAKPOINT_LEN_1:
176 len_in_bytes = 1;
177 break;
178 case X86_BREAKPOINT_LEN_2:
179 len_in_bytes = 2;
180 break;
181 case X86_BREAKPOINT_LEN_4:
182 len_in_bytes = 4;
183 break;
184#ifdef CONFIG_X86_64
185 case X86_BREAKPOINT_LEN_8:
186 len_in_bytes = 8;
187 break;
188#endif
189 }
190 return len_in_bytes;
191}
192
193/* 170/*
194 * Check for virtual address in kernel space. 171 * Check for virtual address in kernel space.
195 */ 172 */
@@ -200,7 +177,7 @@ int arch_check_bp_in_kernelspace(struct perf_event *bp)
200 struct arch_hw_breakpoint *info = counter_arch_bp(bp); 177 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
201 178
202 va = info->address; 179 va = info->address;
203 len = get_hbp_len(info->len); 180 len = bp->attr.bp_len;
204 181
205 return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE); 182 return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE);
206} 183}