[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251119095934.28624652@fedora>
Date: Wed, 19 Nov 2025 09:59:34 +0100
From: Boris Brezillon <boris.brezillon@...labora.com>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Daniel Almeida <daniel.almeida@...labora.com>, Miguel Ojeda
<ojeda@...nel.org>, Will Deacon <will@...nel.org>, Boqun Feng
<boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, "Björn
Roy Baron" <bjorn3_gh@...tonmail.com>, Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, Joerg Roedel <joro@...tes.org>, Robin
Murphy <robin.murphy@....com>, Lorenzo Stoakes
<lorenzo.stoakes@...cle.com>, "Liam R. Howlett" <Liam.Howlett@...cle.com>,
Asahi Lina <lina+kernel@...hilina.net>, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org, iommu@...ts.linux.dev, linux-mm@...ck.org
Subject: Re: [PATCH v3] io: add io_pgtable abstraction
On Mon, 17 Nov 2025 16:34:06 +0000
Alice Ryhl <aliceryhl@...gle.com> wrote:
> 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@...gle.com> 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;
I confirm the io_pgtable framework (or at least some of its
implementations) doesn't allow you to do that (remap without an
explicit unmap coming first).
Powered by blists - more mailing lists