12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- #ifndef _KERNEL_KCSAN_PERMISSIVE_H
- #define _KERNEL_KCSAN_PERMISSIVE_H
- #include <linux/bitops.h>
- #include <linux/sched.h>
- #include <linux/types.h>
- static __always_inline bool kcsan_ignore_address(const volatile void *ptr)
- {
- if (!IS_ENABLED(CONFIG_KCSAN_PERMISSIVE))
- return false;
-
- return ptr == ¤t->flags;
- }
- static bool
- kcsan_ignore_data_race(size_t size, int type, u64 old, u64 new, u64 diff)
- {
- if (!IS_ENABLED(CONFIG_KCSAN_PERMISSIVE))
- return false;
-
- if (type || size > sizeof(long))
- return false;
-
- if (hweight64(diff) == 1) {
-
- if (!((!old || !new) && diff == 1))
- return true;
- }
- return false;
- }
- #endif
|