Re: [PATCH 3/5] iommu/virtio: Move to domain_alloc_paging()

Jacob Pan
2025-02-13T05:47:25Z

Hi Jason,

On Wed, 12 Feb 2025 19:30:53 -0400
Jason Gunthorpe <jgg@nvidia.com> wrote:

> On Wed, Feb 12, 2025 at 11:22:35AM -0800, Jacob Pan wrote:
>
> > Do you foresee the implementation can leverage your generic iommu_pt
> > work? i.e. for building guest IO page tables. It will add a new
> > flavor (page table based in addition to map/unmap) to
> > viommu_domain_alloc_paging() i think.
>
> Yes I do, I think it should be no problem and it will bring the
> missing x86 formats that are currently not available in iopgtbl
> wrappers.
I guess the missing x86 formats are AMDv2 and VT-d S1?

> I'm working toward getting a cut back AMD only series ready to post,
> the other series on the iommu-pages should be the last preperation
> work.
>
> Certainly I would be happy to help you get it implemented if that is
> your interest.

Yes, that is definitely our interest! We are looking at expanding
hyperv-iommu to include guest DMA remapping support (current code has
IRQ remapping only). This expansion includes paging and sva domains. In
terms of the need for paging domain, I believe it is identical to
virtio-iommu page table extensions.

It would be great if you could help adding/accommodating such usage to
the generic iommu_pt. I think it will be a subset of features as
intended for iommufd. I.e. map/unmap operation.

One difference/simplification than virtio-iommu is that Hyperv-iommu
(backend) does not want to support map/unmap hypercall based paging
domain. IOW, page table based paging domain only, let the guest own S1.

Our code and backend support are still in the early stages, that is why
I am attempting to convert virtio-iommu driver to iommu_pt. Not sure if
anyone has done the QEMU part to support VIRTIO_IOMMU_F_ATTACH_TABLE?
@Jean @Eric Do you know?

Adding a couple developers from our side. @Yu Zhang @Easwar Hariharan.