From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (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 51CCA314A6E for ; Fri, 30 Jan 2026 14:01:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769781681; cv=none; b=O+GFNoMMmBw3gECaaN3416sPfXXVIRcFkiEt4BTnA2+bonXYmlKozm6A/sbxtobRiXbOfyHL4ofJflpTEsyzLfzmNSRlO5ubyq5tNbHliw10kSL1yc8tkj/H5Lc4Sfu5mXu/I2Z0DRZfTEgM0gV685R86mN0Ic4qIaGc/w0JynI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769781681; c=relaxed/simple; bh=B2BjUDXErJP5w+VRNup6GLKty66RY3PW3GzWxgahGUw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HmN9hKa3HdrWRdB9Lm5gvCyJ0hQCdp/kJM88R/7F2ws1n6xFd9cMTV5lya2t0Ux563MCq7ycxLRWpLPrG00vKu4AScWZbJ6fjuZQbA2eoKi2YebQOQWq9wDVUMk0GgI2EB37sE4UHJ7myNNTrYQd1HvRORSc9to2jtiQD9olx9Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=RPXkfxnK; arc=none smtp.client-ip=209.85.222.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="RPXkfxnK" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-8c710439535so170149785a.1 for ; Fri, 30 Jan 2026 06:01:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1769781679; x=1770386479; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=RZzJd1rUXnKgbbFoik2J/HwA+Mcwjh2UI/kxMGq+fms=; b=RPXkfxnKERVpanY6KK8kMqA92D1aCsm0leVXLFCXjOhb2U3nX2ibmil5e1rKJjRbmZ f9DLF2ispAd3BC5/e/B7PIP41q9T7cXh+rFnMjLhQTQVOAwPscRHX0yuVltxMo+SX0va xizd3lnopuOyDgwqxrfBFFPETq8K7uDdD1AiHlNN/WTPGOisvesviEelnt4KuWRuvyRg C1fgBVRD7H2M7lHZPygk3VfxwbCekxUo86H7EPdB+A5bCR3cOm6bbT7bRiRKk5cUFTZ8 6U8v+ce+eW1niOc5yZS8lVBKLeRT4st0EvTSZ8FDC2mKySNBjdyDwdy1kxq6nDeMR7Sh lduw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769781679; x=1770386479; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RZzJd1rUXnKgbbFoik2J/HwA+Mcwjh2UI/kxMGq+fms=; b=L0/1gqgI7l+FDhMCfoMivBtHbH2fzJN3IP2+vk9CCaFs4FAG2GYRgmr1QsLm0Ig5y9 7nRgz7lv4/zI0+nb6SJvftH/E1lUTFLmRwHZa3O0R6s14GWuRtxtzI3hqNyvKHkjyPj+ TZrwpD1n1yRdYTsD5uszr6PM67mGZbz49b1OprxpzevEMqjvnTj2Mov3DmpQNSBrlABR dpyEEG+LBK3xG7m2NNZP7DlpKgBsrOjJ6sFoMNhMkSsz541mJ4/RlH/nVtETEGkzIpRi x23v3PzZjQYhvh7cpCf/X27zPU5H8Itr3v0yzgvCYMPBnEDOwOJDiLkpXxt64xiZeP/Q F30A== X-Forwarded-Encrypted: i=1; AJvYcCX2NU4s9NNb4pXEUOaGxo7/rAb3EVK7zLoIAX9QGt8vPjd2NfAk8Xwl6VbPh/vn49AatCz8U0Ie63Do6w==@vger.kernel.org X-Gm-Message-State: AOJu0YwUi2att3pavhlJVyh5+RCLlJyWprQfn8X05HsAnp6Mvrsgu71B iL98PbpRDAVECWI03Ysa9Xw6vYfls+/haCXHBJy8cqTD96XLwqT10VIkig2lwx1u6W0= X-Gm-Gg: AZuq6aINAK7fZ8xBdbrIlPDgcorxYmdJtJvkDjkjNR7XUN/CE0KtvTpscTeXZoLbt21 3uUeTOsgkkHmb/dC3PFiaF5N1RQlbBx8/kLfnXIAN3JLzkm0perR99p46s/k4JjZao1In/g0T90 O2o/kvONF0DCGfgM2RwIZplptKNSwB1XmBYayznKAyy1kX+XSxeM7vOC+M3YmN2eHqILzqmqDmC xUG8vB2Kp6OtlcZD2F4GtTYzRBI84zo2/GyUoH/lb7ZradOkn6sBauMaFnhNt/80YBCpVUE97bJ xS33tFnlW7Xag7Mlh5T0KtnYhOsVkSNkYuKbN2PLM/YfB5jc35kuU21zEZVyeJtG91yyLRZBlhP wmbjBgbOiQZSChNvrjRzI4ngUtLLnydxEpfO9zST0Q+O2fXj+nurhZ3DU00PGZJ/GcaJRdRCBb6 0uKSAXa+TPBOBCRJHbezTIR77kiUftp/AB2gYpwxspwcSDc53opvIaeJYHvNEgHfgSBG9QrL4Ew gWBkQ== X-Received: by 2002:a05:620a:290f:b0:8c3:650d:577e with SMTP id af79cd13be357-8c9eb224827mr368793585a.4.1769781649371; Fri, 30 Jan 2026 06:00:49 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-112-119.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.112.119]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8c711b95e4esm700915485a.15.2026.01.30.06.00.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jan 2026 06:00:48 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1vlp3H-0000000Annc-1AWG; Fri, 30 Jan 2026 10:00:47 -0400 Date: Fri, 30 Jan 2026 10:00:47 -0400 From: Jason Gunthorpe To: Christian =?utf-8?B?S8O2bmln?= Cc: Leon Romanovsky , Sumit Semwal , Alex Deucher , David Airlie , Simona Vetter , Gerd Hoffmann , Dmitry Osipenko , Gurchetan Singh , Chia-I Wu , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Lucas De Marchi , Thomas =?utf-8?Q?Hellstr=C3=B6m?= , Rodrigo Vivi , Kevin Tian , Joerg Roedel , Will Deacon , Robin Murphy , Felix Kuehling , Alex Williamson , Ankit Agrawal , Vivek Kasireddy , 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 Subject: Re: [PATCH v5 6/8] dma-buf: Add dma_buf_attach_revocable() Message-ID: <20260130140047.GD2328995@ziepe.ca> References: <20260124-dmabuf-revoke-v5-0-f98fca917e96@nvidia.com> <20260124-dmabuf-revoke-v5-6-f98fca917e96@nvidia.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Jan 30, 2026 at 09:43:22AM +0100, Christian König wrote: > On 1/24/26 20:14, Leon Romanovsky wrote: > > From: Leon Romanovsky > > > > Some exporters need a flow to synchronously revoke access to the DMA-buf > > by importers. Once revoke is completed the importer is not permitted to > > touch the memory otherwise they may get IOMMU faults, AERs, or worse. > > That approach is seriously not going to fly. > > You can use the invalidate_mappings approach to trigger the importer > to give back the mapping, but when the mapping is really given back > is still completely on the importer side. Yes, and that is what this is all doing, there is the wait for the importer's unmap to happen in the sequence. > In other words you can't do the shot down revoke semantics you are > trying to establish here. All this is doing is saying if dma_buf_attach_revocable() == true then the importer will call unmap within bounded time after dma_buf_invalidate_mappings(). That's it. If the importing driver doesn't want to do that then it should make dma_buf_attach_revocable()=false. VFIO/etc only want to interwork with importers that can do this. Jason