Re: [Linuxarm] Re: [RFC PATCH 2/3] vfio/hisilicon: register the driver to vfio
From: Jason Gunthorpe
Date: Thu May 13 2021 - 14:34:57 EST
On Thu, May 13, 2021 at 12:22:32PM -0600, Alex Williamson wrote:
> If you expect this device to appear only as an integrated endpoint, then
> I think Jason's suggestion above is correct. Your driver that supports
> migration can refuse to load for devices there the topology is other
> than expected and you're effectively guaranteeing DMA isolation of the
> user and in-kernel drivers by hardware DMA semantics and topology.
Some kind of VFIO api 'vfio_is_this_pci_dev_is_safe_to_share()'
seems appropriate here.
I saw Intel doing the same thing in one of their VDPA driver proposals.
Jason