mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
kcsan: Introduce CONFIG_KCSAN_STRICT
Add a simpler Kconfig variable to configure KCSAN's "strict" mode. This makes it simpler in documentation or messages to suggest just a single configuration option to select the strictest checking mode (vs. currently having to list several options). Signed-off-by: Marco Elver <elver@google.com> Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
committed by
Paul E. McKenney
parent
a7a7369736
commit
e675d2533a
@@ -127,6 +127,10 @@ Kconfig options:
|
|||||||
causes KCSAN to not report data races due to conflicts where the only plain
|
causes KCSAN to not report data races due to conflicts where the only plain
|
||||||
accesses are aligned writes up to word size.
|
accesses are aligned writes up to word size.
|
||||||
|
|
||||||
|
To use the strictest possible rules, select ``CONFIG_KCSAN_STRICT=y``, which
|
||||||
|
configures KCSAN to follow the Linux-kernel memory consistency model (LKMM) as
|
||||||
|
closely as possible.
|
||||||
|
|
||||||
DebugFS interface
|
DebugFS interface
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@@ -183,9 +183,17 @@ config KCSAN_REPORT_RACE_UNKNOWN_ORIGIN
|
|||||||
reported if it was only possible to infer a race due to a data value
|
reported if it was only possible to infer a race due to a data value
|
||||||
change while an access is being delayed on a watchpoint.
|
change while an access is being delayed on a watchpoint.
|
||||||
|
|
||||||
|
config KCSAN_STRICT
|
||||||
|
bool "Strict data-race checking"
|
||||||
|
help
|
||||||
|
KCSAN will report data races with the strictest possible rules, which
|
||||||
|
closely aligns with the rules defined by the Linux-kernel memory
|
||||||
|
consistency model (LKMM).
|
||||||
|
|
||||||
config KCSAN_REPORT_VALUE_CHANGE_ONLY
|
config KCSAN_REPORT_VALUE_CHANGE_ONLY
|
||||||
bool "Only report races where watcher observed a data value change"
|
bool "Only report races where watcher observed a data value change"
|
||||||
default y
|
default y
|
||||||
|
depends on !KCSAN_STRICT
|
||||||
help
|
help
|
||||||
If enabled and a conflicting write is observed via a watchpoint, but
|
If enabled and a conflicting write is observed via a watchpoint, but
|
||||||
the data value of the memory location was observed to remain
|
the data value of the memory location was observed to remain
|
||||||
@@ -194,6 +202,7 @@ config KCSAN_REPORT_VALUE_CHANGE_ONLY
|
|||||||
config KCSAN_ASSUME_PLAIN_WRITES_ATOMIC
|
config KCSAN_ASSUME_PLAIN_WRITES_ATOMIC
|
||||||
bool "Assume that plain aligned writes up to word size are atomic"
|
bool "Assume that plain aligned writes up to word size are atomic"
|
||||||
default y
|
default y
|
||||||
|
depends on !KCSAN_STRICT
|
||||||
help
|
help
|
||||||
Assume that plain aligned writes up to word size are atomic by
|
Assume that plain aligned writes up to word size are atomic by
|
||||||
default, and also not subject to other unsafe compiler optimizations
|
default, and also not subject to other unsafe compiler optimizations
|
||||||
@@ -206,6 +215,7 @@ config KCSAN_ASSUME_PLAIN_WRITES_ATOMIC
|
|||||||
|
|
||||||
config KCSAN_IGNORE_ATOMICS
|
config KCSAN_IGNORE_ATOMICS
|
||||||
bool "Do not instrument marked atomic accesses"
|
bool "Do not instrument marked atomic accesses"
|
||||||
|
depends on !KCSAN_STRICT
|
||||||
help
|
help
|
||||||
Never instrument marked atomic accesses. This option can be used for
|
Never instrument marked atomic accesses. This option can be used for
|
||||||
additional filtering. Conflicting marked atomic reads and plain
|
additional filtering. Conflicting marked atomic reads and plain
|
||||||
|
Reference in New Issue
Block a user