On Tue, Feb 7, 2023 at 7:22 PM Rohan McLure [off-list ref] wrote:
KCSAN instruments calls to atomic builtins, and will in turn call these
builtins itself. As such, architectures supporting KCSAN must have
compiler support for these atomic primitives.
Since 32-bit systems are unlikely to have 64-bit compiler builtins,
provide a stub for each missing builtin, and use BUG() to assert
unreachability.
In commit 725aea873261 ("xtensa: enable KCSAN"), xtensa implements these
locally, but does not advertise the fact with preprocessor macros. To
avoid production of duplicate symbols, do not build the stubs on xtensa.
A future patch will remove the xtensa implementation of these stubs.
Signed-off-by: Rohan McLure <redacted>
---
v4: New patch
---
kernel/kcsan/Makefile | 3 ++
kernel/kcsan/stubs.c | 78 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 81 insertions(+)
create mode 100644 kernel/kcsan/stubs.c
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
--
Thanks.
-- Max