1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef _KERNEL_KCSAN_ATOMIC_H
4 #define _KERNEL_KCSAN_ATOMIC_H
6 #include <linux/jiffies.h>
7 #include <linux/sched.h>
10 * Special rules for certain memory where concurrent conflicting accesses are
11 * common, however, the current convention is to not mark them; returns true if
12 * access to @ptr should be considered atomic. Called from slow-path.
14 static bool kcsan_is_atomic_special(const volatile void *ptr)
16 /* volatile globals that have been observed in data races. */
17 return ptr == &jiffies || ptr == ¤t->state;
20 #endif /* _KERNEL_KCSAN_ATOMIC_H */