Re: [PATCH v5 3/9] mshv: Introduce basic mshv bridge device for VFIO to build upon
From: Jason Gunthorpe
Date: Thu Sep 03 2026 - 11:11:38 EST
On Wed, Sep 02, 2026 at 11:19:05AM -0700, Jacob Pan wrote:
> If we do want to support this kvm-vfio bridge semantics beyond kvm,
> maybe this should be abstracted as a generic VFIO "hypervisor
> partition" association, with hypervisor-specific get/put callbacks,
> rather than adding an MSHV-only copy of the KVM hook.
> +Alex
I don't like this patch at all.
I think we should try to harmonize all these sort of "external" cases
as best we can. mshv, confidential compute, xen, etc all have a very
similar shape.
I am discussing here with Aneesh an approach to use the viommu almost
exclusively for this.
https://lore.kernel.org/all/20260902235609.GG2890729@xxxxxxxx/
Can you imagine a way to do that for your stuff?
In that case I imagine the iommufd vdevice create is what attaches the
vfio device to the partition, not a seperate ioctl over in some other
driver. When the viommu is created it knows what partition it is
affiliated with because it took in a FD that describes that partition.
Does mshv use KVM at all? Can a kvm fd describe the partition?
Jason