Skip to content

Commit

Permalink
Added flag: -iommugroups to color-print iommu groups then exit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jared Johnstone committed Oct 7, 2020
1 parent 9e38919 commit 76777c4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ This example would catch any:

3. A PCI device with ID `10ec:8168`.

`-taskset 0,1,2,3,4,5` / `-taskset 0,2,4,8`
`-taskset 0,1,2,3,4,5` / `-taskset 0,2,4,8`

The taskset argument will take the threads you give it and only lets the VM execute on those threads. It also creates only that many threads on the VM. (6 and 4 in the examples respectively)
This can significantly reduce latency if the guestis having trouble, even if you haven't configured any host pinning.
Expand All @@ -157,6 +157,10 @@ This example would catch any:

A quick terminal color test then exits.

`-iommugroups` / `-iommugrouping`

Prints IOMMU groupings if available then exists.

## Notes and Gotchas.
- If you don't set any `-usb` or `-pci` arguments the VM will run in a window on your desktop as is normal for Qemu. Useful for testing the VM actually boots, installing OSes or using liveCDs.
- The absolute minimum requirement to get started is the `-image` and `-iso` arguments with OVMF available. You can install an OS, VirtIO+Nvidia drivers if needed, and have it ready for a passthrough on the next boot.
Expand Down
10 changes: 8 additions & 2 deletions main
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,16 @@ while [ $# -gt 0 ]
do
case "$1" in
-colortest|-colourtest)
echo "Ok, doing a color test then exiting..."
echo -e "${colors[green]}Ok, printing a color test then exiting...${colors[white]}"
for i in $(sort <<< ${!colors[@]}) ; do echo -e "Test for: ${colors[$i]}$i ${colors[white]}" ; done
exit 0
exit $?
;;
-iommugroups|-iommugrouping)
echo -e "${colors[green]}Ok, printing IOMMU Groups then exiting...${colors[white]}"
iommuDir="/sys/kernel/iommu_groups";
if [ -d $iommuDir ]; then for g in `ls -1v $iommuDir`; do echo "IOMMU Group $g"; for d in $iommuDir/$g/devices/* ; do echo -e "${colors[cyan]}\t$(lspci -nns ${d##*/})${colors[white]}"; done; done ; else echo "Couldn't find $iommuDir" ; fi
exit $?
;;
-bridge|-BRIDGE)
bridgeArgs="$(sed 's/,/ /g' <<<$2)"
shift
Expand Down

0 comments on commit 76777c4

Please sign in to comment.