* [PATCH 1/2] powerpc/hw_brk: Fix setting of length for exact mode breakpoints
@ 2013-06-24 5:47 Michael Neuling
2013-06-24 5:47 ` [PATCH 2/2] powerpc/hw_brk: Fix clearing of extraneous IRQ Michael Neuling
2013-06-25 8:48 ` [PATCH 1/2] powerpc/hw_brk: Fix setting of length for exact mode breakpoints Anshuman Khandual
0 siblings, 2 replies; 4+ messages in thread
From: Michael Neuling @ 2013-06-24 5:47 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Edjunior Barbosa Machado
The smallest match region for both the DABR and DAWR is 8 bytes, so the
kernel needs to filter matches when users want to look at regions smaller than
this.
Currently we set the length of PPC_BREAKPOINT_MODE_EXACT breakpoints to 8.
This is wrong as in exact mode we should only match on 1 address, hence the
length should be 1.
This ensures that the kernel will filter out any exact mode hardware breakpoint
matches on any addresses other than the requested one.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Reported-by: Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org
---
arch/powerpc/kernel/ptrace.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 98c2fc1..64f7bd5 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -1449,7 +1449,9 @@ static long ppc_set_hwdebug(struct task_struct *child,
*/
if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE) {
len = bp_info->addr2 - bp_info->addr;
- } else if (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT) {
+ } else if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_EXACT)
+ len = 1;
+ else {
ptrace_put_breakpoints(child);
return -EINVAL;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] powerpc/hw_brk: Fix clearing of extraneous IRQ
2013-06-24 5:47 [PATCH 1/2] powerpc/hw_brk: Fix setting of length for exact mode breakpoints Michael Neuling
@ 2013-06-24 5:47 ` Michael Neuling
2013-06-25 8:59 ` Anshuman Khandual
2013-06-25 8:48 ` [PATCH 1/2] powerpc/hw_brk: Fix setting of length for exact mode breakpoints Anshuman Khandual
1 sibling, 1 reply; 4+ messages in thread
From: Michael Neuling @ 2013-06-24 5:47 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Edjunior Barbosa Machado
In 9422de3 "powerpc: Hardware breakpoints rewrite to handle non DABR breakpoint
registers" we changed the way we mark extraneous irqs with this:
- info->extraneous_interrupt = !((bp->attr.bp_addr <= dar) &&
- (dar - bp->attr.bp_addr < bp->attr.bp_len));
+ if (!((bp->attr.bp_addr <= dar) &&
+ (dar - bp->attr.bp_addr < bp->attr.bp_len)))
+ info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ;
Unfortunately this is bogus as it never clears extraneous IRQ if it's already
set.
This correctly clears extraneous IRQ before possibly setting it.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Reported-by: Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org
---
arch/powerpc/kernel/hw_breakpoint.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
index a949bdf..1150ae7 100644
--- a/arch/powerpc/kernel/hw_breakpoint.c
+++ b/arch/powerpc/kernel/hw_breakpoint.c
@@ -250,6 +250,7 @@ int __kprobes hw_breakpoint_handler(struct die_args *args)
* we still need to single-step the instruction, but we don't
* generate an event.
*/
+ info->type &= ~HW_BRK_TYPE_EXTRANEOUS_IRQ;
if (!((bp->attr.bp_addr <= dar) &&
(dar - bp->attr.bp_addr < bp->attr.bp_len)))
info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] powerpc/hw_brk: Fix clearing of extraneous IRQ
2013-06-24 5:47 ` [PATCH 2/2] powerpc/hw_brk: Fix clearing of extraneous IRQ Michael Neuling
@ 2013-06-25 8:59 ` Anshuman Khandual
0 siblings, 0 replies; 4+ messages in thread
From: Anshuman Khandual @ 2013-06-25 8:59 UTC (permalink / raw)
To: Michael Neuling; +Cc: linuxppc-dev, Edjunior Barbosa Machado
On 06/24/2013 11:17 AM, Michael Neuling wrote:
> In 9422de3 "powerpc: Hardware breakpoints rewrite to handle non DABR breakpoint
> registers" we changed the way we mark extraneous irqs with this:
>
> - info->extraneous_interrupt = !((bp->attr.bp_addr <= dar) &&
> - (dar - bp->attr.bp_addr < bp->attr.bp_len));
> + if (!((bp->attr.bp_addr <= dar) &&
> + (dar - bp->attr.bp_addr < bp->attr.bp_len)))
> + info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ;
>
> Unfortunately this is bogus as it never clears extraneous IRQ if it's already
> set.
>
> This correctly clears extraneous IRQ before possibly setting it.
>
> Signed-off-by: Michael Neuling <mikey@neuling.org>
Reviewed-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] powerpc/hw_brk: Fix setting of length for exact mode breakpoints
2013-06-24 5:47 [PATCH 1/2] powerpc/hw_brk: Fix setting of length for exact mode breakpoints Michael Neuling
2013-06-24 5:47 ` [PATCH 2/2] powerpc/hw_brk: Fix clearing of extraneous IRQ Michael Neuling
@ 2013-06-25 8:48 ` Anshuman Khandual
1 sibling, 0 replies; 4+ messages in thread
From: Anshuman Khandual @ 2013-06-25 8:48 UTC (permalink / raw)
To: Michael Neuling; +Cc: linuxppc-dev, Edjunior Barbosa Machado
On 06/24/2013 11:17 AM, Michael Neuling wrote:
> The smallest match region for both the DABR and DAWR is 8 bytes, so the
> kernel needs to filter matches when users want to look at regions smaller than
> this.
>
> Currently we set the length of PPC_BREAKPOINT_MODE_EXACT breakpoints to 8.
> This is wrong as in exact mode we should only match on 1 address, hence the
> length should be 1.
>
> This ensures that the kernel will filter out any exact mode hardware breakpoint
> matches on any addresses other than the requested one.
>
> Signed-off-by: Michael Neuling <mikey@neuling.org>
Reviewed-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-06-25 9:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-24 5:47 [PATCH 1/2] powerpc/hw_brk: Fix setting of length for exact mode breakpoints Michael Neuling
2013-06-24 5:47 ` [PATCH 2/2] powerpc/hw_brk: Fix clearing of extraneous IRQ Michael Neuling
2013-06-25 8:59 ` Anshuman Khandual
2013-06-25 8:48 ` [PATCH 1/2] powerpc/hw_brk: Fix setting of length for exact mode breakpoints Anshuman Khandual
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).