<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/arm/kernel/hw_breakpoint.c, branch linux-3.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.2.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.2.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-03-16T02:18:42Z</updated>
<entry>
<title>ARM: 8634/1: hw_breakpoint: blacklist Scorpion CPUs</title>
<updated>2017-03-16T02:18:42Z</updated>
<author>
<name>Mark Rutland</name>
</author>
<published>2017-01-06T12:12:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c1c5e50aa758cf5d2b91976dfc1aa6a56707c3f8'/>
<id>urn:sha1:c1c5e50aa758cf5d2b91976dfc1aa6a56707c3f8</id>
<content type='text'>
commit ddc37832a1349f474c4532de381498020ed71d31 upstream.

On APQ8060, the kernel crashes in arch_hw_breakpoint_init, taking an
undefined instruction trap within write_wb_reg. This is because Scorpion
CPUs erroneously appear to set DBGPRSR.SPD when WFI is issued, even if
the core is not powered down. When DBGPRSR.SPD is set, breakpoint and
watchpoint registers are treated as undefined.

It's possible to trigger similar crashes later on from userspace, by
requesting the kernel to install a breakpoint or watchpoint, as we can
go idle at any point between the reset of the debug registers and their
later use. This has always been the case.

Given that this has always been broken, no-one has complained until now,
and there is no clear workaround, disable hardware breakpoints and
watchpoints on Scorpion to avoid these issues.

