From: Yafang Shao Date: Thu, 27 Feb 2025 02:47:32 +0000 (+0800) Subject: livepatch: Add comment to clarify klp_add_nops() X-Git-Tag: v6.15-rc1~135^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=376c879e04fc7abec617bc6897479acd0b605f8c;p=thirdparty%2Fkernel%2Flinux.git 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 Suggested-by: Josh Poimboeuf Signed-off-by: Yafang Shao Reviewed-by: Petr Mladek Link: https://lore.kernel.org/r/20250227024733.16989-2-laoar.shao@gmail.com Signed-off-by: Petr Mladek --- diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index 0cd39954d5a10..4a0fb7978d0df 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c @@ -601,9 +601,12 @@ static int klp_add_object_nops(struct klp_patch *patch, } /* - * Add 'nop' functions which simply return to the caller to run - * the original function. The 'nop' functions are added to a - * patch to facilitate a 'replace' mode. + * Add 'nop' functions which simply return to the caller to run the + * original function. + * + * They are added only when the atomic replace mode is used and only for + * functions which are currently livepatched but are no longer included + * in the new livepatch. */ static int klp_add_nops(struct klp_patch *patch) {