Hi Eric, > From: Auger Eric < eric.auger@xxxxxxxxxx> > Sent: Tuesday, March 31, 2020 1:30 AM > To: Liu, Yi L <yi.l.liu@xxxxxxxxx>; qemu-devel@xxxxxxxxxx; > Subject: Re: [PATCH v2 06/22] hw/pci: introduce > pci_device_set/unset_iommu_context() > > Yi, > On 3/30/20 6:24 AM, Liu Yi L wrote: > > This patch adds pci_device_set/unset_iommu_context() to set/unset > > host_iommu_context for a given device. New callback is added in > > PCIIOMMUOps. As such, vIOMMU could make use of host IOMMU capability. > > e.g setup nested translation. > > I think you need to explain what this practically is supposed to do. > such as: by attaching such context to a PCI device (for example VFIO > assigned?), you tell the host that this PCIe device is protected by a FL > stage controlled by the guest or something like that - if this is > correct understanding (?) - I'd like to say by attaching such context to a PCI device (for example VFIO assigned), this PCIe device is protected by a host IOMMU w/ nested-translation capability. Its DMA would be protected either through the FL stage controlled by the guest together with a SL stage page table owned by host or a single stage page table owned by host (e.g. shadow solution). It depends on the choice of vIOMMU the pci_device_set/unset_iommu_context() finally pass the context to vIOMMU. If vIOMMU binds guest FL stage page table to host, then it is prior case. If vIOMMU doesn't, do bind, then it is the latter case. Regards, Yi Liu