Re: [PATCH v3] io: add io_pgtable abstraction
From: Alice Ryhl
Date: Mon Nov 17 2025 - 11:37:52 EST
On Wed, Nov 12, 2025 at 09:57:09AM -0300, Daniel Almeida wrote:
> Hi Alice,
>
> > On 12 Nov 2025, at 07:15, Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
> > + /// Map a physically contiguous range of pages of the same size.
> > + ///
> > + /// # Safety
> > + ///
> > + /// * This page table must not contain any mapping that overlaps with the mapping created by
> > + /// this call.
>
> I don't think there is a restriction that forbids you from mapping a region that has already been mapped.
>
> If A->B->C are adjacent regions, and you try to map A -> C when B->C is already mapped, I think this
> call will simply return length(A->B).
I think that such overlapping ranges are not allowed. It triggers a
warn:
} else if (pte) {
/* We require an unmap first */
WARN_ON(!(cfg->quirks & IO_PGTABLE_QUIRK_NO_WARN));
return -EEXIST;
Alice