main-- / windows-gaming

This project makes it easy and straightforward to set up PCI/VGA passthrough on your system. - OR AT LEAST IT WOULD, IF IT WASNT DEAD
6 stars 1 forks source link

Rework everything #105

Closed main-- closed 7 years ago

main-- commented 7 years ago

Things are simple, really.

VFIO 2.0 Episode 2 Reborn: Global Offensive Infinite U Vita

To pass through a generic PCI device into the VM, we need to take care of:

IOMMU grouping

Simple to check in sysfs as soon as iommu is enabled. Ignore PCI bridges (maybe figure out why?) but make sure we're passing everything else, no exceptions.

Resetting

Bind the device

The easy part: Look at what devices we have and translate that into qemu parameters.

Simplify the world

Just learn more about vfio-pci and device binding in general - we might be able to work without kernel parameters or without these weird config changes. The tool as it is today only replicates a setup that worked for me once, it does not try very hard at being robust or elegant.

vfio-bind

New tool: suid binary that rebinds all resettable PCI devices from the config to vfio-pci via the simple sysfs trick (modern version):

echo vfio-pci > /sys/bus/pci/devices/0000\:04\:00.0/driver_override
echo '0000:04:00.0' > /sys/bus/pci/devices/0000\:04\:00.0/driver/unbind
echo '0000:04:00.0' > /sys/bus/pci/drivers_probe