Skip to content

Commit 9c827cd

Browse files
melverpaulmckrcu
authored andcommitted
kcsan: Print if strict or non-strict during init
Show a brief message if KCSAN is strict or non-strict, and if non-strict also say that CONFIG_KCSAN_STRICT=y can be used to see all data races. This is to hint to users of KCSAN who blindly use the default config that their configuration might miss data races of interest. 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>
1 parent 49f72d5 commit 9c827cd

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

kernel/kcsan/core.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,15 @@ void __init kcsan_init(void)
656656
pr_info("enabled early\n");
657657
WRITE_ONCE(kcsan_enabled, true);
658658
}
659+
660+
if (IS_ENABLED(CONFIG_KCSAN_REPORT_VALUE_CHANGE_ONLY) ||
661+
IS_ENABLED(CONFIG_KCSAN_ASSUME_PLAIN_WRITES_ATOMIC) ||
662+
IS_ENABLED(CONFIG_KCSAN_PERMISSIVE) ||
663+
IS_ENABLED(CONFIG_KCSAN_IGNORE_ATOMICS)) {
664+
pr_warn("non-strict mode configured - use CONFIG_KCSAN_STRICT=y to see all data races\n");
665+
} else {
666+
pr_info("strict mode configured\n");
667+
}
659668
}
660669

661670
/* === Exported interface =================================================== */

0 commit comments

Comments
 (0)