]> git.baikalelectronics.ru Git - kernel.git/commit
kcsan: Add option to allow watcher interruptions
authorMarco Elver <elver@google.com>
Fri, 21 Feb 2020 22:02:09 +0000 (23:02 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 25 Mar 2020 16:55:59 +0000 (09:55 -0700)
commit73ab6f05936a6dc0d4c5377388900f7cb32e3230
tree6b3408d62d095a068afc089cfbfd3f98d73cfaa5
parentef08c4d18826fc30c8d2282ada3a530cbe60c3d3
kcsan: Add option to allow watcher interruptions

Add option to allow interrupts while a watchpoint is set up. This can be
enabled either via CONFIG_KCSAN_INTERRUPT_WATCHER or via the boot
parameter 'kcsan.interrupt_watcher=1'.

Note that, currently not all safe per-CPU access primitives and patterns
are accounted for, which could result in false positives. For example,
asm-generic/percpu.h uses plain operations, which by default are
instrumented. On interrupts and subsequent accesses to the same
variable, KCSAN would currently report a data race with this option.

Therefore, this option should currently remain disabled by default, but
may be enabled for specific test scenarios.

To avoid new warnings, changes all uses of smp_processor_id() to use the
raw version (as already done in kcsan_found_watchpoint()). The exact SMP
processor id is for informational purposes in the report, and
correctness is not affected.

Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/kcsan/core.c
lib/Kconfig.kcsan