From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (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 ABC9033E367 for ; Wed, 4 Feb 2026 16:55:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.196 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770224110; cv=none; b=X+q+v4gVW+TBOLwYgemaDW3YEg0yuBP2YytPxTpmIzm6/ER6H10GHDL91QpMWxcrmY63T5qMT/myqYBRIxbUXSvPV04PzzSencvHuTcrq15uBAcqsF4kkyrYwTpHecduAcw+Rf45DBeEdXgIuB5g56h8wt0nCK67wcRvpjv8z/c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770224110; c=relaxed/simple; bh=5K5fR+HxBrdqjMKErGIv55w9oITaTZk9Qf+xlROKnSo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eWnhbiDxT56P2sqZDCVWyoOkcWToQXhroQuGD4gIsgjEALj2UtJAgDnPFltHY5fPINfrNeUZq6bIuHi6VXPJuUyKgi8x9jjmMi4cVY4dOFAvW///NB2mzmo/PbNZLWwFXlRr/dNds78EAdlzv19A1mCOLQgSOsxJEY3wJTiCLww= 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=dJ3wMTjl; arc=none smtp.client-ip=209.85.222.196 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="dJ3wMTjl" Received: by mail-qk1-f196.google.com with SMTP id af79cd13be357-8c710439535so563070185a.1 for ; Wed, 04 Feb 2026 08:55:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1770224108; x=1770828908; 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=+k5zz356tCtx+TsrSTgNS2LOgl52lZtCniOLQPd/1s0=; b=dJ3wMTjlcrFt0OJax/CsfN1yUyB6wvWMaelcWV9nhohy8QA3GVs7AF6ZtNBdf9OjXZ ajkkkzyh+ZvPwYDwiFPktPG7VGNkGPuB03uPbwGQFroNvICbrlkz9Z7q6QgY8p4Srvmy aoD+KvnxxZ/ClqJg66luHVlFyv045VhXvyEvAs/+6pRZyqjBx5MsAhNeUwPJ00he+TTL 9jkH7yrYoucRIQdFBYM6v+ePbpC6OHYM39YtbPIn6Dfa/zLh0h5wzq/0TmheDXvPv6mp XBxl7+OdSx9S3klWiruBg0MptbEC0lznV5E0sHEmcIc6uOdE9MX3ZF5AEBrNGgBV9aX5 wo4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770224108; x=1770828908; 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=+k5zz356tCtx+TsrSTgNS2LOgl52lZtCniOLQPd/1s0=; b=fq5ZW3CZzczCpA4RXnqG7JRDZrpfYreJ2I08Q8vE5T3aHCjjWi0ISQ4+xvDq5ccpx7 faSHk7/I9fc46I18z9Nb9/z7u0r670qQGrSpAiFSVuRRSBWORZTbUQ5UuRQMbWeVIRNL Cr6IzMbgQYXT+6nfELI4u0qSVqVabOpUcbpDruwlgbHuYYjxSXLliwo5spQ7v2JMiq6A mzVBnyPB7EVyMDop7Zk4HEC9F6gO+w+aL3b8NhHIVi47wyE4Uh8Hh2ItIrdKIu5pfTq9 t55oPQoL1M4aX1scqO5H3u1Y44Zn3mucPxMp1dUEBUb00Y50dersSyfLedLoHzz7fCW2 jjrA== X-Forwarded-Encrypted: i=1; AJvYcCWsplFbTewimV02/5SyDjlWisGfpGLku6BMC4jL7WrJ9bl/Tvs5TM/mkBs+bKpkE9hi5CdMAVHEm1jXZXA=@vger.kernel.org X-Gm-Message-State: AOJu0Yx9xY+aFIKiP1mLyTHufTUoyXejwrytEAqQjTIFWHebujZoI+pQ x4m7Am4/vFQCCaWqwxZoKM2rqL6XBU61fOYkgLYYUmvC8xJt/tXukEQx7oLmjDVNcG4= X-Gm-Gg: AZuq6aKFwHwbgSdfVRjZchzi8LbxTKMAvqrlju6TTy1CCDqXu+doaznIas80v/f3UB0 DurWs5dv6r1KrxwiIU/xrplQgyQAARQO9T5aZ0BxgyiBc+dK5vH1KqVaCGgD0OCblCv2DTAIm48 8NvGEuE0co1cOYHZMYySszOsvBlX5BSfqXKNSzVWOr11k1jeSvuMEhBubsRgHMYk5x/Lf53KsOn ayAr70mkpAlaDv5QUql3X1seN5iXUy49cjuwK8YEc3VhnoJ4qz9WsDqHkX2k8H6NIPZEJaiLTbr VXlVwhEAtRGUlYUOFdr5QdrLRgt+qmwIzcdb6p2GiJOUZ1j+Z06DzuQnbSYupUgrm5LLNdRnOZ+ 9xhLu9sx2po73M1Np7Caae/uo2MRPV7RbvoKt7gXCG0341XApeaqIg3ufUFbjT+RpgChy3Hmjmx DYxVBKkhW2oxDyalSum/jJb0DvJE/VftT2xM72zqwMJLlsvQV3LU+lO+265oKNMlto2Uw= X-Received: by 2002:a05:620a:4627:b0:8c7:177f:cc17 with SMTP id af79cd13be357-8ca2f9bbb5amr467025085a.46.1770224108469; Wed, 04 Feb 2026 08:55:08 -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-8ca2fd2cfb4sm226461485a.33.2026.02.04.08.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Feb 2026 08:55:07 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1vng9j-0000000HH15-13rk; Wed, 04 Feb 2026 12:55:07 -0400 Date: Wed, 4 Feb 2026 12:55:07 -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 v7 7/8] vfio: Permit VFIO to work with pinned importers Message-ID: <20260204165507.GH2328995@ziepe.ca> References: <20260131-dmabuf-revoke-v7-0-463d956bd527@nvidia.com> <20260131-dmabuf-revoke-v7-7-463d956bd527@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@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 Wed, Feb 04, 2026 at 05:21:45PM +0100, Christian König wrote: > On 1/31/26 06:34, Leon Romanovsky wrote: > > From: Leon Romanovsky > > > > Till now VFIO has rejected pinned importers, largely to avoid being used > > with the RDMA pinned importer that cannot handle a move_notify() to revoke > > access. > > > > Using dma_buf_attach_revocable() it can tell the difference between pinned > > importers that support the flow described in dma_buf_invalidate_mappings() > > and those that don't. > > > > Thus permit compatible pinned importers. > > > > This is one of two items IOMMUFD requires to remove its private interface > > to VFIO's dma-buf. > > > > Reviewed-by: Kevin Tian > > Reviewed-by: Alex Williamson > > Reviewed-by: Christian König > > Signed-off-by: Leon Romanovsky > > --- > > drivers/vfio/pci/vfio_pci_dmabuf.c | 15 +++------------ > > 1 file changed, 3 insertions(+), 12 deletions(-) > > > > 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; > > }; > > > > -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 *attachment) > > -{ > > - /* Do nothing */ > > -} > > - > > 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. Yes. It looks like Alex took it to his next tree: commit 61ceaf236115f20f4fdd7cf60f883ada1063349a Author: Leon Romanovsky Date: Wed Jan 21 17:45:02 2026 +0200 vfio: Prevent from pinned DMABUF importers to attach to VFIO DMABUF Some pinned importers, such as non-ODP RDMA ones, cannot invalidate their mappings and therefore must be prevented from attaching to this exporter. Fixes: 5d74781ebc86 ("vfio/pci: Add dma-buf export support for MMIO regions") Signed-off-by: Leon Romanovsky Reviewed-by: Pranjal Shrivastava Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20260121-vfio-add-pin-v1-1-4e04916b17f1@nvidia.com Signed-off-by: Alex Williamson The very best thing would be to pull 61ceaf236115f20f4fdd7cf60f883ada1063349a which is cleanly based on v6.19-rc6 ? > 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. Or we get Alex to take a branch from you for the first 3 and push it? Jason