]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/hw_breakpoints: Rewrite 8xx breakpoints to allow any address range size.
authorChristophe Leroy <christophe.leroy@c-s.fr>
Tue, 26 Nov 2019 17:43:29 +0000 (17:43 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 23 Jan 2020 10:31:14 +0000 (21:31 +1100)
commit5e3be8a822e844a46d627fcc50a45ff03ea30e1a
treeb743c9950361f2d2246166aac9ad2554be1dc28d
parentc0f42097e6fe72ede0cf3df0223dd69d6d14534a
powerpc/hw_breakpoints: Rewrite 8xx breakpoints to allow any address range size.

Unlike standard powerpc, Powerpc 8xx doesn't have SPRN_DABR, but
it has a breakpoint support based on a set of comparators which
allow more flexibility.

Commit 3ad777a8cb01 ("powerpc/8xx: Implement hw_breakpoint")
implemented breakpoints by emulating the DABR behaviour. It did
this by setting one comparator the match 4 bytes at breakpoint address
and the other comparator to match 4 bytes at breakpoint address + 4.

Rewrite 8xx hw_breakpoint to make breakpoints match all addresses
defined by the breakpoint address and length by making full use of
comparators.

Now, comparator E is set to match any address greater than breakpoint
address minus one. Comparator F is set to match any address lower than
breakpoint address plus breakpoint length. Addresses are aligned
to 32 bits.

When the breakpoint range starts at address 0, the breakpoint is set
to match comparator F only. When the breakpoint range end at address
0xffffffff, the breakpoint is set to match comparator E only.
Otherwise the breakpoint is set to match comparator E and F.

At the same time, use registers bit names instead of hardcoded values.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/05105deeaf63bc02151aea2cdeaf525534e0e9d4.1574790198.git.christophe.leroy@c-s.fr
arch/powerpc/include/asm/hw_breakpoint.h
arch/powerpc/include/asm/reg_8xx.h
arch/powerpc/kernel/hw_breakpoint.c
arch/powerpc/kernel/process.c