aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPratyush Anand <panand@redhat.com>2016-11-14 09:02:45 -0500
committerWill Deacon <will.deacon@arm.com>2016-11-18 12:26:14 -0500
commit0ddb8e0b784ba034f3096d5a54684d0d73155e2a (patch)
tree0f8a2676023d6ff2fe21c4944f8bab5f66ea93c8
parentfdfeff0f9e3d9be2b68fa02566017ffc581ae17b (diff)
arm64: Allow hw watchpoint of length 3,5,6 and 7
Since, arm64 can support all offset within a double word limit. Therefore, now support other lengths within that range as well. Signed-off-by: Pratyush Anand <panand@redhat.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--arch/arm64/include/asm/hw_breakpoint.h4
-rw-r--r--arch/arm64/kernel/hw_breakpoint.c36
2 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/hw_breakpoint.h b/arch/arm64/include/asm/hw_breakpoint.h
index d1c3b06ad307..b6b167ac082b 100644
--- a/arch/arm64/include/asm/hw_breakpoint.h
+++ b/arch/arm64/include/asm/hw_breakpoint.h
@@ -77,7 +77,11 @@ static inline void decode_ctrl_reg(u32 reg,
77/* Lengths */ 77/* Lengths */
78#define ARM_BREAKPOINT_LEN_1 0x1 78#define ARM_BREAKPOINT_LEN_1 0x1
79#define ARM_BREAKPOINT_LEN_2 0x3 79#define ARM_BREAKPOINT_LEN_2 0x3
80#define ARM_BREAKPOINT_LEN_3 0x7
80#define ARM_BREAKPOINT_LEN_4 0xf 81#define ARM_BREAKPOINT_LEN_4 0xf
82#define ARM_BREAKPOINT_LEN_5 0x1f
83#define ARM_BREAKPOINT_LEN_6 0x3f
84#define ARM_BREAKPOINT_LEN_7 0x7f
81#define ARM_BREAKPOINT_LEN_8 0xff 85#define ARM_BREAKPOINT_LEN_8 0xff
82 86
83/* Kernel stepping */ 87/* Kernel stepping */
diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c
index 13035d06b498..1b3c747fedda 100644
--- a/arch/arm64/kernel/hw_breakpoint.c
+++ b/arch/arm64/kernel/hw_breakpoint.c
@@ -317,9 +317,21 @@ static int get_hbp_len(u8 hbp_len)
317 case ARM_BREAKPOINT_LEN_2: 317 case ARM_BREAKPOINT_LEN_2:
318 len_in_bytes = 2; 318 len_in_bytes = 2;
319 break; 319 break;
320 case ARM_BREAKPOINT_LEN_3:
321 len_in_bytes = 3;
322 break;
320 case ARM_BREAKPOINT_LEN_4: 323 case ARM_BREAKPOINT_LEN_4:
321 len_in_bytes = 4; 324 len_in_bytes = 4;
322 break; 325 break;
326 case ARM_BREAKPOINT_LEN_5:
327 len_in_bytes = 5;
328 break;
329 case ARM_BREAKPOINT_LEN_6:
330 len_in_bytes = 6;
331 break;
332 case ARM_BREAKPOINT_LEN_7:
333 len_in_bytes = 7;
334 break;
323 case ARM_BREAKPOINT_LEN_8: 335 case ARM_BREAKPOINT_LEN_8:
324 len_in_bytes = 8; 336 len_in_bytes = 8;
325 break; 337 break;
@@ -381,9 +393,21 @@ int arch_bp_generic_fields(struct arch_hw_breakpoint_ctrl ctrl,
381 case ARM_BREAKPOINT_LEN_2: 393 case ARM_BREAKPOINT_LEN_2:
382 *gen_len = HW_BREAKPOINT_LEN_2; 394 *gen_len = HW_BREAKPOINT_LEN_2;
383 break; 395 break;
396 case ARM_BREAKPOINT_LEN_3:
397 *gen_len = HW_BREAKPOINT_LEN_3;
398 break;
384 case ARM_BREAKPOINT_LEN_4: 399 case ARM_BREAKPOINT_LEN_4:
385 *gen_len = HW_BREAKPOINT_LEN_4; 400 *gen_len = HW_BREAKPOINT_LEN_4;
386 break; 401 break;
402 case ARM_BREAKPOINT_LEN_5:
403 *gen_len = HW_BREAKPOINT_LEN_5;
404 break;
405 case ARM_BREAKPOINT_LEN_6:
406 *gen_len = HW_BREAKPOINT_LEN_6;
407 break;
408 case ARM_BREAKPOINT_LEN_7:
409 *gen_len = HW_BREAKPOINT_LEN_7;
410 break;
387 case ARM_BREAKPOINT_LEN_8: 411 case ARM_BREAKPOINT_LEN_8:
388 *gen_len = HW_BREAKPOINT_LEN_8; 412 *gen_len = HW_BREAKPOINT_LEN_8;
389 break; 413 break;
@@ -427,9 +451,21 @@ static int arch_build_bp_info(struct perf_event *bp)
427 case HW_BREAKPOINT_LEN_2: 451 case HW_BREAKPOINT_LEN_2:
428 info->ctrl.len = ARM_BREAKPOINT_LEN_2; 452 info->ctrl.len = ARM_BREAKPOINT_LEN_2;
429 break; 453 break;
454 case HW_BREAKPOINT_LEN_3:
455 info->ctrl.len = ARM_BREAKPOINT_LEN_3;
456 break;
430 case HW_BREAKPOINT_LEN_4: 457 case HW_BREAKPOINT_LEN_4:
431 info->ctrl.len = ARM_BREAKPOINT_LEN_4; 458 info->ctrl.len = ARM_BREAKPOINT_LEN_4;
432 break; 459 break;
460 case HW_BREAKPOINT_LEN_5:
461 info->ctrl.len = ARM_BREAKPOINT_LEN_5;
462 break;
463 case HW_BREAKPOINT_LEN_6:
464 info->ctrl.len = ARM_BREAKPOINT_LEN_6;
465 break;
466 case HW_BREAKPOINT_LEN_7:
467 info->ctrl.len = ARM_BREAKPOINT_LEN_7;
468 break;
433 case HW_BREAKPOINT_LEN_8: 469 case HW_BREAKPOINT_LEN_8:
434 info->ctrl.len = ARM_BREAKPOINT_LEN_8; 470 info->ctrl.len = ARM_BREAKPOINT_LEN_8;
435 break; 471 break;