From fabeb8b116b7b9a1597705a27e126173d79f5efb Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Thu, 24 Jan 2013 15:02:59 +0000 Subject: [PATCH] --- yaml --- r: 356403 b: refs/heads/master c: 4ae7ebe9522a9e3626e28b4d268dae712738573d h: refs/heads/master i: 356401: ac508567c801e82d03697d6ae9db42426378db5b 356399: 973d2c7125fa9156e38814add5dd12c5d169d4f0 v: v3 --- [refs] | 2 +- trunk/arch/powerpc/include/asm/hw_breakpoint.h | 2 -- trunk/arch/powerpc/kernel/hw_breakpoint.c | 12 ++++++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index c9ac57037dcc..a508c53db2d6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 05d694ea0daa2e442191a2128aaec78635823f08 +refs/heads/master: 4ae7ebe9522a9e3626e28b4d268dae712738573d diff --git a/trunk/arch/powerpc/include/asm/hw_breakpoint.h b/trunk/arch/powerpc/include/asm/hw_breakpoint.h index 96437e5014e1..eb0f4ac75c4c 100644 --- a/trunk/arch/powerpc/include/asm/hw_breakpoint.h +++ b/trunk/arch/powerpc/include/asm/hw_breakpoint.h @@ -57,8 +57,6 @@ struct pmu; struct perf_sample_data; #define HW_BREAKPOINT_ALIGN 0x7 -/* Maximum permissible length of any HW Breakpoint */ -#define HW_BREAKPOINT_LEN 0x8 extern int hw_breakpoint_slots(int type); extern int arch_bp_generic_fields(int type, int *gen_bp_type); diff --git a/trunk/arch/powerpc/kernel/hw_breakpoint.c b/trunk/arch/powerpc/kernel/hw_breakpoint.c index 2a3e8dd547ec..a949bdfc9623 100644 --- a/trunk/arch/powerpc/kernel/hw_breakpoint.c +++ b/trunk/arch/powerpc/kernel/hw_breakpoint.c @@ -142,7 +142,7 @@ int arch_bp_generic_fields(int type, int *gen_bp_type) */ int arch_validate_hwbkpt_settings(struct perf_event *bp) { - int ret = -EINVAL; + int ret = -EINVAL, length_max; struct arch_hw_breakpoint *info = counter_arch_bp(bp); if (!bp) @@ -171,8 +171,16 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp) * HW_BREAKPOINT_ALIGN by rounding off to the lower address, the * 'symbolsize' should satisfy the check below. */ + length_max = 8; /* DABR */ + if (cpu_has_feature(CPU_FTR_DAWR)) { + length_max = 512 ; /* 64 doublewords */ + /* DAWR region can't cross 512 boundary */ + if ((bp->attr.bp_addr >> 10) != + ((bp->attr.bp_addr + bp->attr.bp_len) >> 10)) + return -EINVAL; + } if (info->len > - (HW_BREAKPOINT_LEN - (info->address & HW_BREAKPOINT_ALIGN))) + (length_max - (info->address & HW_BREAKPOINT_ALIGN))) return -EINVAL; return 0; }