Re: [PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free()

2023-09-26 Thread Mike Rapoport
On Sat, Sep 23, 2023 at 03:36:01PM -0700, Song Liu wrote: > On Sat, Sep 23, 2023 at 8:39 AM Mike Rapoport wrote: > > > > On Thu, Sep 21, 2023 at 03:34:18PM -0700, Song Liu wrote: > > > On Mon, Sep 18, 2023 at 12:30 AM Mike Rapoport wrote: > > > > > > > > > > [...] > > > > > > > diff --git

Re: [PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free()

2023-09-23 Thread Song Liu
On Sat, Sep 23, 2023 at 8:39 AM Mike Rapoport wrote: > > On Thu, Sep 21, 2023 at 03:34:18PM -0700, Song Liu wrote: > > On Mon, Sep 18, 2023 at 12:30 AM Mike Rapoport wrote: > > > > > > > [...] > > > > > diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c > > > index

Re: [PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free()

2023-09-23 Thread Mike Rapoport
On Thu, Sep 21, 2023 at 03:10:26PM -0700, Song Liu wrote: > On Mon, Sep 18, 2023 at 12:30 AM Mike Rapoport wrote: > > > [...] > > + > > +#include > > +#include > > +#include > > +#include > > + > > +static void *execmem_alloc(size_t size) > > +{ > > + return module_alloc(size); > > +} >

Re: [PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free()

2023-09-23 Thread Mike Rapoport
On Thu, Sep 21, 2023 at 03:14:54PM -0700, Song Liu wrote: > On Mon, Sep 18, 2023 at 12:30 AM Mike Rapoport wrote: > > > [...] > > + > > +/** > > + * enum execmem_type - types of executable memory ranges > > + * > > + * There are several subsystems that allocate executable memory. > > + *

Re: [PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free()

2023-09-23 Thread Mike Rapoport
On Thu, Sep 21, 2023 at 03:34:18PM -0700, Song Liu wrote: > On Mon, Sep 18, 2023 at 12:30 AM Mike Rapoport wrote: > > > > [...] > > > diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c > > index 42215f9404af..db5561d0c233 100644 > > --- a/arch/s390/kernel/module.c > > +++

Re: [PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free()

2023-09-21 Thread Song Liu
On Mon, Sep 18, 2023 at 12:30 AM Mike Rapoport wrote: > [...] > diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c > index 42215f9404af..db5561d0c233 100644 > --- a/arch/s390/kernel/module.c > +++ b/arch/s390/kernel/module.c > @@ -21,6 +21,7 @@ > #include > #include >

Re: [PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free()

2023-09-21 Thread Song Liu
On Mon, Sep 18, 2023 at 12:30 AM Mike Rapoport wrote: > [...] > + > +/** > + * enum execmem_type - types of executable memory ranges > + * > + * There are several subsystems that allocate executable memory. > + * Architectures define different restrictions on placement, > + * permissions,

Re: [PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free()

2023-09-21 Thread Song Liu
On Mon, Sep 18, 2023 at 12:30 AM Mike Rapoport wrote: > [...] > + > +#include > +#include > +#include > +#include > + > +static void *execmem_alloc(size_t size) > +{ > + return module_alloc(size); > +} > + > +void *execmem_text_alloc(enum execmem_type type, size_t size) > +{ > +

[PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free()

2023-09-18 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" module_alloc() is used everywhere as a mean to allocate memory for code. Beside being semantically wrong, this unnecessarily ties all subsystems that need to allocate code, such as ftrace, kprobes and BPF to modules and puts the burden of code allocation to the