Re: [PATCH v2 1/1] livepatch: Add using attribute to klp_func for using function show

2024-08-15 Thread Petr Mladek
On Wed 2024-08-14 22:23:21, zhang warden wrote: > > > > On Aug 14, 2024, at 00:05, Petr Mladek wrote: > > > > Alternative solution would be to store the pointer of struct klp_ops > > *ops into struct klp_func. Then using_show() could just check if > > the related struct klp_func in on top of th

Re: [PATCH v2 1/1] livepatch: Add using attribute to klp_func for using function show

2024-08-14 Thread zhang warden
> On Aug 14, 2024, at 00:05, Petr Mladek wrote: > > Alternative solution would be to store the pointer of struct klp_ops > *ops into struct klp_func. Then using_show() could just check if > the related struct klp_func in on top of the stack. > > It would allow to remove the global list klp_op

Re: [PATCH v2 1/1] livepatch: Add using attribute to klp_func for using function show

2024-08-13 Thread zhang warden
> The search would need more code. But it would be simple and > straightforward. We do this many times all over the code. > > IMHO, it would actually remove some complexity and be a win-win solution. > > Best Regards, > Petr Hi Petr! Thank you for taking the time to review my patch. I will u

Re: [PATCH v2 1/1] livepatch: Add using attribute to klp_func for using function show

2024-08-13 Thread Petr Mladek
On Mon 2024-08-05 14:46:56, zhangyongde.zyd wrote: > From: Wardenjohn > > One system may contains more than one livepatch module. We can see > which patch is enabled. If some patches applied to one system > modifing the same function, livepatch will use the function enabled > on top of the functi

Re: [PATCH v2 1/1] livepatch: Add using attribute to klp_func for using function show

2024-08-12 Thread zhang warden
> On Aug 5, 2024, at 14:46, zhangyongde.zyd wrote: > > From: Wardenjohn > > One system may contains more than one livepatch module. We can see > which patch is enabled. If some patches applied to one system > modifing the same function, livepatch will use the function enabled > on top of the

Re: [PATCH v2 1/1] livepatch: Add using attribute to klp_func for using function show

2024-08-06 Thread zhang warden
> On Aug 5, 2024, at 14:46, zhangyongde.zyd wrote: > > From: Wardenjohn > > > static void klp_init_func_early(struct klp_object *obj, > struct klp_func *func) > { > + func->using = false; > kobject_init(&func->kobj, &klp_ktype_func); > list_add_tail(&func->node, &obj->func_list); > } I rev

[PATCH v2 1/1] livepatch: Add using attribute to klp_func for using function show

2024-08-04 Thread zhangyongde.zyd
From: Wardenjohn One system may contains more than one livepatch module. We can see which patch is enabled. If some patches applied to one system modifing the same function, livepatch will use the function enabled on top of the function stack. However, we can not excatly know which function of wh