Re: [PATCH v5 1/2] kprobes: textmem API

2024-03-26 Thread Jarkko Sakkinen
On Tue Mar 26, 2024 at 5:05 PM EET, Masami Hiramatsu (Google) wrote: > > According to kconfig-language.txt: > > > > "select should be used with care. select will force a symbol to a value > > without visiting the dependencies." > > > > So the problem here lies in KPROBES config entry using

Re: [PATCH v5 1/2] kprobes: textmem API

2024-03-26 Thread Google
On Tue, 26 Mar 2024 15:18:21 +0200 "Jarkko Sakkinen" wrote: > On Tue Mar 26, 2024 at 4:01 AM EET, Jarkko Sakkinen wrote: > > On Tue Mar 26, 2024 at 3:31 AM EET, Jarkko Sakkinen wrote: > > > > > +#endif /* _LINUX_EXECMEM_H */ > > > > > diff --git a/kernel/kprobes.c b/kernel/kprobes.c > > > > >

Re: [PATCH v5 1/2] kprobes: textmem API

2024-03-26 Thread Jarkko Sakkinen
On Tue Mar 26, 2024 at 4:01 AM EET, Jarkko Sakkinen wrote: > On Tue Mar 26, 2024 at 3:31 AM EET, Jarkko Sakkinen wrote: > > > > +#endif /* _LINUX_EXECMEM_H */ > > > > diff --git a/kernel/kprobes.c b/kernel/kprobes.c > > > > index 9d9095e81792..87fd8c14a938 100644 > > > > --- a/kernel/kprobes.c > >

Re: [PATCH v5 1/2] kprobes: textmem API

2024-03-25 Thread Jarkko Sakkinen
On Tue Mar 26, 2024 at 3:31 AM EET, Jarkko Sakkinen wrote: > > > +#endif /* _LINUX_EXECMEM_H */ > > > diff --git a/kernel/kprobes.c b/kernel/kprobes.c > > > index 9d9095e81792..87fd8c14a938 100644 > > > --- a/kernel/kprobes.c > > > +++ b/kernel/kprobes.c > > > @@ -44,6 +44,7 @@ > > > #include >

Re: [PATCH v5 1/2] kprobes: textmem API

2024-03-25 Thread Jarkko Sakkinen
On Tue Mar 26, 2024 at 2:58 AM EET, Masami Hiramatsu (Google) wrote: > On Mon, 25 Mar 2024 23:55:01 +0200 > Jarkko Sakkinen wrote: > > > Tracing with kprobes while running a monolithic kernel is currently > > impossible because CONFIG_KPROBES depends on CONFIG_MODULES because it uses > > the

Re: [PATCH v5 1/2] kprobes: textmem API

2024-03-25 Thread Google
On Mon, 25 Mar 2024 23:55:01 +0200 Jarkko Sakkinen wrote: > Tracing with kprobes while running a monolithic kernel is currently > impossible because CONFIG_KPROBES depends on CONFIG_MODULES because it uses > the kernel module allocator. > > Introduce alloc_textmem() and free_textmem() for

Re: [PATCH v5 1/2] kprobes: textmem API

2024-03-25 Thread Jarkko Sakkinen
On Tue Mar 26, 2024 at 1:50 AM EET, Masami Hiramatsu (Google) wrote: > On Tue, 26 Mar 2024 00:09:42 +0200 > "Jarkko Sakkinen" wrote: > > > On Mon Mar 25, 2024 at 11:55 PM EET, Jarkko Sakkinen wrote: > > > +#ifdef CONFIG_MODULES > > > if (register_module_notifier(_kprobe_module_nb)) > > >

Re: [PATCH v5 1/2] kprobes: textmem API

2024-03-25 Thread Google
On Tue, 26 Mar 2024 00:09:42 +0200 "Jarkko Sakkinen" wrote: > On Mon Mar 25, 2024 at 11:55 PM EET, Jarkko Sakkinen wrote: > > +#ifdef CONFIG_MODULES > > if (register_module_notifier(_kprobe_module_nb)) > > return -EINVAL; > > +#endif /* CONFIG_MODULES */ > >

Re: [PATCH v5 1/2] kprobes: textmem API

2024-03-25 Thread Jarkko Sakkinen
On Tue Mar 26, 2024 at 12:09 AM EET, Jarkko Sakkinen wrote: > On Mon Mar 25, 2024 at 11:55 PM EET, Jarkko Sakkinen wrote: > > +#ifdef CONFIG_MODULES > > if (register_module_notifier(_kprobe_module_nb)) > > return -EINVAL; > > +#endif /* CONFIG_MODULES */ > >

Re: [PATCH v5 1/2] kprobes: textmem API

2024-03-25 Thread Jarkko Sakkinen
On Mon Mar 25, 2024 at 11:55 PM EET, Jarkko Sakkinen wrote: > +#ifdef CONFIG_MODULES > if (register_module_notifier(_kprobe_module_nb)) > return -EINVAL; > +#endif /* CONFIG_MODULES */ register_module_notifier() does have "dummy" version but what would I pass to it. It makes

Re: [PATCH v5 1/2] kprobes: textmem API

2024-03-25 Thread Jarkko Sakkinen
s/textmem/execmem/ (also in long description) will hold sending a new version as not a functional issue, will fix after review. BR, Jarkko

[PATCH v5 1/2] kprobes: textmem API

2024-03-25 Thread Jarkko Sakkinen
Tracing with kprobes while running a monolithic kernel is currently impossible because CONFIG_KPROBES depends on CONFIG_MODULES because it uses the kernel module allocator. Introduce alloc_textmem() and free_textmem() for allocating executable memory. If an arch implements these functions, it can