diff mbox

[V2,3/5] arm64: hw_breakpoint: Handle inexact watchpoint addresses

Message ID CAJt8pk9tH5nm5sUsKx-dAvW4uzKP+EoRumhYV1mXsU_mk6dRDg@mail.gmail.com
State New
Headers show

Commit Message

Pavel Labath Nov. 8, 2016, 11:58 a.m. UTC
>>
>>               /* Do we need to handle the stepping? */
>>               if (is_default_overflow_handler(wp))
>>                       step = 1;
>> -
>> -unlock:
>> -             rcu_read_unlock();
>>       }
>> +     if (min_dist > 0 && min_dist != -1) {
>> +             /* No exact match found. */
>> +             wp = slots[closest_match];
>> +             info = counter_arch_bp(wp);
>> +             info->trigger = addr;
>> +             perf_bp_event(wp, regs);
>> +     }
>
> Why don't we need to bother with the stepping in the case of a non-exact
> match?

Good catch. I think we do. I must have dropped that part somehow.

Pratyush, could you include the attached fixup in the next batch?

regards,
pavel

Comments

Pratyush Anand Nov. 9, 2016, 5:39 p.m. UTC | #1
On Tuesday 08 November 2016 05:28 PM, Pavel Labath wrote:
>>> +     if (min_dist > 0 && min_dist != -1) {
>>> >> +             /* No exact match found. */
>>> >> +             wp = slots[closest_match];
>>> >> +             info = counter_arch_bp(wp);
>>> >> +             info->trigger = addr;
>>> >> +             perf_bp_event(wp, regs);
>>> >> +     }
>> >
>> > Why don't we need to bother with the stepping in the case of a non-exact
>> > match?
> Good catch. I think we do. I must have dropped that part somehow.
>
> Pratyush, could you include the attached fixup in the next batch?

Ok, will do.

~Pratyush
diff mbox

Patch

diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c
index 4125c21..852c753 100644
--- a/arch/arm64/kernel/hw_breakpoint.c
+++ b/arch/arm64/kernel/hw_breakpoint.c
@@ -793,6 +793,10 @@  static int watchpoint_handler(unsigned long addr, unsigned int esr,
 		info = counter_arch_bp(wp);
 		info->trigger = addr;
 		perf_bp_event(wp, regs);
+
+		/* Do we need to handle the stepping? */
+		if (is_default_overflow_handler(wp))
+			step = 1;
 	}
 	rcu_read_unlock();