Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] The userland VMA testing header `dup.h` was not fully updated; the 
`map_kernel_discontig` field is missing from `struct mmap_action`.
--

commit 0017a54bcba2043c3f552b308a32a39be664f463
Author: Lorenzo Stoakes (ARM) <[email protected]>

mm: add mmap action for discontiguous kernel page mapping

This commit introduces a new mmap action, MMAP_DISCONTIG_KERNEL_PAGES, to
allow drivers to map discontiguous ranges of struct page pointers. It provides
discontig_kernel_page_ops for drivers to specify how page batches should be
retrieved, and updates the core mm and VMA test headers accordingly.

> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 9ca2ea3664bc1..0cb4f96039568 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h

[ ... ]

> @@ -844,6 +880,10 @@ struct mmap_action {
>                       unsigned long nr_pages;
>                       pgoff_t pgoff;
>               } map_kernel;
> +             struct {
> +                     void *init_private;
> +                     const struct discontig_kernel_page_ops *ops;
> +             } map_kernel_discontig;
>       };
>       enum mmap_action_type type;

[ ... ]

> diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/dup.h
> index 1098655a5f4a3..52eee05e6c322 100644
> --- a/tools/testing/vma/include/dup.h
> +++ b/tools/testing/vma/include/dup.h
> @@ -457,8 +457,9 @@ enum mmap_action_type {
>       MMAP_NOTHING,
>       MMAP_REMAP_PFN,
>       MMAP_IO_REMAP_PFN,
> -     MMAP_SIMPLE_IO_REMAP,   /* I/O remap with guardrails. */
> -     MMAP_KERNEL_PAGES,      /* Map kernel page range from array. */
> +     MMAP_SIMPLE_IO_REMAP,           /* I/O remap with guardrails. */
> +     MMAP_KERNEL_PAGES,              /* Map kernel page range from array. */
> +     MMAP_DISCONTIG_KERNEL_PAGES,    /* Map kernel discontig page range. */
>  };
>  
>  /*

[Severity: Low]
Does struct mmap_action in this userland VMA testing header also need
to be updated?

The map_kernel_discontig field was added to the kernel's mm_types.h, but
it appears to be missing from the corresponding struct mmap_action defined
in tools/testing/vma/include/dup.h. 

If a selftest attempts to access the map_kernel_discontig union member of 
struct mmap_action for MMAP_DISCONTIG_KERNEL_PAGES, it will fail to compile.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/20260908-b4-mmap-prepare-vma-flag-sanify-v1-0-dacf19cce...@kernel.org?part=7

Reply via email to