NAK.

You're exporting internal mm stuff to drivers, in no world are you going to
do that, sorry.

On Wed, Jul 08, 2026 at 11:01:53AM +0530, Mukesh Ojha wrote:
> From: Eugen Hristev <[email protected]>
>
> Annotate vital static information into inspection table:
>  - init_mm
>  - swapper_pg_dir
>  - _sinittext
>  - _einittext
>  - _end
>  - _text
>  - _stext
>  - _etext
>
> Information on these variables is stored into dedicated meminspect
> section.
>
> Signed-off-by: Eugen Hristev <[email protected]>
> Signed-off-by: Mukesh Ojha <[email protected]>
> ---
>  mm/init-mm.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/mm/init-mm.c b/mm/init-mm.c
> index 3e792aad7626..cf53058410b1 100644
> --- a/mm/init-mm.c
> +++ b/mm/init-mm.c
> @@ -7,6 +7,8 @@
>  #include <linux/cpumask.h>
>  #include <linux/mman.h>
>  #include <linux/pgtable.h>
> +#include <linux/meminspect.h>

Hate the idea of a very specific inspection mechanism hooking into core mm
initialisation in general.

If you thing needs to do this, your thing is broken IMO.

> +#include <asm/sections.h>

Err sections? So now this file is now a dumping ground for meminspect ELF
section declarations?

>
>  #include <linux/atomic.h>
>  #include <linux/user_namespace.h>
> @@ -19,6 +21,13 @@
>
>  const struct vm_operations_struct vma_dummy_vm_ops;
>
> +MEMINSPECT_AREA_ENTRY(_sinittext, sizeof(void *));
> +MEMINSPECT_AREA_ENTRY(_einittext, sizeof(void *));
> +MEMINSPECT_AREA_ENTRY(_end, sizeof(void *));
> +MEMINSPECT_AREA_ENTRY(_text, sizeof(void *));
> +MEMINSPECT_AREA_ENTRY(_stext, sizeof(void *));
> +MEMINSPECT_AREA_ENTRY(_etext, sizeof(void *));

Is this just a weird way of getting ELF symbols?

> +
>  /*
>   * For dynamically allocated mm_structs, there is a dynamically sized cpumask
>   * at the end of the structure, the size of which depends on the maximum CPU
> @@ -50,6 +59,9 @@ struct mm_struct init_mm = {
>       INIT_MM_CONTEXT(init_mm)
>  };
>
> +MEMINSPECT_SIMPLE_ENTRY(init_mm);
> +MEMINSPECT_AREA_ENTRY(swapper_pg_dir, sizeof(void *));

Absolutely, positively not, this is totally insane and COMPLETELY violates
separation between drivers and mm.

We already let drivers access FAR too much.

Exporting core mm internals would be like giving up on any semblence of
separation of concerns.

> +
>  void setup_initial_init_mm(void *start_code, void *end_code,
>                          void *end_data, void *brk)
>  {
>
> --
> 2.53.0
>

Thanks, Lorenzo

Reply via email to