Re: [RFC PATCH 1/5] PCI: Refuse function reset of an SR-IOV PF with enabled VFs

Jason Gunthorpe <[email protected]>
Newsgroups org.kernel.vger.linux-pci,org.kernel.vger.kvm,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Fri, Aug 14, 2026 at 08:37:37AM -0600, Alex Williamson wrote:

> Devices are only ever opened into a user owned domain, the IOMMU
> context switch happens before this and regardless of the reset.  Close
> also disables bus-master regardless of reset, so there's no risk of
> ongoing DMA if the device is placed into an identity domain between
> close and re-open.

I've been told by HW people that bus-master isn't actually a strong
fence for stopping DMA on most real HW. More of a 'dma will eventually
stop' kind of thing.

It does reliably prevent DMA during the post-FLR phase only.

If the device hasn't been reset it should be kept on a blocking
domain.

> PF, I think there are arguments both that the user implicitly opted in
> to the best-effort reset, as well as a use case that allows the PF
> driver to fail and re-open the PF demands this behavior.

I really think we cannot alow a device to be returned back to the
kernel without a reset. VFIO should be keeping things attached to a
blocking domain as long as the driver is bound. It should force a
reset during unbinding as well if the device FD was ever closed
without a reset..

Jason
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.