Signed-off-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Reported-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
[bwh: Backported to 3.2:
 - Open-code read_cpuid_part()
 - Adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 7496/1: hw_breakpoint: don't rely on dfsr to show watchpoint access type</title>
<updated>2012-09-19T14:05:04Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2012-08-16T17:55:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7a5030928317b47b27ceb66f678424caf45e7ccc'/>
<id>urn:sha1:7a5030928317b47b27ceb66f678424caf45e7ccc</id>
<content type='text'>
commit bf8801145c01ab600f8df66e8c879ac642fa5846 upstream.

From ARM debug architecture v7.1 onwards, a watchpoint exception causes
the DFAR to be updated with the faulting data address. However, DFSR.WnR
takes an UNKNOWN value and therefore cannot be used in general to
determine the access type that triggered the watchpoint.

This patch forbids watchpoints without an overflow handler from
specifying a specific access type (load/store). Those with overflow
handlers must be able to handle false positives potentially triggered by
a watchpoint of a different access type on the same address. For
SIGTRAP-based handlers (i.e. ptrace), this should have no impact.

Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 7127/1: hw_breakpoint: skip v7-specific reset on v6 cores</title>
<updated>2011-10-08T09:05:34Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2011-10-07T14:57:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a26bce1220a4c5a7a074a779e6aad3cae63a94f7'/>
<id>urn:sha1:a26bce1220a4c5a7a074a779e6aad3cae63a94f7</id>
<content type='text'>
ARMv6 cores do not implement the DBGOSLAR register, so we don't need to
try and clear it on boot. Furthermore, the VCR is zeroed out of reset,
so we don't need to zero it explicitly when a CPU comes online.

Tested-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: hw_breakpoint: reduce the number of WARN_ONCE invocations</title>
<updated>2011-08-31T09:42:48Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2011-08-04T13:46:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d12443363e590461655d4e9ccc31e40ad9078283'/>
<id>urn:sha1:d12443363e590461655d4e9ccc31e40ad9078283</id>
<content type='text'>
The ARM hw_breakpoint backend is currently a bit too noisy when things
start to go awry.

This patch removes a couple of over-zealous WARN_ONCE invocations and
replaces then with pr_warnings instead.

Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
<entry>
<title>ARM: hw_breakpoint: trap undef instruction exceptions in reset_ctrl_regs</title>
<updated>2011-08-31T09:42:48Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2011-08-08T13:26:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0d352e3d006c9589f22580212c3822cf62b6d775'/>
<id>urn:sha1:0d352e3d006c9589f22580212c3822cf62b6d775</id>
<content type='text'>
The ARM debug registers can only be accessed if the DBGSWENABLE signal
to the core is driven HIGH by the DAP. The architecture does not provide
a way to detect the value of this signal, so the best we can do is
register an undef_hook to trap debug register co-processor accesses and
then fail if the trap is taken.

Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
<entry>
<title>ARM: hw_breakpoint: add support for multiple watchpoints</title>
<updated>2011-08-31T09:42:48Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2011-08-02T15:16:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6f26aa05c9edffff6a4c2cd71774bc659a5cceec'/>
<id>urn:sha1:6f26aa05c9edffff6a4c2cd71774bc659a5cceec</id>
<content type='text'>
ARM debug architecture 7.1 mandates that the DFAR is updated on a
watchpoint debug exception to contain the faulting virtual address
of the memory access. This allows us to determine which watchpoints
have fired and therefore report useful information to userspace.

This patch adds support for using the DFAR in the watchpoint handler,
which allows us to support multiple watchpoints on CPUs implementing
the new debug architecture.

Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
<entry>
<title>ARM: hw_breakpoint: reserve one breakpoint for watchpoint stepping</title>
<updated>2011-08-31T09:42:48Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2011-08-02T12:01:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c512de955f0982aafa49d3f00d5643052a6790e5'/>
<id>urn:sha1:c512de955f0982aafa49d3f00d5643052a6790e5</id>
<content type='text'>
The current hw_breakpoint code on ARM reserves 1 breakpoint for each
watchpoint that is available. Since debug architectures prior to 7.1
are restricted to 1 watchpoint anyway, only one breakpoint was ever
reserved.

This patch changes the reservation strategy so that a single breakpoint
is reserved, regardless of the number of watchpoints. This is in
preparation for multiple-watchpoint support on debug architectures
from 7.1 onwards.

Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
<entry>
<title>ARM: hw_breakpoint: add initial Cortex-A15 (debug v7.1) support</title>
<updated>2011-08-31T09:42:47Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2011-07-22T17:27:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b5d5b8f98641edac6641af9e19e933083ade603b'/>
<id>urn:sha1:b5d5b8f98641edac6641af9e19e933083ade603b</id>
<content type='text'>
This patch adds initial support for Cortex-A15 (debug architecture v7.1)
to the hw_breakpoint ARM backend.

Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
<entry>
<title>ARM: entry: avoid enabling interrupts in prefetch/data abort handlers</title>
<updated>2011-07-02T09:56:00Z</updated>
<author>
<name>Russell King</name>
</author>
<published>2011-06-25T10:44:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=02fe2845d6a837ab02f0738f6cf4591a02cc88d4'/>
<id>urn:sha1:02fe2845d6a837ab02f0738f6cf4591a02cc88d4</id>
<content type='text'>
Avoid enabling interrupts if the parent context had interrupts enabled
in the abort handler assembly code, and move this into the breakpoint/
page/alignment fault handlers instead.

This gets rid of some special-casing for the breakpoint fault handlers
from the low level abort handler path.

Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 6864/1: hw_breakpoint: clear DBGVCR out of reset</title>
<updated>2011-04-10T20:13:35Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2011-04-05T12:57:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e89c0d7090c54d7b11b9b091e495a1ae345dd3ff'/>
<id>urn:sha1:e89c0d7090c54d7b11b9b091e495a1ae345dd3ff</id>
<content type='text'>
The DBGVCR, used for configuring vector catch debug events, is UNKNOWN
out of reset on ARMv7. When enabling monitor mode, this must be zeroed
to avoid UNPREDICTABLE behaviour.

This patch adds the zeroing code to the debug reset path.

Cc: stable &lt;stable@kernel.org&gt;
Reported-by: Stepan Moskovchenko &lt;stepanm@codeaurora.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
</feed>
