Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find the devices of an iommu group

Tags:

iommu

I am using the IOMMU API for linux and I would like to get a specific device that belongs to a specific group of a known group ID.

The iommu_group structure has a field for the device list but it is not accessible. Is there a way to get it?

like image 502
John Vardas Avatar asked Oct 23 '25 13:10

John Vardas


2 Answers

Please try:

find /sys/kernel/iommu_groups/ -type l

Rami Rosen

like image 85
Rami Rosen Avatar answered Oct 27 '25 02:10

Rami Rosen


Question too short. Neither the computer description, neither level of your knowledge. Also the time is a little passed.

Well, iommu groups are mainly used for passing the device through the host computer to hosted virtual machine.

You definitely must have mother-board, BIOS, CPU, and kernel supporting virtual technologies with all necessary switches enabled and modules loaded. Than you can list a pci devices and their iommu grouping. By using Linux kernel > 4.2 (I use kernel 4.8 in Debian 9) you can simply type:

# dmesg |egrep group |awk '{print $NF" "$0}' |sort -n

as root to obtain the group sorted listing of PCI devices.

There are standard and shortned methods how to unbind the group member devices from the kernel driver and how to rebind it with dummy pci-stub or vfio-pci driver.

In case I told here something you know, sorry you didnot tell me enough I can note it. :-)

J.

like image 26
schweik Avatar answered Oct 27 '25 00:10

schweik