lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251102080137.209aa567@shazbot.org>
Date: Sun, 2 Nov 2025 08:01:37 -0700
From: Alex Williamson <alex@...zbot.org>
To: Leon Romanovsky <leon@...nel.org>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>,
 Logan Gunthorpe <logang@...tatee.com>, Jens Axboe <axboe@...nel.dk>,
 Robin Murphy <robin.murphy@....com>, Joerg Roedel <joro@...tes.org>,
 Will Deacon <will@...nel.org>,
 Marek Szyprowski <m.szyprowski@...sung.com>,
 Jason Gunthorpe <jgg@...pe.ca>,
 Andrew Morton <akpm@...ux-foundation.org>,
 Jonathan Corbet <corbet@....net>, Sumit Semwal <sumit.semwal@...aro.org>,
 Christian König <christian.koenig@....com>,
 Alex Williamson <alex.williamson@...hat.com>,
 Kees Cook <kees@...nel.org>,
 "Gustavo A. R. Silva" <gustavoars@...nel.org>,
 Ankit Agrawal <ankita@...dia.com>, Yishai Hadas <yishaih@...dia.com>,
 Shameer Kolothum <skolothumtho@...dia.com>,
 Kevin Tian <kevin.tian@...el.com>, Krishnakant Jaju <kjaju@...dia.com>,
 Matt Ochs <mochs@...dia.com>, linux-pci@...r.kernel.org,
 linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
 iommu@...ts.linux.dev, linux-mm@...ck.org, linux-doc@...r.kernel.org,
 linux-media@...r.kernel.org, dri-devel@...ts.freedesktop.org,
 linaro-mm-sig@...ts.linaro.org, kvm@...r.kernel.org,
 linux-hardening@...r.kernel.org,
 Vivek Kasireddy <vivek.kasireddy@...el.com>
Subject: Re: [PATCH v6 10/11] vfio/pci: Add dma-buf export support for MMIO
 regions

On Sun,  2 Nov 2025 10:00:58 +0200
Leon Romanovsky <leon@...nel.org> wrote:
> @@ -2391,6 +2403,7 @@ static int vfio_pci_dev_set_hot_reset(struct vfio_device_set *dev_set,
>  				      struct iommufd_ctx *iommufd_ctx)
>  {
>  	struct vfio_pci_core_device *vdev;
> +	bool restore_revoke = false;
>  	struct pci_dev *pdev;
>  	int ret;
>  
> @@ -2459,6 +2472,8 @@ static int vfio_pci_dev_set_hot_reset(struct vfio_device_set *dev_set,
>  			break;
>  		}
>  
> +		vfio_pci_dma_buf_move(vdev, true);
> +		restore_revoke = true;
>  		vfio_pci_zap_bars(vdev);
>  	}
>  
> @@ -2486,6 +2501,12 @@ static int vfio_pci_dev_set_hot_reset(struct vfio_device_set *dev_set,
>  			       struct vfio_pci_core_device, vdev.dev_set_list);
>  
>  err_undo:
> +	if (restore_revoke) {
> +		list_for_each_entry(vdev, &dev_set->device_list, vdev.dev_set_list)
> +			if (__vfio_pci_memory_enabled(vdev))
> +				vfio_pci_dma_buf_move(vdev, false);
> +	}
> +
>  	list_for_each_entry_from_reverse(vdev, &dev_set->device_list,
>  					 vdev.dev_set_list)

We don't need the separate loop or flag, and adding it breaks the
existing reverse list walk.  Thanks,

Alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