Products > Computers

VM and pci passthrough

(1/2) > >>

msuffidy:
In order to use a certain card in a vm of win7 32 under linux, I unbound all other pci devices in the iommu group as the desired card. So when this happens I can't use my motherboard gigabit nic and the cdrom is not connected, as well as some USB ports connected to the Southbridge. So up to now I sort of took it that I could never use those devices (until rebooting) again. Then I was thinking about it and wondering why I could not just have the host system talk to the devices in their new locations? It could be that they are not accessible due to environmental fencing at that point? Also it could be doable if Linux itself was being hypervised, but I don't want to deal with it. Just wondering if anyone knew if the computer itself could reclaim some of these vfio-pci devices? As it stands I am using a USB wireless dongle to be sending this.

msuffidy:
Have to review it but this sounds like a good overview of the problem.

msuffidy:
Another mostly day wasted on trying various combinations of things and not working. I am not pursuing it, but there was some potential to install the gigabit nic on the the vm side and somehow bond all the networks into one, or to somehow tunnel through the vm side to openwrt to unpack. I was also looking at maybe a usb to usb transfer on some sort between a openwrt router and the computer. A small but beneficial spin off was I noticed if I got the vm to claim the cdrom sata driver, I then have the cdrom in windows. So at that point I can copy it back to the host through a windows share. I am not messing with the ACS patch but there was a ACS option I left on in the BIOS that had no immediate effects.

msuffidy:
I made 2 shell scripts for before and after the vm is used so I can get the devices back by going between them. There is an issue with suspend after using the VM in fedora 34. It involves unbinding/binding to the /sys tree and rmmoding the vfio-pci module.

OK GOT IT TOTALLY TOGGLING NOW: a bit of a hauppage

[root@FRZNWSTE hacks]# cat unsafe-enter
#!/bin/bash
rmmod r8169
rmmod firewire_ohci
rmmod emu10k1_gp

echo "1" > /sys/bus/pci/devices/0000:06:00.0/remove
echo 0000:01:00.0 > /sys/bus/pci/devices/0000:01:00.0/driver/unbind
echo 0000:01:00.1 > /sys/bus/pci/devices/0000:01:00.1/driver/unbind
# echo 0000:03:00.0 > /sys/bus/pci/devices/0000:03:00.0/driver/unbind
echo 0000:05:01.0 > /sys/bus/pci/devices/0000:05:01.0/driver/unbind
# echo 0000:05:01.1 > /sys/bus/pci/devices/0000:05:01.1/driver/unbind
# echo 0000:05:01.2 > /sys/bus/pci/devices/0000:05:01.2/driver/unbind
# echo 0000:06:00.0 > /sys/bus/pci/devices/0000:06:00.0/driver/unbind
[root@FRZNWSTE hacks]# cat exit-win7
#!/bin/bash
rmmod vfio-pci

rmmod snd_emu10k1_synth
rmmod snd_emu10k1

echo "1" > /sys/bus/pci/devices/0000:01:00.0/remove
echo "1" > /sys/bus/pci/devices/0000:01:00.1/remove
echo "1" > /sys/bus/pci/devices/0000:03:00.0/remove
echo "1" > /sys/bus/pci/devices/0000:05:01.2/remove
echo "1" > /sys/bus/pci/devices/0000:05:01.1/remove
echo "1" > /sys/bus/pci/devices/0000:05:01.0/remove
echo "1" > /sys/bus/pci/rescan


I was having trouble with a HD TV over the air PCIe card. It seemed to be totally unstable doing the whatever, and what seems to work is removing it from the transaction BUS 6. Then I can suspend again also.

msuffidy:
Yes I was looking at those sort of options to solve the problem, but I like the cards where they are and I almost pursued a usb etthernet dongle, but it was not supported at this time for linux. I can do 60mbit through my wireless n 2.4 tp link dongle as it is. I have the option to stop the vm and put the system back to the way it was. It was tedious but it is over now and works in the on off manner.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod