aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/lib/kcsan-stubs.c
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2019-10-04 23:33:31 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2022-05-01 19:51:22 -0700
commit725aea873261e8d986e527838fde2a721f0962d8 (patch)
tree904b4456d5cb34d2b6d57a41845c06c176d91270 /arch/xtensa/lib/kcsan-stubs.c
parentxtensa: enable HAVE_VIRT_CPU_ACCOUNTING_GEN (diff)
downloadlinux-dev-725aea873261e8d986e527838fde2a721f0962d8.tar.xz
linux-dev-725aea873261e8d986e527838fde2a721f0962d8.zip
xtensa: enable KCSAN
Prefix arch-specific barrier macros with '__' to make use of instrumented generic macros. Prefix arch-specific bitops with 'arch_' to make use of instrumented generic functions. Provide stubs for 64-bit atomics when building with KCSAN. Disable KCSAN instrumentation in arch/xtensa/boot. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Acked-by: Marco Elver <elver@google.com>
Diffstat (limited to '')
-rw-r--r--arch/xtensa/lib/kcsan-stubs.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/arch/xtensa/lib/kcsan-stubs.c b/arch/xtensa/lib/kcsan-stubs.c
new file mode 100644
index 000000000000..2b08faa62b86
--- /dev/null
+++ b/arch/xtensa/lib/kcsan-stubs.c
@@ -0,0 +1,54 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/bug.h>
+#include <linux/types.h>
+
+void __atomic_store_8(volatile void *p, u64 v, int i)
+{
+ BUG();
+}
+
+u64 __atomic_load_8(const volatile void *p, int i)
+{
+ BUG();
+}
+
+u64 __atomic_exchange_8(volatile void *p, u64 v, int i)
+{
+ BUG();
+}
+
+bool __atomic_compare_exchange_8(volatile void *p1, void *p2, u64 v, bool b, int i1, int i2)
+{
+ BUG();
+}
+
+u64 __atomic_fetch_add_8(volatile void *p, u64 v, int i)
+{
+ BUG();
+}
+
+u64 __atomic_fetch_sub_8(volatile void *p, u64 v, int i)
+{
+ BUG();
+}
+
+u64 __atomic_fetch_and_8(volatile void *p, u64 v, int i)
+{
+ BUG();
+}
+
+u64 __atomic_fetch_or_8(volatile void *p, u64 v, int i)
+{
+ BUG();
+}
+
+u64 __atomic_fetch_xor_8(volatile void *p, u64 v, int i)
+{
+ BUG();
+}
+
+u64 __atomic_fetch_nand_8(volatile void *p, u64 v, int i)
+{
+ BUG();
+}