diff options
author | Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com> | 2022-10-25 19:20:04 +0300 |
---|---|---|
committer | Juergen Gross <jgross@suse.com> | 2022-12-05 12:59:49 +0100 |
commit | ef8ae384b4c9ccefecf4754f34644bd9fb0105b7 (patch) | |
tree | 600d4e8c4aff4670482177e63077d43834c09d7a /include/xen | |
parent | 035e3a4321f73c352b6408ec2153fa5bc3feb459 (diff) |
xen/virtio: Handle PCI devices which Host controller is described in DT
Use the same "xen-grant-dma" device concept for the PCI devices
behind device-tree based PCI Host controller, but with one modification.
Unlike for platform devices, we cannot use generic IOMMU bindings
(iommus property), as we need to support more flexible configuration.
The problem is that PCI devices under the single PCI Host controller
may have the backends running in different Xen domains and thus have
different endpoints ID (backend domains ID).
Add ability to deal with generic PCI-IOMMU bindings (iommu-map/
iommu-map-mask properties) which allows us to describe relationship
between PCI devices and backend domains ID properly.
To avoid having to look up for the PCI Host bridge twice and reduce
the amount of checks pass an extra struct device_node *np to
xen_dt_grant_init_backend_domid().
So with current patch the code expects iommus property for the platform
devices and iommu-map/iommu-map-mask properties for PCI devices.
The example of generated by the toolstack iommu-map property
for two PCI devices 0000:00:01.0 and 0000:00:02.0 whose
backends are running in different Xen domains with IDs 1 and 2
respectively:
iommu-map = <0x08 0xfde9 0x01 0x08 0x10 0xfde9 0x02 0x08>;
Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Link: https://lore.kernel.org/r/20221025162004.8501-3-olekstysh@gmail.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'include/xen')
0 files changed, 0 insertions, 0 deletions