Skip to content

Commit 372e2db

Browse files
mirabJiri Kosina
authored andcommitted
livepatch: doc: remove the limitation for schedule() patching
The Limitations section of the documentation describes the impossibility to livepatch anything that is inlined to __schedule() function. This had been true till 4.9 kernel came. Thanks to commit 0100301 ("sched/x86: Rewrite the switch_to() code") from Brian Gerst there is __switch_to_asm function now (implemented in assembly) called properly from context_switch(). RIP is thus saved on the stack and a task would return to proper version of __schedule() et al. functions. Of course __switch_to_asm() is not patchable for the reason described in the section. But there is no __fentry__ call and I cannot imagine a reason to do it anyway. Therefore, remove the paragraphs from the section. Signed-off-by: Miroslav Benes <mbenes@suse.cz> Reviewed-by: Petr Mladek <pmladek@suse.com> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent b766922 commit 372e2db

1 file changed

Lines changed: 0 additions & 19 deletions

File tree

‎Documentation/livepatch/livepatch.txt‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -329,25 +329,6 @@ The current Livepatch implementation has several limitations:
329329
by "notrace".
330330

331331

332-
+ Anything inlined into __schedule() can not be patched.
333-
334-
The switch_to macro is inlined into __schedule(). It switches the
335-
context between two processes in the middle of the macro. It does
336-
not save RIP in x86_64 version (contrary to 32-bit version). Instead,
337-
the currently used __schedule()/switch_to() handles both processes.
338-
339-
Now, let's have two different tasks. One calls the original
340-
__schedule(), its registers are stored in a defined order and it
341-
goes to sleep in the switch_to macro and some other task is restored
342-
using the original __schedule(). Then there is the second task which
343-
calls patched__schedule(), it goes to sleep there and the first task
344-
is picked by the patched__schedule(). Its RSP is restored and now
345-
the registers should be restored as well. But the order is different
346-
in the new patched__schedule(), so...
347-
348-
There is work in progress to remove this limitation.
349-
350-
351332
+ Livepatch modules can not be removed.
352333

353334
The current implementation just redirects the functions at the very

0 commit comments

Comments
 (0)