From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 1B04649B5C2 for ; Mon, 12 Oct 2026 15:29:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791818991; cv=none; b=PjwDlWf2NHVEpYlKQr7FdLxAZhT4cZOloVNaTmET2aHiMb1eh7G7zVU0AHLGN59EURPK881yHPY3XTYUeq/Cdgnfkno4AGG/38bWEmyujErGzd66U8Jwu2llKSfXE6NvsjZ4qJOc7NURlx/mh9oxzCv9VrqLEkf1hi5Wi5E4FnQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791818991; c=relaxed/simple; bh=S/6wBu1Qy0PjFWFsGd4NPUc2/G0ASzabS+h4tG5IOy8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZNtrMYVOsygzY03kfMHykQTr3rVVdgfRYBx1nVC6UCZeerzI1+kU1X3EN0kisE6OVRtTNbvT2BvZk6nujbCf8txXcnjPxK+Vb8nufUpyPRkrEPyQjfp5u5TpgtSdlDtln2W7+OxI0qveXnqZOtOMqyIbicuYsZKpcgRKarMlFRY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=rz8zh8MO; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rz8zh8MO" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4a17baef589so16375595e9.0 for ; Mon, 12 Oct 2026 08:29:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791818988; x=1792423788; darn=lists.linux.dev; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=dHaZjZ/K9HkcWHP0xoN3hdI7zGw/VH12N/DXI78bY9w=; b=rz8zh8MOmCcuL8FhVroLquqHtkxlXzTUKX47L81zn0TICo+BMjuC7yOa19k3SbF82G HwvmG4NIDqDundZMa1hcZFm/cSRfqq1Y4N+qXEKO5kPK9lNssCciqkbAFIdGsZKpYM6i 4NvYjEU2lgIg2uO8LkT/as0Eke0905xO/uaR9wGe1g4mLufPIRSXGn4dVXwiWk461273 oK++G5XtOn/5RESFbOOOC5D92QgH3EPfJqzfDU3mubHXoTrUhSzAd+It9G+jg7qbKQY7 0bZNbLuKC52c5KILwskupTy9blZKrgXDeatFTPNPs+v0kfGJyxoZ+pWLfCLALMgRqx5z Ahsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791818988; x=1792423788; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=dHaZjZ/K9HkcWHP0xoN3hdI7zGw/VH12N/DXI78bY9w=; b=KS0b4Ai6nA9MAKW5j3OeTLEZ/Q/8ofsknhrdbLluUaS7yljmA16yj0yJYxAoYD5Crm rkxpE4L1wbk2tx6W6PWCTWYEizwVd+Mpy/qOGXXCl/e2E/+FKsurotjWfjBNCEow7gGX SOhNntXjvbJt0te+sQjaskEwMIuxEAMj85AiGyVPZAup7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with SMTP id 5b1f17b1804b1-4a18e4841c1mr177576875e9.14.1791818988354; Mon, 12 Oct 2026 08:29:48 -0700 (PDT) Received: from dev-dsk-fgriffo-1c-93421965.eu-west-1.amazon.com (54-240-197-234.amazon.com. [54.240.197.234]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4a190344032sm299058135e9.15.2026.10.12.08.29.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Oct 2026 08:29:47 -0700 (PDT) From: Fred Griffoul To: Jason Gunthorpe , =?UTF-8?q?Christian=20K=C3=B6nig?= Cc: Paolo Bonzini , Sean Christopherson , Marc Zyngier , Oliver Upton , Sumit Semwal , Kevin Tian , David Woodhouse , Ackerley Tng , Joey Gouly , Suzuki K Poulose , Zenghui Yu , Steffen Eiden , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , Joerg Roedel , Robin Murphy , Alex Williamson , Shuah Khan , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kselftest@vger.kernel.org, linux-trace-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [RFC PATCH 2/6] dma-buf: Add get_phys() to describe a physical run Date: Mon, 12 Oct 2026 15:29:46 +0000 Message-ID: <20261012152946.63489-1-griffoul@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261012144616.GF14213@ziepe.ca> References: <20261005132046.30025-1-griffoul@gmail.com> <20261012144616.GF14213@ziepe.ca> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Mon, Oct 12, 2026 at 11:46:16AM -0300, Jason Gunthorpe wrote: > I don't want to keep expanding this hack in iommufd. If dmabuf is to > be used then dmabuf needs to provide a pluggable way to fill the > iommu_domain that many exporters can plug into. I don't want to > hardwire every exporter into iommufd, that makes no sense. > > The existing arrangement is to motivate solving this problem > generically, not something to be expanded on. Agreed. The iommufd registry I mentioned above was never posted, and I have dropped it. The series I posted since takes another route, without dma-buf: https://lore.kernel.org/all/20261006183235.16576-1-griffoul@gmail.com/ It adds a small interface in mm for drivers that own memory. Such a driver hands out files, and for each page of a file it tells the caller which frame backs it. iommufd maps the file with IOMMU_IOAS_MAP_FILE and builds the iommu_domain itself, and the driver revokes a range when it changes. So iommufd never knows which driver it is talking to, and there is no symbol_get(). guest_memfd uses the same files for the guest. The iommufd part is patch 5: https://lore.kernel.org/all/20261006183235.16576-6-griffoul@gmail.com/ The iommufd part is mainly there to show the interface, and it needs more work. Its revoke unmaps and then remaps, so a device can hit a hole. I would rebuild it on the REPLACE operation David discussed with you at LPC, with the scratch page as a quirk on the IOAS. Is this the kind of generic interface you had in mind, or would you rather have it hang off dma-buf? Thanks, Fred