diff --git a/iommu.sh b/iommu.sh new file mode 100755 index 0000000..2dad4c6 --- /dev/null +++ b/iommu.sh @@ -0,0 +1,8 @@ +#!/bin/bash +shopt -s nullglob +for g in /sys/kernel/iommu_groups/*; do + echo "IOMMU Group ${g##*/}:" + for d in $g/devices/*; do + echo -e "\t$(lspci -nns ${d##*/})" + done; +done; diff --git a/iommureset.sh b/iommureset.sh new file mode 100755 index 0000000..86ca10d --- /dev/null +++ b/iommureset.sh @@ -0,0 +1,2 @@ +#!/bin/bash +for iommu_group in $(find /sys/kernel/iommu_groups/ -maxdepth 1 -mindepth 1 -type d);do echo "IOMMU group $(basename "$iommu_group")"; for device in $(\ls -1 "$iommu_group"/devices/); do if [[ -e "$iommu_group"/devices/"$device"/reset ]]; then echo -n "[RESET]"; fi; echo -n $'\t';lspci -nns "$device"; done; done diff --git a/usbiommu.sh b/usbiommu.sh new file mode 100755 index 0000000..49d5d06 --- /dev/null +++ b/usbiommu.sh @@ -0,0 +1,2 @@ +#!/bin/bash +for usb_ctrl in /sys/bus/pci/devices/*/usb*; do pci_path=${usb_ctrl%/*}; iommu_group=$(readlink $pci_path/iommu_group); echo "Bus $(cat $usb_ctrl/busnum) --> ${pci_path##*/} (IOMMU group ${iommu_group##*/})"; lsusb -s ${usb_ctrl#*/usb}:; echo; done