^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) # SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) config HAVE_ARCH_KCSAN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) config HAVE_KCSAN_COMPILER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) def_bool (CC_IS_CLANG && $(cc-option,-fsanitize=thread -mllvm -tsan-distinguish-volatile=1)) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) (CC_IS_GCC && $(cc-option,-fsanitize=thread --param tsan-distinguish-volatile=1))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) For the list of compilers that support KCSAN, please see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) <file:Documentation/dev-tools/kcsan.rst>.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) config KCSAN_KCOV_BROKEN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) def_bool KCOV && CC_HAS_SANCOV_TRACE_PC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) depends on CC_IS_CLANG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) depends on !$(cc-option,-Werror=unused-command-line-argument -fsanitize=thread -fsanitize-coverage=trace-pc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) Some versions of clang support either KCSAN and KCOV but not the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) combination of the two.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) See https://bugs.llvm.org/show_bug.cgi?id=45831 for the status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) in newer releases.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) menuconfig KCSAN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) bool "KCSAN: dynamic data race detector"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) depends on HAVE_ARCH_KCSAN && HAVE_KCSAN_COMPILER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) depends on DEBUG_KERNEL && !KASAN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) depends on !KCSAN_KCOV_BROKEN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) select STACKTRACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) The Kernel Concurrency Sanitizer (KCSAN) is a dynamic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) data-race detector that relies on compile-time instrumentation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) KCSAN uses a watchpoint-based sampling approach to detect races.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) While KCSAN's primary purpose is to detect data races, it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) also provides assertions to check data access constraints.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) These assertions can expose bugs that do not manifest as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) data races.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) See <file:Documentation/dev-tools/kcsan.rst> for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) if KCSAN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) # Compiler capabilities that should not fail the test if they are unavailable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) config CC_HAS_TSAN_COMPOUND_READ_BEFORE_WRITE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) def_bool (CC_IS_CLANG && $(cc-option,-fsanitize=thread -mllvm -tsan-compound-read-before-write=1)) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) (CC_IS_GCC && $(cc-option,-fsanitize=thread --param tsan-compound-read-before-write=1))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) config KCSAN_VERBOSE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) bool "Show verbose reports with more information about system state"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) depends on PROVE_LOCKING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) If enabled, reports show more information about the system state that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) may help better analyze and debug races. This includes held locks and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) IRQ trace events.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) While this option should generally be benign, we call into more
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) external functions on report generation; if a race report is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) generated from any one of them, system stability may suffer due to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) deadlocks or recursion. If in doubt, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) config KCSAN_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) bool "Debugging of KCSAN internals"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) config KCSAN_SELFTEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) bool "Perform short selftests on boot"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) Run KCSAN selftests on boot. On test failure, causes the kernel to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) panic. Recommended to be enabled, ensuring critical functionality
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) works as intended.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) config KCSAN_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) tristate "KCSAN test for integrated runtime behaviour"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) depends on TRACEPOINTS && KUNIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) select TORTURE_TEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) KCSAN test focusing on behaviour of the integrated runtime. Tests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) various race scenarios, and verifies the reports generated to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) console. Makes use of KUnit for test organization, and the Torture
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) framework for test thread control.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) Each test case may run at least up to KCSAN_REPORT_ONCE_IN_MS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) milliseconds. Test run duration may be optimized by building the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) kernel and KCSAN test with KCSAN_REPORT_ONCE_IN_MS set to a lower
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) than default value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) Say Y here if you want the test to be built into the kernel and run
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) during boot; say M if you want the test to build as a module; say N
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) if you are unsure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) config KCSAN_EARLY_ENABLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) bool "Early enable during boot"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) If KCSAN should be enabled globally as soon as possible. KCSAN can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) later be enabled/disabled via debugfs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) config KCSAN_NUM_WATCHPOINTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) int "Number of available watchpoints"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) default 64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) Total number of available watchpoints. An address range maps into a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) specific watchpoint slot as specified in kernel/kcsan/encoding.h.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) Although larger number of watchpoints may not be usable due to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) limited number of CPUs, a larger value helps to improve performance
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) due to reducing cache-line contention. The chosen default is a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) conservative value; we should almost never observe "no_capacity"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) events (see /sys/kernel/debug/kcsan).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) config KCSAN_UDELAY_TASK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) int "Delay in microseconds (for tasks)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) default 80
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) For tasks, the microsecond delay after setting up a watchpoint.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) config KCSAN_UDELAY_INTERRUPT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) int "Delay in microseconds (for interrupts)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) default 20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) For interrupts, the microsecond delay after setting up a watchpoint.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) Interrupts have tighter latency requirements, and their delay should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) be lower than for tasks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) config KCSAN_DELAY_RANDOMIZE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) bool "Randomize above delays"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) If delays should be randomized, where the maximum is KCSAN_UDELAY_*.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) If false, the chosen delays are always the KCSAN_UDELAY_* values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) as defined above.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) config KCSAN_SKIP_WATCH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) int "Skip instructions before setting up watchpoint"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) default 4000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) The number of per-CPU memory operations to skip, before another
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) watchpoint is set up, i.e. one in KCSAN_WATCH_SKIP per-CPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) memory operations are used to set up a watchpoint. A smaller value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) results in more aggressive race detection, whereas a larger value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) improves system performance at the cost of missing some races.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) config KCSAN_SKIP_WATCH_RANDOMIZE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) bool "Randomize watchpoint instruction skip count"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) If instruction skip count should be randomized, where the maximum is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) KCSAN_WATCH_SKIP. If false, the chosen value is always
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) KCSAN_WATCH_SKIP.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) config KCSAN_INTERRUPT_WATCHER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) bool "Interruptible watchers"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) If enabled, a task that set up a watchpoint may be interrupted while
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) delayed. This option will allow KCSAN to detect races between
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) interrupted tasks and other threads of execution on the same CPU.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) Currently disabled by default, because not all safe per-CPU access
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) primitives and patterns may be accounted for, and therefore could
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) result in false positives.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) config KCSAN_REPORT_ONCE_IN_MS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) int "Duration in milliseconds, in which any given race is only reported once"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) default 3000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) Any given race is only reported once in the defined time window.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) Different races may still generate reports within a duration that is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) smaller than the duration defined here. This allows rate limiting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) reporting to avoid flooding the console with reports. Setting this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) to 0 disables rate limiting.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) # The main purpose of the below options is to control reported data races (e.g.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) # in fuzzer configs), and are not expected to be switched frequently by other
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) # users. We could turn some of them into boot parameters, but given they should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) # not be switched normally, let's keep them here to simplify configuration.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) # The defaults below are chosen to be very conservative, and may miss certain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) # bugs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) config KCSAN_REPORT_RACE_UNKNOWN_ORIGIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) bool "Report races of unknown origin"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) If KCSAN should report races where only one access is known, and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) conflicting access is of unknown origin. This type of race is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) reported if it was only possible to infer a race due to a data value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) change while an access is being delayed on a watchpoint.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) config KCSAN_REPORT_VALUE_CHANGE_ONLY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) bool "Only report races where watcher observed a data value change"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) If enabled and a conflicting write is observed via a watchpoint, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) the data value of the memory location was observed to remain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) unchanged, do not report the data race.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) config KCSAN_ASSUME_PLAIN_WRITES_ATOMIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) bool "Assume that plain aligned writes up to word size are atomic"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) Assume that plain aligned writes up to word size are atomic by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) default, and also not subject to other unsafe compiler optimizations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) resulting in data races. This will cause KCSAN to not report data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) races due to conflicts where the only plain accesses are aligned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) writes up to word size: conflicts between marked reads and plain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) aligned writes up to word size will not be reported as data races;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) notice that data races between two conflicting plain aligned writes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) will also not be reported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) config KCSAN_IGNORE_ATOMICS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) bool "Do not instrument marked atomic accesses"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) Never instrument marked atomic accesses. This option can be used for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) additional filtering. Conflicting marked atomic reads and plain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) writes will never be reported as a data race, however, will cause
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) plain reads and marked writes to result in "unknown origin" reports.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) If combined with CONFIG_KCSAN_REPORT_RACE_UNKNOWN_ORIGIN=n, data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) races where at least one access is marked atomic will never be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) reported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) Similar to KCSAN_ASSUME_PLAIN_WRITES_ATOMIC, but including unaligned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) accesses, conflicting marked atomic reads and plain writes will not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) be reported as data races; however, unlike that option, data races
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) due to two conflicting plain writes will be reported (aligned and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) unaligned, if CONFIG_KCSAN_ASSUME_PLAIN_WRITES_ATOMIC=n).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) endif # KCSAN