[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <7F83CD32-3965-4F15-B4FA-44503EF6EA9D@gmail.com>
Date: Fri, 6 Sep 2024 17:44:26 +0800
From: zhang warden <zhangwarden@...il.com>
To: Miroslav Benes <mbenes@...e.cz>
Cc: Josh Poimboeuf <jpoimboe@...nel.org>,
Jiri Kosina <jikos@...nel.org>,
Petr Mladek <pmladek@...e.com>,
Joe Lawrence <joe.lawrence@...hat.com>,
live-patching@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/2] Introduce klp_ops into klp_func structure
Hi Miroslav
>
> node member. You removed the global list, hence this member is not needed
> anymore.
OK, I got it.
>
>>>
>>>> + struct list_head func_stack;
>>>> + struct ftrace_ops fops;
>>>> +};
>>>> +
>>>>
>>>> diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
>>>> index 52426665eecc..e4572bf34316 100644
>>>> --- a/kernel/livepatch/core.c
>>>> +++ b/kernel/livepatch/core.c
>>>> @@ -760,6 +760,8 @@ static int klp_init_func(struct klp_object *obj, struct klp_func *func)
>>>> if (!func->old_name)
>>>> return -EINVAL;
>>>>
>>>> + func->ops = NULL;
>>>> +
>>>
>>> Any reason why it is not added a couple of lines later alongside the rest
>>> of the initialization?
>>
>> Do you mean I should add couple of lines after 'return -EINVAL' ?
>
> No, I am asking if there is a reason why you added 'func->ops = NULL;'
> here and not right after the rest of func initializations
>
> INIT_LIST_HEAD(&func->stack_node);
> func->patched = false;
> func->transition = false;
>
Hah... it just my habit to do so. Will fix it later.
>>
>> Maybe there still other places will call this klp_find_ops? Is it safe to delete it?
>
> If you have no other plans with it, then it can be removed since there is
> no user after the patch.
>
> Wardenjohn, you should then get all the information that you need. Also,
> please test your patches with livepatch kselftests before a submission
> next time. New sysfs attributes need to be documented in
> Documentation/ABI/testing/sysfs-kernel-livepatch and there should be a new
> kselftest for them.
OK, will do it.
Regards.
Wardenjohn.
Powered by blists - more mailing lists