[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <cd6f8c6b-6950-4b06-8f2d-bb4ead660ead@app.fastmail.com>
Date: Thu, 20 Nov 2025 17:40:15 -0700
From: "Alex Williamson" <alex@...zbot.org>
To: "Jason Gunthorpe" <jgg@...pe.ca>
Cc: "Leon Romanovsky" <leon@...nel.org>,
"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>,
"Andrew Morton" <akpm@...ux-foundation.org>,
"Jonathan Corbet" <corbet@....net>,
"Sumit Semwal" <sumit.semwal@...aro.org>,
Christian König <christian.koenig@....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 v9 10/11] vfio/pci: Add dma-buf export support for MMIO regions
On Thu, Nov 20, 2025, at 5:23 PM, Jason Gunthorpe wrote:
> On Thu, Nov 20, 2025 at 05:04:13PM -0700, Alex Williamson wrote:
>
>> @@ -2501,7 +2501,7 @@ static int vfio_pci_dev_set_hot_reset(struct vfio_device_set *dev_set,
>> err_undo:
>> list_for_each_entry_from_reverse(vdev, &dev_set->device_list,
>> vdev.dev_set_list) {
>> - if (__vfio_pci_memory_enabled(vdev))
>> + if (vdev->vdev.open_count && __vfio_pci_memory_enabled(vdev))
>> vfio_pci_dma_buf_move(vdev, false);
>> up_write(&vdev->memory_lock);
>> }
>>
>> Any other suggestions? This should be the only reset path with this
>> nuance of affecting non-opened devices. Thanks,
>
> Seems reasonable, but should it be in __vfio_pci_memory_enabled() just
> to be robust?
__vfio_pci_memory_enabled() currently only requires holding memory_lock, I don't think we want to create a dependency on dev_set->lock for this unique call path. Thanks,
Alex
Powered by blists - more mailing lists