Re: [PATCH v2 06/16] mm: add mmap_action_simple_ioremap()

Lorenzo Stoakes (Oracle)
2026-03-19T16:29:25Z

On Wed, Mar 18, 2026 at 08:39:25PM +0000, Lorenzo Stoakes (Oracle) wrote:
> On Mon, Mar 16, 2026 at 09:14:28PM -0700, Suren Baghdasaryan wrote:
> > > +int simple_ioremap_prepare(struct vm_area_desc *desc)
> > > +{
> > > + struct mmap_action *action = &desc->action;
> > > + const phys_addr_t start = action->simple_ioremap.start_phys_addr;
> > > + const unsigned long size = action->simple_ioremap.size;
> > > + unsigned long pfn;
> > > + int err;
> > > +
> > > + err = __simple_ioremap_prep(desc->start, desc->end, desc->pgoff,
> > > + start, size, &pfn);
> > > + if (err)
> > > + return err;
> > > +
> > > + /* The I/O remap logic does the heavy lifting. */
> > > + mmap_action_ioremap(desc, desc->start, pfn, vma_desc_size(desc));
> >
> > nit: Looks like a perfect opportunity to use mmap_action_ioremap_full() here.
>
> Yeah can do!
>
> >
> > > + return mmap_action_prepare(desc);
> >
> > Ok, so IIUC this uses recursion:
> > mmap_action_prepare(MMAP_SIMPLE_IO_REMAP) -> simple_ioremap_prepare()
> > -> mmap_action_prepare(MMAP_IO_REMAP_PFN).
>
> Yep, it's one level, I think that should be ok? :)

On second thoughts, it's silly not just to call io_remap_pfn_range_prepare()
direct so will change it to do that!

Cheers, Lorenzo