Skip to content

Commit d93d97c

Browse files
committed
doc: Tasks RCU must protect instructions before trampoline
Protecting the code in a trampoline can also require protecting a number of instructions prior to actually entering the trampoline. For example, these earlier instructions might be computing the address of the trampoline. This commit therefore updates RCU's requirements to record this for posterity. Link: https://lore.kernel.org/lkml/[email protected]/ Reported-by: Lai Jiangshan <[email protected]> Reported-by: Steven Rostedt <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent b81898e commit d93d97c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Documentation/RCU/Design/Requirements/Requirements.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2583,7 +2583,12 @@ not work to have these markers in the trampoline itself, because there
25832583
would need to be instructions following ``rcu_read_unlock()``. Although
25842584
``synchronize_rcu()`` would guarantee that execution reached the
25852585
``rcu_read_unlock()``, it would not be able to guarantee that execution
2586-
had completely left the trampoline.
2586+
had completely left the trampoline. Worse yet, in some situations
2587+
the trampoline's protection must extend a few instructions *prior* to
2588+
execution reaching the trampoline. For example, these few instructions
2589+
might calculate the address of the trampoline, so that entering the
2590+
trampoline would be pre-ordained a surprisingly long time before execution
2591+
actually reached the trampoline itself.
25872592

25882593
The solution, in the form of `Tasks
25892594
RCU <https://lwn.net/Articles/607117/>`__, is to have implicit read-side

0 commit comments

Comments
 (0)