Hi,

On Thu, Nov 05, 2020 at 12:13:53AM +0000, Yinghan Yang via iommu wrote:
> Hi iommu developers,
> 
>  
> 
> I have a question regarding the recent VIOT submission for supporting
> paravirtualized IOMMU in guests. The spec defines PCI Range Node Structure
> (5.2.30.3) that maps to a single PCI segment.

(To provide some context for other readers, a description of the node is
available at https://jpbrucker.net/virtio-iommu/viot/viot-v8.pdf)

> 
>  
> 
> Is it possible for the new table to express that an IOMMU covers all PCI
> segments?  This could help support scenarios where:
> 
>  
> 
>  1. Devices are dynamically assigned to guests during runtime
>  2. Devices in the same guests are assigned to different segments.

This is possible with the current descriptor, assuming the PCI segments
are static. The platform can provide a PCI Range Node for each segment,
with a BDF range 0 - 0xffff. For example a table could describe:

* PCI Range Node
  * PCI Segment: 0
  * BDF start: 0
  * BDF end: 0xffff
  * Endpoint start: 0
  * Output node: &viommu
* PCI Range Node
  * PCI Segment: 1
  * BDF start: 0
  * BDF end: 0xffff
  * Endpoint start: 0x10000
  * Output node: &viommu
* viommu Node

Then the IOMMU covers all PCI devices on the two segments. To identify a
device when configuring DMA translation, the IOMMU driver builds a 32-bit
endpoint ID = Endpoint start + BDF.

Thanks,
Jean
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to