]> git.ipfire.org Git - thirdparty/linux.git/commit - arch/arm/kernel/hw_breakpoint.c
ARM: hw_breakpoint: ensure OS lock is clear before writing to debug registers
authorWill Deacon <will.deacon@arm.com>
Wed, 24 Nov 2010 16:51:17 +0000 (16:51 +0000)
committerWill Deacon <will.deacon@arm.com>
Mon, 6 Dec 2010 11:55:56 +0000 (11:55 +0000)
commitac88e07122fc0eb5cbad403be97ef02c317a06b7
tree0cddfd29474fc4ff5a1be95d2273d3a1e626055f
parente8a7e48bb248a1196484d3f8afa53bded2b24e71
ARM: hw_breakpoint: ensure OS lock is clear before writing to debug registers

ARMv7 architects a system for saving and restoring the debug registers
across low-power modes. At the heart of this system is a lock register
which, when set, forbids writes to the debug registers. While locked,
writes to debug registers via the co-processor interface will result
in undefined instruction traps. Linux currently doesn't make use of
this feature because we update the debug registers on context switch
anyway, however the status of the lock is IMPLEMENTATION DEFINED on
reset.

This patch ensures that the lock is cleared during boot so that we
can write to the debug registers safely.

Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm/kernel/hw_breakpoint.c