>-----Original Message----- >From: Cédric Le Goater <[email protected]> >Subject: Re: [PATCH v9 05/19] hw/pci: Introduce >pci_device_get_viommu_flags() > >Hi, > >On 12/15/25 07:50, Zhenzhong Duan wrote: >> Introduce a new PCIIOMMUOps optional callback, get_viommu_flags() >which >> allows to retrieve flags exposed by a vIOMMU. The first planned vIOMMU >> device flag is VIOMMU_FLAG_WANT_NESTING_PARENT that advertises the >> support of HW nested stage translation scheme and wants other sub-system >> like VFIO's cooperation to create nesting parent HWPT. >> >> pci_device_get_viommu_flags() is a wrapper that can be called on a PCI >> device potentially protected by a vIOMMU. >> >> get_viommu_flags() is designed to return 64bit bitmap of purely vIOMMU >> flags which are only determined by user's configuration, no host >> capabilities involved. Reasons are: >> >> 1. host may has heterogeneous IOMMUs, each with different capabilities >> 2. this is migration friendly, return value is consistent between source >> and target. >> >> Note that this op will be invoked at the attach_device() stage, at which >> point host IOMMU capabilities are not yet forwarded to the vIOMMU >through >> the set_iommu_device() callback that will be after the attach_device(). >> >> See below sequence: >> >> vfio_device_attach(): >> iommufd_cdev_attach(): >> pci_device_get_viommu_flags() for HW nesting cap >> create a nesting parent HWPT >> attach device to the HWPT >> vfio_device_hiod_create_and_realize() creating hiod >> ... >> pci_device_set_iommu_device(hiod) >> >> Suggested-by: Yi Liu <[email protected]> >> Signed-off-by: Zhenzhong Duan <[email protected]> >> Reviewed-by: Nicolin Chen <[email protected]> >> Reviewed-by: Eric Auger <[email protected]> >> Reviewed-by: Yi Liu <[email protected]> >> Reviewed-by: Cédric Le Goater <[email protected]> >> --- >> MAINTAINERS | 1 + >> include/hw/iommu.h | 25 +++++++++++++++++++++++++ > >All headers under include/hw/ have been moved to include/hw/core/. >iommu.h >should also be moved under the same directory. > >The series needs a respin because of these changes.
Thanks for reminder, I just sent v10 out for below two series. [PATCH v9 00/19] intel_iommu: Enable first stage translation for passthrough device [PATCH v9 0/4] Implement ERRATA_772415 quirk for VTD BRs, Zhenzhong
