]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/watchpoints: Disable preemption in thread_change_pc()
authorBenjamin Gray <bgray@linux.ibm.com>
Tue, 29 Aug 2023 06:34:55 +0000 (16:34 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Oct 2023 12:56:57 +0000 (14:56 +0200)
commit16722418cbe31400a4ab2ebab05ca2cb305c68e4
tree108401b1e4a9a67dc961282c2ac0a6be404c2cdf
parentee8bbb2a31d33c48eac4a8cdae846d699e6b5d02
powerpc/watchpoints: Disable preemption in thread_change_pc()

[ Upstream commit cc879ab3ce39bc39f9b1d238b283f43a5f6f957d ]

thread_change_pc() uses CPU local data, so must be protected from
swapping CPUs while it is reading the breakpoint struct.

The error is more noticeable after 1e60f3564bad ("powerpc/watchpoints:
Track perf single step directly on the breakpoint"), which added an
unconditional __this_cpu_read() call in thread_change_pc(). However the
existing __this_cpu_read() that runs if a breakpoint does need to be
re-inserted has the same issue.

Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230829063457.54157-2-bgray@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/kernel/hw_breakpoint.c