From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 92D0BD4A5F4 for ; Sun, 18 Jan 2026 14:16:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2868210E2C9; Sun, 18 Jan 2026 14:16:47 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="gJbr+/P+"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 19FCC10E2A6; Sun, 18 Jan 2026 14:16:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768745805; x=1800281805; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=UudtuDq34MYJqWXnxCgj7hLDUtpJxnIbpapqDIrG7M8=; b=gJbr+/P+MKHPZ+tCx6H9X5e2RxJAHi3CMH/0d98U3N9fSxupLpY1QeHk nhTtMSlFMBM2s6+wxdRTnK1q1Wm/5sDwBDci7YgKYPHic+ePCdk1Ei+TY ZK5ruH5VRkpUsPN2LZTR6CDPWygkzubawuZvsFkGCKVpLOTua1J4UkAQ6 amx34nH8NyNv5S9OwfFzHi56quMtC3ROjMXF5Y6GpVCNlYpZG+Uix2eTa 1oL97e7laPoCuL4s6yGf+t6kDk90o0YXElzHKKC0vznw/Kwri9Gm5VIVJ Bi9XUwmPuKzgU027EKzo/ub4YuiKUk2h3UkNfGoSORJrY4SbSFh09Q+wt Q==; X-CSE-ConnectionGUID: 2cufV3UxT7GWxVchB7t1Jg== X-CSE-MsgGUID: 9eyf3BurSRm6vLRpypiPaQ== X-IronPort-AV: E=McAfee;i="6800,10657,11675"; a="80279033" X-IronPort-AV: E=Sophos;i="6.21,235,1763452800"; d="scan'208";a="80279033" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2026 06:16:44 -0800 X-CSE-ConnectionGUID: uEuCMJyAT1SPhq5oFgFZ9A== X-CSE-MsgGUID: YCbX+3UhScWByywIYHhhTQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,235,1763452800"; d="scan'208";a="205264188" Received: from egrumbac-mobl6.ger.corp.intel.com (HELO [10.245.244.5]) ([10.245.244.5]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2026 06:16:38 -0800 Message-ID: Subject: Re: [PATCH v2 0/4] dma-buf: document revoke mechanism to invalidate shared buffers From: Thomas =?ISO-8859-1?Q?Hellstr=F6m?= To: Leon Romanovsky , Sumit Semwal , Christian =?ISO-8859-1?Q?K=F6nig?= , Alex Deucher , David Airlie , Simona Vetter , Gerd Hoffmann , Dmitry Osipenko , Gurchetan Singh , Chia-I Wu , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Lucas De Marchi , Rodrigo Vivi , Jason Gunthorpe , Kevin Tian , Joerg Roedel , Will Deacon , Robin Murphy , Alex Williamson Cc: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, virtualization@lists.linux.dev, intel-xe@lists.freedesktop.org, linux-rdma@vger.kernel.org, iommu@lists.linux.dev, kvm@vger.kernel.org Date: Sun, 18 Jan 2026 15:16:25 +0100 In-Reply-To: <20260118-dmabuf-revoke-v2-0-a03bb27c0875@nvidia.com> References: <20260118-dmabuf-revoke-v2-0-a03bb27c0875@nvidia.com> Organization: Intel Sweden AB, Registration Number: 556189-6027 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-2.fc41) MIME-Version: 1.0 X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" Hi, Leon, On Sun, 2026-01-18 at 14:08 +0200, Leon Romanovsky wrote: > Changelog: > v2: > =C2=A0* Changed series to document the revoke semantics instead of > =C2=A0=C2=A0 implementing it. > v1: > https://patch.msgid.link/20260111-dmabuf-revoke-v1-0-fb4bcc8c259b@nvidia.= com >=20 > --------------------------------------------------------------------- > ---- > This series documents a dma-buf =E2=80=9Crevoke=E2=80=9D mechanism: to al= low a dma- > buf > exporter to explicitly invalidate (=E2=80=9Ckill=E2=80=9D) a shared buffe= r after it > has > been distributed to importers, so that further CPU and device access > is > prevented and importers reliably observe failure. >=20 > The change in this series is to properly document and use existing > core > =E2=80=9Crevoked=E2=80=9D state on the dma-buf object and a corresponding= exporter- > triggered > revoke operation. Once a dma-buf is revoked, new access paths are > blocked so > that attempts to DMA-map, vmap, or mmap the buffer fail in a > consistent way. This sounds like it does not match how many GPU-drivers use the move_notify() callback. move_notify() would typically invalidate any device maps and any asynchronous part of that invalidation would be complete when the dma- buf's reservation object becomes idle WRT DMA_RESV_USAGE_BOOKKEEP fences. However, the importer could, after obtaining the resv lock, obtain a new map using dma_buf_map_attachment(), and I'd assume the CPU maps work in the same way, I.E. move_notify() does not *permanently* revoke importer access. /Thomas >=20 > Thanks >=20 > Cc: linux-media@vger.kernel.org > Cc: dri-devel@lists.freedesktop.org > Cc: linaro-mm-sig@lists.linaro.org > Cc: linux-kernel@vger.kernel.org > Cc: amd-gfx@lists.freedesktop.org > Cc: virtualization@lists.linux.dev > Cc: intel-xe@lists.freedesktop.org > Cc: linux-rdma@vger.kernel.org > Cc: iommu@lists.linux.dev > Cc: kvm@vger.kernel.org > To: Sumit Semwal > To: Christian K=C3=B6nig > To: Alex Deucher > To: David Airlie > To: Simona Vetter > To: Gerd Hoffmann > To: Dmitry Osipenko > To: Gurchetan Singh > To: Chia-I Wu > To: Maarten Lankhorst > To: Maxime Ripard > To: Thomas Zimmermann > To: Lucas De Marchi > To: Thomas Hellstr=C3=B6m > To: Rodrigo Vivi > To: Jason Gunthorpe > To: Leon Romanovsky > To: Kevin Tian > To: Joerg Roedel > To: Will Deacon > To: Robin Murphy > To: Alex Williamson >=20 > --- > Leon Romanovsky (4): > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 dma-buf: Rename .move_notify() callback to= a clearer identifier > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 dma-buf: Document revoke semantics > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 iommufd: Require DMABUF revoke semantics > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 vfio: Add pinned interface to perform revo= ke semantics >=20 > =C2=A0drivers/dma-buf/dma-buf.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 = 6 +++--- > =C2=A0drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c |=C2=A0 4 ++-- > =C2=A0drivers/gpu/drm/virtio/virtgpu_prime.c=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 |=C2=A0 2 +- > =C2=A0drivers/gpu/drm/xe/tests/xe_dma_buf.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 |=C2=A0 6 +++--- > =C2=A0drivers/gpu/drm/xe/xe_dma_buf.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 2 +- > =C2=A0drivers/infiniband/core/umem_dmabuf.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 |=C2=A0 4 ++-- > =C2=A0drivers/infiniband/hw/mlx5/mr.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 2 +- > =C2=A0drivers/iommu/iommufd/pages.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 11 +++++++++-- > =C2=A0drivers/vfio/pci/vfio_pci_dmabuf.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 | 16 ++++++++++++++++ > =C2=A0include/linux/dma-buf.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 | 25 > ++++++++++++++++++++++--- > =C2=A010 files changed, 60 insertions(+), 18 deletions(-) > --- > base-commit: 9ace4753a5202b02191d54e9fdf7f9e3d02b85eb > change-id: 20251221-dmabuf-revoke-b90ef16e4236 >=20 > Best regards, > --=C2=A0=20 > Leon Romanovsky >=20