linux/Documentation/dev-tools
Marco Elver fe00f6e846 rcu: Support Clang's context analysis
Improve the existing annotations to properly support Clang's context
analysis.

The old annotations distinguished between RCU, RCU_BH, and RCU_SCHED;
however, to more easily be able to express that "hold the RCU read lock"
without caring if the normal, _bh(), or _sched() variant was used we'd
have to remove the distinction of the latter variants: change the _bh()
and _sched() variants to also acquire "RCU".

When (and if) we introduce context locks to denote more generally that
"IRQ", "BH", "PREEMPT" contexts are disabled, it would make sense to
acquire these instead of RCU_BH and RCU_SCHED respectively.

The above change also simplified introducing __guarded_by support, where
only the "RCU" context lock needs to be held: introduce __rcu_guarded,
where Clang's context analysis warns if a pointer is dereferenced
without any of the RCU locks held, or updated without the appropriate
helpers.

The primitives rcu_assign_pointer() and friends are wrapped with
context_unsafe(), which enforces using them to update RCU-protected
pointers marked with __rcu_guarded.

Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Link: https://patch.msgid.link/20251219154418.3592607-15-elver@google.com
2026-01-05 16:43:30 +01:00
..
kunit Documentation: kunit: add description of kunit.enable parameter 2025-10-27 11:16:09 -06:00
lkmm docs: dev-tools/lkmm: Fix typo of missing file extension 2025-09-21 16:22:09 -06:00
autofdo.rst Documentation: dev-tools: Fix a typo in autofdo documentation 2025-09-03 15:44:14 -06:00
checkpatch.rst There are no significant series in this small merge. Please see the 2025-12-13 20:55:12 +12:00
checkuapi.rst docs: dev-tools: Add UAPI checker documentation 2023-12-29 22:25:21 +09:00
clang-format.rst Docs: Move clang-format from process/ to dev-tools/ 2024-06-26 16:36:00 -06:00
coccinelle.rst kbuild: change working directory to external module directory with M= 2024-11-28 08:10:23 +09:00
context-analysis.rst rcu: Support Clang's context analysis 2026-01-05 16:43:30 +01:00
gcov.rst docs: gcov: fix link to LCOV website 2024-10-07 11:50:54 -06:00
gpio-sloppy-logic-analyzer.rst gpio: add sloppy logic analyzer using polling 2024-07-01 10:54:11 +02:00
index.rst Documentation: Add documentation for Compiler-Based Context Analysis 2026-01-05 16:43:27 +01:00
kasan.rst kasan/hw-tags: introduce kasan.write_only option 2025-09-21 14:22:10 -07:00
kcov.rst kcov: load acquire coverage count in user-space code 2025-09-13 17:32:44 -07:00
kcsan.rst Documentation: kcsan: fix "Plain Accesses and Data Races" URL in kcsan.rst 2025-03-12 16:34:55 -06:00
kfence.rst kfence: introduce burst mode 2024-09-01 20:26:03 -07:00
kmemleak.rst kmemleak: iommu/iova: fix transient kmemleak false positive 2024-11-11 17:22:26 -08:00
kmsan.rst docs/dev-tools: fix a typo 2024-10-17 09:39:19 -06:00
kselftest.rst printf: convert self-test to KUnit 2025-03-13 10:26:33 -07:00
ktap.rst Documentation: ktap: Separate first bullet list items 2025-08-18 10:28:44 -06:00
propeller.rst kbuild: Add Propeller configuration for kernel build 2024-11-27 09:38:27 +09:00
sparse.rst Documentation/sparse: add hints about __CHECKER__ 2022-03-23 19:00:33 -07:00
testing-devices.rst docs: dev-tools: Add documentation for the device focused kselftests 2024-10-14 16:15:13 -06:00
testing-overview.rst Documentation: dev-tools: Add link to RV docs 2024-03-29 08:27:21 -06:00
ubsan.rst ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL 2024-02-06 02:21:38 -08:00