Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356403
b: refs/heads/master
c: 4ae7ebe
h: refs/heads/master
i:
  356401: ac50856
  356399: 973d2c7
v: v3
  • Loading branch information
Michael Neuling authored and Benjamin Herrenschmidt committed Jan 29, 2013
1 parent 00f20fd commit fabeb8b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 05d694ea0daa2e442191a2128aaec78635823f08
refs/heads/master: 4ae7ebe9522a9e3626e28b4d268dae712738573d
2 changes: 0 additions & 2 deletions trunk/arch/powerpc/include/asm/hw_breakpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 10 additions & 2 deletions trunk/arch/powerpc/kernel/hw_breakpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit fabeb8b

Please sign in to comment.