The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* RE: How to express "externally managed" IOMMU domains for VFIO/IOMMUFD ?
       [not found]   ` <20260426133027.GB3501894@ziepe.ca>
@ 2026-05-07  8:02     ` Tian, Kevin
  2026-05-09 17:00       ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Tian, Kevin @ 2026-05-07  8:02 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Teddy Astie, iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
	Xen-devel

> From: Jason Gunthorpe <jgg@ziepe.ca>
> Sent: Sunday, April 26, 2026 9:30 PM
> 
> On Thu, Apr 23, 2026 at 08:01:50AM +0000, Tian, Kevin wrote:
> > > On Xen, we have a dedicated hypercalls for moving a device into another
> > > guest (so it no longer belongs in Dom0, at far as DMA is concerned).
> > >
> > > But it looks like there are no way to describe that idea of "attach that
> > > device to this VM" nor "the device is in a VM"; which makes that
> > > impracticable.
> > >
> > > There may be things that could be done with the vIOMMU objects, but
> > > there would be no "parent domain" in such case, as said earlier it
> > > doesn't exist in the IOMMU subsystem.
> > >
> > > What is expected to be done instead ?
> > >
> > > Teddy
> > >
> > > [1] https://www.youtube.com/watch?v=pLMGRgEJ-Eg
> > >
> >
> > It'd be much easier to collect comments if you can put plain words
> > to explain the problem rather than expecting other folks to watch
> > the video first...
> 
> It sounds like CC and pkvm to me so I think it should re-use those
> mechanisms..
> 

for CC and pkvm the guest memory is still allocated from host.

for Xen the guest memory is allocated from hypervisor and invisible
to Dom0. iirc its device assignment is implemented by the toolstack
issuing hypercall to hypervisor, bypassing the Dom0 kernel.

I don't know the latest status in Xen side. Seems it's still the case and
Astie is trying to find a way to orchestrate it via VFIO. But it's unclear
what his proposal is...

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to express "externally managed" IOMMU domains for VFIO/IOMMUFD ?
  2026-05-07  8:02     ` How to express "externally managed" IOMMU domains for VFIO/IOMMUFD ? Tian, Kevin
@ 2026-05-09 17:00       ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2026-05-09 17:00 UTC (permalink / raw)
  To: Tian, Kevin
  Cc: Teddy Astie, iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
	Xen-devel

On Thu, May 07, 2026 at 08:02:40AM +0000, Tian, Kevin wrote:
> > From: Jason Gunthorpe <jgg@ziepe.ca>
> > Sent: Sunday, April 26, 2026 9:30 PM
> > 
> > On Thu, Apr 23, 2026 at 08:01:50AM +0000, Tian, Kevin wrote:
> > > > On Xen, we have a dedicated hypercalls for moving a device into another
> > > > guest (so it no longer belongs in Dom0, at far as DMA is concerned).
> > > >
> > > > But it looks like there are no way to describe that idea of "attach that
> > > > device to this VM" nor "the device is in a VM"; which makes that
> > > > impracticable.
> > > >
> > > > There may be things that could be done with the vIOMMU objects, but
> > > > there would be no "parent domain" in such case, as said earlier it
> > > > doesn't exist in the IOMMU subsystem.
> > > >
> > > > What is expected to be done instead ?
> > > >
> > > > Teddy
> > > >
> > > > [1] https://www.youtube.com/watch?v=pLMGRgEJ-Eg
> > > >
> > >
> > > It'd be much easier to collect comments if you can put plain words
> > > to explain the problem rather than expecting other folks to watch
> > > the video first...
> > 
> > It sounds like CC and pkvm to me so I think it should re-use those
> > mechanisms..
> > 
> 
> for CC and pkvm the guest memory is still allocated from host.

From an iommu perspective that doesn't entirely matter, what it sees
is that the translation is controlled by some secure world and it
only needs a way to associate the kvm handle for the secure world with
any required call for configuring the viommu.

It is not very different from KVM installing encrypted pages that have
been completed unmapped from all page tables in the hypervisor into
the VM's secure EPT through TDX calls and then iommufd creating a
viommu that re-uses the secure EPT.

The only thing dealing with the memory map is KVM. I'd expect Xen to
work the same, however the invisible memory was affiliated with the VM
through KVM the iommu side should pick up the KVM and then request a
VIOMMU to be setup for the VFIO device on the target KVM and that
should trigger the hypercalls to move the device into the selected
guest.

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-09 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1776873531.8631fc262581453bbf619ec5b2062170.19db5ea67ab000f373@vates.tech>
     [not found] ` <BN9PR11MB5276B3A829AD624A7E1AB4408C2A2@BN9PR11MB5276.namprd11.prod.outlook.com>
     [not found]   ` <20260426133027.GB3501894@ziepe.ca>
2026-05-07  8:02     ` How to express "externally managed" IOMMU domains for VFIO/IOMMUFD ? Tian, Kevin
2026-05-09 17:00       ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox