From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f74.google.com (mail-wr1-f74.google.com [209.85.221.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32A6A2D541B for ; Mon, 17 Nov 2025 16:34:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763397250; cv=none; b=r50kAWYwIBjnTnr7UUNcXJDgUzmp5Ip+Trx4RbqoSEWm9qpG8zZJ8nEHJjv6fchXZm0TlPCSZ+Qf1HG9iZ7vvXyQGUsO53x7BANWvLvA+HllLTKnhUthG8M2MOXPCxIrMYCqWxOuCw8vz9p4yHQD6e/tngIgPfq18L4t7T9wlzY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763397250; c=relaxed/simple; bh=zzWdLmtGggW9oRj+naWFU0UlArBlbWzK2DFfx8jpMSs=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=W5y9FWTOeO717rlNrclzH7DXPgZfW3Lg+bz/WFVY8j99BENC8Ule1RrMcqlEiXCiYNT9mPevicccuHyURQLbOSiTnOXhgd3Qa6QMRGS3Ozd9sM/uJuMmeDlnwiPq/dpdrQdBx4ajLvfdwRhN7UnJY5BrO5bMZiYUTF1uwMTWsdc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=eTytEbeb; arc=none smtp.client-ip=209.85.221.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="eTytEbeb" Received: by mail-wr1-f74.google.com with SMTP id ffacd0b85a97d-429c7b0ae36so2503520f8f.0 for ; Mon, 17 Nov 2025 08:34:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1763397247; x=1764002047; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=dnt6AMffwSDJMbW+9hMVzLqsThvI95BECbEYPsOm0UQ=; b=eTytEbebWgBhwLdQxoe3SUU8HznWDTv9uA4/4JI/Hg+zab97LsJVHJ8WTJaQ6P+jWX Qvp+90702a76H4RM09JXBagspy+WYwck6NcQz3tefwXk+HokkA6mxGIzkhIUi3pB+3Oj nH4H/djICCZ53gGRbiVTgWmLk2AFhgZi4kjZR0u1r8yLl0FiZDjKXrSF66HgSHsV+67O /Oz08krRZ/9ykkGv7zOZCm1wWMyaGZvm0E1iGbEFDgxIWcvLCx2tQIK+B+tITPqhlcAL sSevMuOF07DmpATkLXiQwtKlw340yn09w4mmNBV9oKppbIyJ/dbaZv3xge8tsUIEVazb Gstw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763397247; x=1764002047; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dnt6AMffwSDJMbW+9hMVzLqsThvI95BECbEYPsOm0UQ=; b=xQB+HmIYD3oBoM5OdJF1Zsni0zPquFhOCfXZWKI27CWU72hj2xjXmX/TyUiMJaf4xu HsWVGfDkVkt+wQZxyX1+nMJnwt+PZFEsAFWm82EVucp7GyB/KP2TIFUTWNEKsQSdBYs6 vNmj7FGDvQ254oSoKR8FF6rrs+cs3oQE1XCs1Gl2hjOEds4kHRzQ6Lm1WRo5nOlGx10J Lz1+i7NM6lsRxzO/sdfhUmELDNI4sJFDm85NhK+QuKTerBT0TRIUQKTef8EEUaGlBogx uqU8x9TpesbfP30jtf6wOlVxCxWBCW8sW5HrO7IUjb8gfnd11USPnbcz9FMeAwaHIYI+ jfog== X-Forwarded-Encrypted: i=1; AJvYcCXo6kLcxvy9SWJiCmdapKDDw2zO8Jzhs/hmDbNAqQ+TS/cJhcrK4wSwacfvR1LM2FrcqHWTIxTRl45nzac=@vger.kernel.org X-Gm-Message-State: AOJu0Yx7nP9a1+rXCuhuOS6GHlHgxo7WmQmmW+HUAofp2nLxgHmCt/iP lfJRpADTLZLBkrFdBBM022ETORFqDOIun3o+KAlrcp3oyII/yfKfvP1/i7csJ6DjRUWb6izu5x5 O8Rs1Sdh8Q3n/TMggNQ== X-Google-Smtp-Source: AGHT+IGf3SSTcSDNX35lGHyTDeVfIkh75oyqd6PvBpSYTmqxSNGCpLyaYAzVUgwUDnODNmGVYD8Jy8eTO5xF54g= X-Received: from wrbeh10.prod.google.com ([2002:a05:6000:410a:b0:42b:33e5:ebb6]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:2911:b0:429:cc35:7032 with SMTP id ffacd0b85a97d-42b52821778mr17645835f8f.23.1763397247461; Mon, 17 Nov 2025 08:34:07 -0800 (PST) Date: Mon, 17 Nov 2025 16:34:06 +0000 In-Reply-To: <8A5C6836-992B-477A-A77C-EE0736166552@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251112-io-pgtable-v3-1-b00c2e6b951a@google.com> <8A5C6836-992B-477A-A77C-EE0736166552@collabora.com> Message-ID: Subject: Re: [PATCH v3] io: add io_pgtable abstraction From: Alice Ryhl To: Daniel Almeida Cc: Miguel Ojeda , Will Deacon , Boris Brezillon , Boqun Feng , Gary Guo , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , Joerg Roedel , Robin Murphy , Lorenzo Stoakes , "Liam R. Howlett" , Asahi Lina , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, iommu@lists.linux.dev, linux-mm@kvack.org Content-Type: text/plain; charset="utf-8" On Wed, Nov 12, 2025 at 09:57:09AM -0300, Daniel Almeida wrote: > Hi Alice, > > > On 12 Nov 2025, at 07:15, Alice Ryhl 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