Re: [PATCH] livepatch: introduce klp_func called interface

2024-06-20 Thread Miroslav Benes
Hi, On Thu, 20 Jun 2024, zhang warden wrote: > > > > On Jun 7, 2024, at 17:07, Miroslav Benes wrote: > > > > It would be better than this patch but given what was mentioned in the > > thread I wonder if it is possible to use ftrace even for this. See > >

Re: [PATCH] livepatch: introduce klp_func called interface

2024-06-19 Thread zhang warden
> On Jun 7, 2024, at 17:07, Miroslav Benes wrote: > > It would be better than this patch but given what was mentioned in the > thread I wonder if it is possible to use ftrace even for this. See > /sys/kernel/tracing/trace_stat/function*. It already gathers the number of > hits. > Hi,

Re: [PATCH] livepatch: introduce klp_func called interface

2024-06-10 Thread zhang warden
> We don't have very urgent use for this. As we discussed, various tracing > tools are sufficient in most cases. I brought this up in the context of the > "called" entry: if we are really adding a new entry, let's do "counter" > instead of "called". > > Thanks, > Song Hi, Song I hope to find

Re: [PATCH] livepatch: introduce klp_func called interface

2024-06-07 Thread Song Liu
Hi Miroslav, On Fri, Jun 7, 2024 at 2:07 AM Miroslav Benes wrote: > > Hi, > > On Tue, 4 Jun 2024, Song Liu wrote: > > > On Tue, May 21, 2024 at 1:04 AM Petr Mladek wrote: > > [...] > > > > > > > > Yes, but the information you get is limited compared to what is > > > > available > > > > now.

Re: [PATCH] livepatch: introduce klp_func called interface

2024-06-07 Thread Miroslav Benes
Hi, On Tue, 4 Jun 2024, Song Liu wrote: > On Tue, May 21, 2024 at 1:04 AM Petr Mladek wrote: > [...] > > > > > > Yes, but the information you get is limited compared to what is available > > > now. You would obtain the information that a patched function was called > > > but ftrace could also

Re: [PATCH] livepatch: introduce klp_func called interface

2024-06-06 Thread zhang warden
> On Jun 6, 2024, at 23:01, Joe Lawrence wrote: > > Hi Wardenjohn, > > To follow up, Red Hat kpatch QE pointed me toward this test: > > https://gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/tree/main/general/kpatch/kpatch-trace?ref_type=heads > > which reports a few

Re: [PATCH] livepatch: introduce klp_func called interface

2024-06-06 Thread Joe Lawrence
Hi Wardenjohn, To follow up, Red Hat kpatch QE pointed me toward this test: https://gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/tree/main/general/kpatch/kpatch-trace?ref_type=heads which reports a few interesting things via systemd service and ftrace: - Patched functions -

Re: [PATCH] livepatch: introduce klp_func called interface

2024-06-04 Thread Song Liu
On Tue, May 21, 2024 at 1:04 AM Petr Mladek wrote: [...] > > > > Yes, but the information you get is limited compared to what is available > > now. You would obtain the information that a patched function was called > > but ftrace could also give you the context and more. > > Another motivation

Re: [PATCH] livepatch: introduce klp_func called interface

2024-06-04 Thread zhang warden
Hi Joe, > > Perhaps "responsibility" is a better description. This would introduce > an attribute that someone's userspace utility is relying on. It should > at least have a kselftest to ensure a random patch in 2027 doesn't break > it. I sent this patch to see the what the community thinks

Re: [PATCH] livepatch: introduce klp_func called interface

