Re: [PATCH v5 09/14] PCI: portdrv: Suppress kernel DMA ownership auto-claiming
From: Jason Gunthorpe
Date: Tue Jan 04 2022 - 14:26:21 EST
On Tue, Jan 04, 2022 at 11:06:31AM -0600, Bjorn Helgaas wrote:
> > The existing vfio framework allows the portdrv driver to be bound
> > to the bridge while its downstream devices are assigned to user space.
>
> I.e., the existing VFIO framework allows a switch to be in the same
> IOMMU group as the devices below it, even though the switch has a
> kernel driver and the other devices may have userspace drivers?
Yes, this patch exists to maintain current VFIO behavior which has this
same check.
I belive the basis for VFIO doing this is that the these devices
cannot do DMA, so don't care about the DMA API or the group->domain,
and do not expose MMIO memory so do not care about the P2P attack.
A comment in the code to this effect would be good, IMHO.
Jason