Re: [PATCH v2 07/12] arm64, execmem: extend execmem_params for generated code definitions

From: Song Liu
Date: Fri Jun 16 2023 - 16:05:49 EST


On Fri, Jun 16, 2023 at 1:52 AM Mike Rapoport <rppt@xxxxxxxxxx> wrote:
>
> From: "Mike Rapoport (IBM)" <rppt@xxxxxxxxxx>
>
> The memory allocations for kprobes on arm64 can be placed anywhere in
> vmalloc address space and currently this is implemented with an override
> of alloc_insn_page() in arm64.
>
> Extend execmem_params with a range for generated code allocations and
> make kprobes on arm64 use this extension rather than override
> alloc_insn_page().
>
> Signed-off-by: Mike Rapoport (IBM) <rppt@xxxxxxxxxx>
> ---
> arch/arm64/kernel/module.c | 9 +++++++++
> arch/arm64/kernel/probes/kprobes.c | 7 -------
> include/linux/execmem.h | 11 +++++++++++
> mm/execmem.c | 14 +++++++++++++-
> 4 files changed, 33 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c
> index c3d999f3a3dd..52b09626bc0f 100644
> --- a/arch/arm64/kernel/module.c
> +++ b/arch/arm64/kernel/module.c
> @@ -30,6 +30,13 @@ static struct execmem_params execmem_params = {
> .alignment = MODULE_ALIGN,
> },
> },
> + .jit = {
> + .text = {
> + .start = VMALLOC_START,
> + .end = VMALLOC_END,
> + .alignment = 1,
> + },
> + },
> };

This is growing fast. :) We have 3 now: text, data, jit. And it will be
5 when we split data into rw data, ro data, ro after init data. I wonder
whether we should still do some type enum here. But we can revisit
this topic later.

Other than that

Acked-by: Song Liu <song@xxxxxxxxxx>