[PATCH v2 03/12] mm/execmem, arch: convert simple overrides of module_alloc to execmem

Song Liu song at kernel.org
Sat Jun 17 04:36:32 AEST 2023


On Fri, Jun 16, 2023 at 1:51 AM Mike Rapoport <rppt at kernel.org> wrote:
>
> From: "Mike Rapoport (IBM)" <rppt at kernel.org>
>
> Several architectures override module_alloc() only to define address
> range for code allocations different than VMALLOC address space.
>
> Provide a generic implementation in execmem that uses the parameters
> for address space ranges, required alignment and page protections
> provided by architectures.
>
> The architecures must fill execmem_params structure and implement
> execmem_arch_params() that returns a pointer to that structure. This
> way the execmem initialization won't be called from every architecure,
> but rather from a central place, namely initialization of the core
> memory management.
>
> The execmem provides execmem_text_alloc() API that wraps
> __vmalloc_node_range() with the parameters defined by the architecures.
> If an architeture does not implement execmem_arch_params(),
> execmem_text_alloc() will fall back to module_alloc().
>
> The name execmem_text_alloc() emphasizes that the allocated memory is
> for executable code, the allocations of the associated data, like data
> sections of a module will use execmem_data_alloc() interface that will
> be added later.
>
> Signed-off-by: Mike Rapoport (IBM) <rppt at kernel.org>

Acked-by: Song Liu <song at kernel.org>


More information about the Linuxppc-dev mailing list