]> git.baikalelectronics.ru Git - kernel.git/commit
kcsan: Introduce scoped ASSERT_EXCLUSIVE macros
authorMarco Elver <elver@google.com>
Wed, 25 Mar 2020 16:41:58 +0000 (17:41 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 14 Apr 2020 00:18:13 +0000 (17:18 -0700)
commitc390782e2ef9ec50014022d52c7667946d5b5ca3
tree1f24321c498bf83bc5784d0fe5694737838f961d
parent56b47aadf595d0f3a2202ceb480b77ef963e643b
kcsan: Introduce scoped ASSERT_EXCLUSIVE macros

Introduce ASSERT_EXCLUSIVE_*_SCOPED(), which provide an intuitive
interface to use the scoped-access feature, without having to explicitly
mark the start and end of the desired scope. Basing duration of the
checks on scope avoids accidental misuse and resulting false positives,
which may be hard to debug. See added comments for usage.

The macros are implemented using __attribute__((__cleanup__(func))),
which is supported by all compilers that currently support KCSAN.

Suggested-by: Boqun Feng <boqun.feng@gmail.com>
Suggested-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Documentation/dev-tools/kcsan.rst
include/linux/kcsan-checks.h
kernel/kcsan/debugfs.c