From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com [202.12.124.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64FB7340283; Wed, 4 Feb 2026 16:57:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.156 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770224227; cv=none; b=j1uWgn4IBaaiECcTIQflXm2fDuYvenfrerxoDhn5MjZ4lBcf7k10LIij48EbhngEUUEw7YfJWoIfVMvfrOefAlgPBQCzDKkFImfTOFMWd571r3ZVb73IBzD5zytfd8X4YefTYBDYmAebKmacJik6lXL7cpeIC6rwATTAP7NFqSE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770224227; c=relaxed/simple; bh=ZivfBH0pEG4OjDURL8yFoqxmFXC7fBU5AcV2Oyc+8xg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=q31vssLI/6tBOp0YU5OAFiGE5zwvp01o3eCvTCCo5rdMlUQ6Er3uspeovsTaURoErYy51QWk0aphtGQFmqFwNpMpAJTvSpubIdCIezrmgi1afXOAU+C4PETBoKQHHf4xrFWm0G8IKBBIAKAcBrU9Yu5BrsIySQTLetmUbiMl9vA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shazbot.org; spf=pass smtp.mailfrom=shazbot.org; dkim=pass (2048-bit key) header.d=shazbot.org header.i=@shazbot.org header.b=4E9zDR/3; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=kUnfeGhB; arc=none smtp.client-ip=202.12.124.156 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shazbot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shazbot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shazbot.org header.i=@shazbot.org header.b="4E9zDR/3"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="kUnfeGhB" Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id 56E537A00E6; Wed, 4 Feb 2026 11:57:04 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Wed, 04 Feb 2026 11:57:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shazbot.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1770224224; x=1770310624; bh=DMO79s1OU3juZ2+ahMo1gfPAr0s4Mn0ZEH9LRYL3vv0=; b= 4E9zDR/3sr/FZ2Suz9hMpeD0Lnw9/HEY8CCWzuPTFUlCRgk/07X0XK4fG5aGG2li 0fatEfbpn9z0k5kHRO4s/aH7Pm+5fLGf9Cu5wSPzt2+oFxUejLwYdnAo8+vTTtX0 ppcuN4ypbdJkwOnXruWUQfw/0GT3rbfK3qQN9Mnf08mCo5AQBaBvPSlPSoRMUoTj iOXZEEkeA5xumAOiILKyx2I67bELe3qIddtsmC285w1VcTp+a7ofilThoTsvX+zx pO0/xWe8ljTI1odRRCmkzLFYSCFSpo5gzpclcgcbTGb3ljTcYnxK7Y9V/wpzpMyn zoAKW1DjfBti4jaWXz/GAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1770224224; x= 1770310624; bh=DMO79s1OU3juZ2+ahMo1gfPAr0s4Mn0ZEH9LRYL3vv0=; b=k UnfeGhB0XVIKkpNpr8r70uuFr+yVF4eXt8iIIRXXxj95qP0Utymcq8DPgYCYAIIU rEZGNuaB9G2Hn8XWUbdjTJ7y+DRD46zwKbYrPKP6U88INPsxVMbH1degOaxJIodR DKEX0B82teBXAIjtNB6G/+CBnk6SMyNskXcPOfYXJ9PCn1LgJrYuY33kwxQBiJSM +bxQJpKCVUNBF6ZzDSvQpb+hCK42zD5zrqVNNoIJeD/wSgKP3zU2ZFszbQlu1ELm Xs7ysqb+/GUvegntZfforGYZ/CMyDHerVQYaW4NKWptMZ1z+aeAET2E/KP/TYGkf KeEnDgEP8FPVgaex9yV8Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddukedvleejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkjghfofggtgfgsehtqhertdertdejnecuhfhrohhmpeetlhgvgicu hghilhhlihgrmhhsohhnuceorghlvgigsehshhgriigsohhtrdhorhhgqeenucggtffrrg htthgvrhhnpeeuvdevudfhleehgfffiefggfevkefhfeffheetfeejffekteeffffgffek ueeuteenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvgigsehshhgriigsohhtrdhorhhg pdhnsggprhgtphhtthhopeefgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheptg hhrhhishhtihgrnhdrkhhovghnihhgsegrmhgurdgtohhmpdhrtghpthhtoheplhgvohhn sehkvghrnhgvlhdrohhrghdprhgtphhtthhopehsuhhmihhtrdhsvghmfigrlheslhhinh grrhhordhorhhgpdhrtghpthhtoheprghlvgigrghnuggvrhdruggvuhgthhgvrhesrghm ugdrtghomhdprhgtphhtthhopegrihhrlhhivggusehgmhgrihhlrdgtohhmpdhrtghpth htohepshhimhhonhgrsehffhiflhhlrdgthhdprhgtphhtthhopehkrhgrgigvlhesrhgv ughhrghtrdgtohhmpdhrtghpthhtohepughmihhtrhihrdhoshhiphgvnhhkohestgholh hlrggsohhrrgdrtghomhdprhgtphhtthhopehguhhrtghhvghtrghnshhinhhghhestghh rhhomhhiuhhmrdhorhhg X-ME-Proxy: Feedback-ID: i03f14258:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 4 Feb 2026 11:57:00 -0500 (EST) Date: Wed, 4 Feb 2026 09:56:59 -0700 From: Alex Williamson 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?B?SGVsbHN0csO2bQ==?= , Rodrigo Vivi , Jason Gunthorpe , Kevin Tian , Joerg Roedel , Will Deacon , Robin Murphy , Felix Kuehling , 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 v7 7/8] vfio: Permit VFIO to work with pinned importers Message-ID: <20260204095659.5a983af2@shazbot.org> In-Reply-To: References: <20260131-dmabuf-revoke-v7-0-463d956bd527@nvidia.com> <20260131-dmabuf-revoke-v7-7-463d956bd527@nvidia.com> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.51; x86_64-pc-linux-gnu) 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-Transfer-Encoding: quoted-printable On Wed, 4 Feb 2026 17:21:45 +0100 Christian K=C3=B6nig wrote: > On 1/31/26 06:34, Leon Romanovsky wrote: > > From: Leon Romanovsky > >=20 > > Till now VFIO has rejected pinned importers, largely to avoid being used > > with the RDMA pinned importer that cannot handle a move_notify() to rev= oke > > access. > >=20 > > Using dma_buf_attach_revocable() it can tell the difference between pin= ned > > importers that support the flow described in dma_buf_invalidate_mapping= s() > > and those that don't. > >=20 > > Thus permit compatible pinned importers. > >=20 > > This is one of two items IOMMUFD requires to remove its private interfa= ce > > to VFIO's dma-buf. > >=20 > > Reviewed-by: Kevin Tian > > Reviewed-by: Alex Williamson > > Reviewed-by: Christian K=C3=B6nig > > Signed-off-by: Leon Romanovsky > > --- > > drivers/vfio/pci/vfio_pci_dmabuf.c | 15 +++------------ > > 1 file changed, 3 insertions(+), 12 deletions(-) > >=20 > > diff --git a/drivers/vfio/pci/vfio_pci_dmabuf.c b/drivers/vfio/pci/vfio= _pci_dmabuf.c > > index 78d47e260f34..a5fb80e068ee 100644 > > --- a/drivers/vfio/pci/vfio_pci_dmabuf.c > > +++ b/drivers/vfio/pci/vfio_pci_dmabuf.c > > @@ -22,16 +22,6 @@ struct vfio_pci_dma_buf { > > u8 revoked : 1; > > }; > > =20 > > -static int vfio_pci_dma_buf_pin(struct dma_buf_attachment *attachment) > > -{ > > - return -EOPNOTSUPP; > > -} > > - > > -static void vfio_pci_dma_buf_unpin(struct dma_buf_attachment *attachme= nt) > > -{ > > - /* Do nothing */ > > -} > > - =20 >=20 > This chunk here doesn't want to apply to drm-misc-next, my educated > guess is that the patch adding those lines is missing in that tree. >=20 > How should we handle that? Patches 1-3 have already been pushed to > drm-misc-next and I would rather like to push patches 4-6 through > that branch as well. >=20 > I can request a backmerge from the drm-misc-next maintainers, but > then we clearly don't get that upstream this week. Hmm, drm-next already has a backmerge up to v6.19-rc7, the patch here is based on a commit merged in rc8. The tag for that change was based on rc6. It can be found here: https://github.com/awilliam/linux-vfio.git tags/vfio-v6.19-rc8 As the same tag Linus merged in: 1f97d9dcf536 ("Merge tag 'vfio-v6.19-rc8' of https://github.com/awilliam/li= nux-vfio") drm-misc-next only seems to be based on v6.19-rc1 though, so I don't know that any of that helps. Thanks, Alex > > static int vfio_pci_dma_buf_attach(struct dma_buf *dmabuf, > > struct dma_buf_attachment > > *attachment) { > > @@ -43,6 +33,9 @@ static int vfio_pci_dma_buf_attach(struct dma_buf > > *dmabuf, if (priv->revoked) > > return -ENODEV; > > =20 > > + if (!dma_buf_attach_revocable(attachment)) > > + return -EOPNOTSUPP; > > + > > return 0; > > } > > =20 > > @@ -107,8 +100,6 @@ static void vfio_pci_dma_buf_release(struct > > dma_buf *dmabuf) } > > =20 > > static const struct dma_buf_ops vfio_pci_dmabuf_ops =3D { > > - .pin =3D vfio_pci_dma_buf_pin, > > - .unpin =3D vfio_pci_dma_buf_unpin, > > .attach =3D vfio_pci_dma_buf_attach, > > .map_dma_buf =3D vfio_pci_dma_buf_map, > > .unmap_dma_buf =3D vfio_pci_dma_buf_unmap, > > =20 >=20 >=20