[PATCH v2 10/12] arch: make execmem setup available regardless of CONFIG_MODULES

Song Liu song at kernel.org
Fri Jun 16 13:17:57 PDT 2023


On Fri, Jun 16, 2023 at 1:52 AM Mike Rapoport <rppt at kernel.org> wrote:
>
> From: "Mike Rapoport (IBM)" <rppt at kernel.org>
>
> execmem does not depend on modules, on the contrary modules use
> execmem.
>
> To make execmem available when CONFIG_MODULES=n, for instance for
> kprobes, split execmem_params initialization out from
> arch/kernel/module.c and compile it when CONFIG_EXECMEM=y
>
> Signed-off-by: Mike Rapoport (IBM) <rppt at kernel.org>
> ---
[...]
> +
> +struct execmem_params __init *execmem_arch_params(void)
> +{
> +       u64 module_alloc_end;
> +
> +       kaslr_init();

Aha, this addresses my comment on the earlier patch. Thanks!

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


> +
> +       module_alloc_end = module_alloc_base + MODULES_VSIZE;
> +
> +       execmem_params.modules.text.pgprot = PAGE_KERNEL;
> +       execmem_params.modules.text.start = module_alloc_base;
> +       execmem_params.modules.text.end = module_alloc_end;
> +
> +       execmem_params.jit.text.pgprot = PAGE_KERNEL_ROX;
[...]



More information about the linux-riscv mailing list