diff options
| -rw-r--r-- | arch/x86/kernel/hw_breakpoint.c | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c index 05d5fec64a94..bb6006e3e295 100644 --- a/arch/x86/kernel/hw_breakpoint.c +++ b/arch/x86/kernel/hw_breakpoint.c | |||
| @@ -212,25 +212,6 @@ static int arch_check_va_in_kernelspace(unsigned long va, u8 hbp_len) | |||
| 212 | return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE); | 212 | return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE); |
| 213 | } | 213 | } |
| 214 | 214 | ||
| 215 | /* | ||
| 216 | * Store a breakpoint's encoded address, length, and type. | ||
| 217 | */ | ||
| 218 | static int arch_store_info(struct perf_event *bp) | ||
| 219 | { | ||
| 220 | struct arch_hw_breakpoint *info = counter_arch_bp(bp); | ||
| 221 | /* | ||
| 222 | * For kernel-addresses, either the address or symbol name can be | ||
| 223 | * specified. | ||
| 224 | */ | ||
| 225 | if (info->name) | ||
| 226 | info->address = (unsigned long) | ||
| 227 | kallsyms_lookup_name(info->name); | ||
| 228 | if (info->address) | ||
| 229 | return 0; | ||
| 230 | |||
| 231 | return -EINVAL; | ||
| 232 | } | ||
| 233 | |||
| 234 | int arch_bp_generic_fields(int x86_len, int x86_type, | 215 | int arch_bp_generic_fields(int x86_len, int x86_type, |
| 235 | int *gen_len, int *gen_type) | 216 | int *gen_len, int *gen_type) |
| 236 | { | 217 | { |
| @@ -362,10 +343,13 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp, | |||
| 362 | return ret; | 343 | return ret; |
| 363 | } | 344 | } |
| 364 | 345 | ||
| 365 | ret = arch_store_info(bp); | 346 | /* |
| 366 | 347 | * For kernel-addresses, either the address or symbol name can be | |
| 367 | if (ret < 0) | 348 | * specified. |
| 368 | return ret; | 349 | */ |
| 350 | if (info->name) | ||
| 351 | info->address = (unsigned long) | ||
| 352 | kallsyms_lookup_name(info->name); | ||
| 369 | /* | 353 | /* |
| 370 | * Check that the low-order bits of the address are appropriate | 354 | * Check that the low-order bits of the address are appropriate |
| 371 | * for the alignment implied by len. | 355 | * for the alignment implied by len. |
