powerpc/kcsan: Exclude udelay to prevent recursive instrumentation
authorRohan McLure <rmclure@linux.ibm.com>
Mon, 6 Feb 2023 02:17:58 +0000 (13:17 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:49:01 +0000 (08:49 +0100)
commitadb939031af35385952666905e23725fd9bc7baf
treedd5111d7eeada7e0193dbcf50c59d8dfd810970c
parente3a62a35f903fd8be5b44542fe3901ec45f16757
powerpc/kcsan: Exclude udelay to prevent recursive instrumentation

[ Upstream commit 2a7ce82dc46c591c9244057d89a6591c9639b9b9 ]

In order for KCSAN to increase its likelihood of observing a data race,
it sets a watchpoint on memory accesses and stalls, allowing for
detection of conflicting accesses by other kernel threads or interrupts.

Stalls are implemented by injecting a call to udelay in instrumented code.
To prevent recursive instrumentation, exclude udelay from being instrumented.

Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20230206021801.105268-3-rmclure@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/kernel/time.c