*** Rename KLP_* to KLP_TRANSITION_* ***
cover *** Rename KLP_* to KLP_TRANSITION_* ***
From: Wardenjohn <[email protected]>
This is the v3 of commit " livepatch: Rename KLP_* to KLP_TRANSITION_* " with the suggestion of @Josh
v1 -> v2 :
Use KLP_TRANSITION_* to replace marcos KLP_*
v2 -> v3 :
Remove the unnecessary comment and fix one typo in the code.
Wardenjohn (1):
livepatch: Rename KLP_* to KLP_TRANSITION_*
include/linux/livepatch.h | 6 ++-- init/init_task.c | 2 +- kernel/livepatch/core.c | 4 +-- kernel/livepatch/patch.c | 4 +-- kernel/livepatch/transition.c | 54 +++++++++++++++++------------------ 5 files changed, 35 insertions(+), 35 deletions(-)
Signature · 1 line
2.37.3
PATCH 1/1 livepatch: Rename KLP_* to KLP_TRANSITION_*
From: Wardenjohn <[email protected]>
The original macros of KLP_* is about the state of the transition. Rename macros of KLP_* to KLP_TRANSITION_* to fix the confusing description of klp transition state.
--- include/linux/livepatch.h | 6 ++-- init/init_task.c | 2 +- kernel/livepatch/core.c | 4 +-- kernel/livepatch/patch.c | 4 +-- kernel/livepatch/transition.c | 54 +++++++++++++++++------------------ 5 files changed, 35 insertions(+), 35 deletions(-)
include/linux/livepatch.h +3 -3
@@ -18,9 +18,9 @@#if IS_ENABLED (CONFIG_LIVEPATCH )/* task patch states */ -#define KLP_UNDEFINED -1 -#define KLP_UNPATCHED 0 -#define KLP_PATCHED 1 +#define KLP_TRANSITION_IDLE -1 +#define KLP_TRANSITION_UNPATCHED 0 +#define KLP_TRANSITION_PATCHED 1/** * struct klp_func - function structure for live patching
init/init_task.c +1 -1
@@ -199,7 +199,7 @@ struct task_struct init_task __aligned(L1_CACHE_BYTES) = { .trace_recursion = 0,#endif #ifdef CONFIG_LIVEPATCH - .patch_state = KLP_UNDEFINED, + .patch_state = KLP_TRANSITION_IDLE,#endif #ifdef CONFIG_SECURITY .security = NULL,
kernel/livepatch/core.c +2 -2
@@ -973,7 +973,7 @@ static int __klp_disable_patch(struct klp_patch *patch)if (klp_transition_patch)return -EBUSY ; -klp_init_transition (patch,KLP_UNPATCHED ); +klp_init_transition (patch,KLP_TRANSITION_UNPATCHED );klp_for_each_object (patch, obj)if (obj->patched)
@@ -1008,7 +1008,7 @@ static int __klp_enable_patch(struct klp_patch *patch)pr_notice ("enabling patch '%s'\n" , patch->mod->name); -klp_init_transition (patch,KLP_PATCHED ); +klp_init_transition (patch,KLP_TRANSITION_PATCHED );/* * Enforce the order of the func->transition writes in
kernel/livepatch/patch.c +2 -2
@@ -95,9 +95,9 @@ static void notrace klp_ftrace_handler(unsigned long ip, patch_state = current->patch_state; -WARN_ON_ONCE (patch_state ==KLP_UNDEFINED ); +WARN_ON_ONCE (patch_state ==KLP_TRANSITION_IDLE ); -if (patch_state ==KLP_UNPATCHED ) { +if (patch_state ==KLP_TRANSITION_UNPATCHED ) {/* * Use the previously patched version of the function. * If no previous patches exist, continue with the
kernel/livepatch/transition.c +27 -27
178 lines not on this page · raw message
Signature · 1 line
2.37.3
Re: [PATCH 1/1] livepatch: Rename KLP_* to KLP_TRANSITION_*
Quoted 7 lines · On Tue 2024-05-07 13:01:11, [email protected] wrote:
From: Wardenjohn <[email protected]>
The original macros of KLP_* is about the state of the transition. Rename macros of KLP_* to KLP_TRANSITION_* to fix the confusing description of klp transition state.
Signed-off-by Wardenjohn <[email protected]>
Looks good to me:
Best Regards,
Petr
Re: [PATCH 1/1] livepatch: Rename KLP_* to KLP_TRANSITION_*
In reply to [email protected]Quoted 7 lines · On Tue, May 07, 2024 at 01:01:11PM +0800, [email protected] wrote:
From: Wardenjohn <[email protected]>
The original macros of KLP_* is about the state of the transition. Rename macros of KLP_* to KLP_TRANSITION_* to fix the confusing description of klp transition state.
Signed-off-by Wardenjohn <[email protected]>
Signature · 1 line
Josh
Re: [PATCH 1/1] livepatch: Rename KLP_* to KLP_TRANSITION_*
In reply to [email protected]Quoted 7 lines · On Tue, 7 May 2024, [email protected] wrote:
From: Wardenjohn <[email protected]>
The original macros of KLP_* is about the state of the transition. Rename macros of KLP_* to KLP_TRANSITION_* to fix the confusing description of klp transition state.
Signed-off-by Wardenjohn <[email protected]>
M
Petr Mladek
maintainerRe: [PATCH 1/1] livepatch: Rename KLP_* to KLP_TRANSITION_*
In reply to [email protected]Quoted 7 lines · On Tue 2024-05-07 13:01:11, [email protected] wrote:
From: Wardenjohn <[email protected]>
The original macros of KLP_* is about the state of the transition. Rename macros of KLP_* to KLP_TRANSITION_* to fix the confusing description of klp transition state.
Signed-off-by Wardenjohn <[email protected]>
JFYI, the patch has been comitted into livepatching.git, branch for-10.
Best regards,
Petr