Skip to content

Commit 376c879

Browse files
laoarpmladek
authored andcommitted
livepatch: Add comment to clarify klp_add_nops()
Add detailed comments to clarify the purpose of klp_add_nops() function. These comments are based on Petr's explanation[0]. Link: https://lore.kernel.org/all/Z6XUA7D0eU_YDMVp@pathway.suse.cz/ [0] Suggested-by: Petr Mladek <pmladek@suse.com> Suggested-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Yafang Shao <laoar.shao@gmail.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20250227024733.16989-2-laoar.shao@gmail.com Signed-off-by: Petr Mladek <pmladek@suse.com>
1 parent 3360882 commit 376c879

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

kernel/livepatch/core.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,9 +601,12 @@ static int klp_add_object_nops(struct klp_patch *patch,
601601
}
602602

603603
/*
604-
* Add 'nop' functions which simply return to the caller to run
605-
* the original function. The 'nop' functions are added to a
606-
* patch to facilitate a 'replace' mode.
604+
* Add 'nop' functions which simply return to the caller to run the
605+
* original function.
606+
*
607+
* They are added only when the atomic replace mode is used and only for
608+
* functions which are currently livepatched but are no longer included
609+
* in the new livepatch.
607610
*/
608611
static int klp_add_nops(struct klp_patch *patch)
609612
{

0 commit comments

Comments
 (0)