2024-06-04 Thread Joe Lawrence
On Tue, Jun 04, 2024 at 04:14:51PM +0800, zhang warden wrote: > > > > On Jun 1, 2024, at 03:16, Joe Lawrence wrote: > > > > Adding these attributes to livepatch sysfs would be expedient and > > probably easier for us to use, but imposes a recurring burden on us to > > maintain and test (where

Re: [PATCH] livepatch: introduce klp_func called interface

2024-06-04 Thread zhang warden
> My intention to introduce this attitude to sysfs is that user who what to see > if this function is called can just need to show this function attribute in > the livepatch sysfs interface. > Sorry bros, There is a typo in my word : attitude -> attribute Autocomplete make it wrong….lol..

Re: [PATCH] livepatch: introduce klp_func called interface

2024-06-04 Thread zhang warden
> On May 31, 2024, at 22:06, Miroslav Benes wrote: > >> And for the unlikely branch, isn’t the complier will compile this branch >> into a cold branch that will do no harm to the function performance? > > The test (cmp insn or something like that) still needs to be there. Since > there is

Re: [PATCH] livepatch: introduce klp_func called interface

2024-06-04 Thread zhang warden
> On Jun 1, 2024, at 03:16, Joe Lawrence wrote: > > Adding these attributes to livepatch sysfs would be expedient and > probably easier for us to use, but imposes a recurring burden on us to > maintain and test (where is the documentation and kselftest for this new > interface?). Or, we

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-31 Thread Joe Lawrence
On Tue, May 21, 2024 at 08:34:46AM +0200, Miroslav Benes wrote: > Hello, > > On Mon, 20 May 2024, zhang warden wrote: > > > > > > > > On May 20, 2024, at 14:46, Miroslav Benes wrote: > > > > > > Hi, > > > > > > On Mon, 20 May 2024, Wardenjohn wrote: > > > > > >> Livepatch module usually

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-31 Thread Miroslav Benes
> And for the unlikely branch, isn’t the complier will compile this branch > into a cold branch that will do no harm to the function performance? The test (cmp insn or something like that) still needs to be there. Since there is only a simple assignment in the branch, the compiler may just

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-31 Thread zhang warden
> On May 31, 2024, at 15:21, Miroslav Benes wrote: > > Hi, > > On Fri, 31 May 2024, zhang warden wrote: > > you have not replied to my questions/feedback yet. > > Also, I do not think that unlikely changes anything here. It is a simple > branch after all. > > Miroslav Hi Miroslav, Sorry

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-31 Thread Miroslav Benes
Hi, On Fri, 31 May 2024, zhang warden wrote: > > Hi Bros, > > How about my patch? I do think it is a viable feature to show the state > of the patched function. If we add an unlikely branch test before we set > the 'called' state, once this function is called, there maybe no > negative

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-30 Thread zhang warden
Hi Bros, How about my patch? I do think it is a viable feature to show the state of the patched function. If we add an unlikely branch test before we set the 'called' state, once this function is called, there maybe no negative effect to the performance. Please give me some advice.

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-24 Thread zhang warden
> On May 23, 2024, at 22:22, Dan Carpenter wrote: > > Always run your patches through checkpatch. > > So this patch is so that testers can see if a function has been called? > Can you not get the same information from gcov or ftrace? > > There are style issues with the patch, but it's not

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-24 Thread zhang warden
> On May 21, 2024, at 16:04, Petr Mladek wrote: > > Another motivation to use ftrace for testing is that it does not > affect the performance in production. > > We should keep klp_ftrace_handler() as fast as possible so that we > could livepatch also performance sensitive functions. > How

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-23 Thread Dan Carpenter
On Sun, May 19, 2024 at 03:43:43PM +0800, Wardenjohn wrote: > Livepatch module usually used to modify kernel functions. > If the patched function have bug, it may cause serious result > such as kernel crash. > > This commit introduce a read only interface of livepatch > sysfs interface. If a

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-21 Thread Petr Mladek
On Tue 2024-05-21 08:34:46, Miroslav Benes wrote: > Hello, > > On Mon, 20 May 2024, zhang warden wrote: > > > > > > > > On May 20, 2024, at 14:46, Miroslav Benes wrote: > > > > > > Hi, > > > > > > On Mon, 20 May 2024, Wardenjohn wrote: > > > > > >> Livepatch module usually used to modify

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-21 Thread Miroslav Benes
Hello, On Mon, 20 May 2024, zhang warden wrote: > > > > On May 20, 2024, at 14:46, Miroslav Benes wrote: > > > > Hi, > > > > On Mon, 20 May 2024, Wardenjohn wrote: > > > >> Livepatch module usually used to modify kernel functions. > >> If the patched function have bug, it may cause serious

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-20 Thread zhang warden
OK, I will try to optimize my description after the patch is reviewed. I am sure there are something still need to be fix for that patch. > On May 20, 2024, at 16:00, Markus Elfring wrote: > > Please add a version identifier to the message subject. > > > … >> If the patched function have

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-20 Thread Markus Elfring
Please add a version identifier to the message subject. … > If the patched function have bug, it may cause serious result > such as kernel crash. Wording suggestion: If the patched function has a bug, it might cause serious side effects like a kernel crash. > This is a kobject

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-20 Thread zhang warden
> On May 20, 2024, at 14:46, Miroslav Benes wrote: > > Hi, > > On Mon, 20 May 2024, Wardenjohn wrote: > >> Livepatch module usually used to modify kernel functions. >> If the patched function have bug, it may cause serious result >> such as kernel crash. >> >> This is a kobject attribute

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-20 Thread Miroslav Benes
Hi, On Mon, 20 May 2024, Wardenjohn wrote: > Livepatch module usually used to modify kernel functions. > If the patched function have bug, it may cause serious result > such as kernel crash. > > This is a kobject attribute of klp_func. Sysfs interface named > "called" is introduced to

[PATCH] livepatch: introduce klp_func called interface

2024-05-19 Thread Wardenjohn
Livepatch module usually used to modify kernel functions. If the patched function have bug, it may cause serious result such as kernel crash. This is a kobject attribute of klp_func. Sysfs interface named "called" is introduced to livepatch which will be set as true if the patched function is

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-19 Thread zhang warden
OK, I will optimize my patch’s changelog in my next patch. > On May 20, 2024, at 02:05, Markus Elfring wrote: > > I suggest to take preferred line lengths better into account > also for such a change description.

Re: [PATCH] livepatch: introduce klp_func called interface

2024-05-19 Thread Markus Elfring
… > This commit introduce a read only interface of livepatch Please improve the changelog with an imperative wording. … > find out which function is successfully called. Any testing process can make > sure they > have successfully cover all the patched function that changed with the help > of

[PATCH] livepatch: introduce klp_func called interface

2024-05-19 Thread Wardenjohn
Livepatch module usually used to modify kernel functions. If the patched function have bug, it may cause serious result such as kernel crash. This commit introduce a read only interface of livepatch sysfs interface. If a livepatch function is called, this sysfs interface "called" of the patched