foxlet / vmra1n

Guide on setting up checkra1n in QEMU.
63 stars 24 forks source link

i can't passthrough my devices #4

Open LaShakun opened 4 years ago

LaShakun commented 4 years ago

The error that I am getting is:

qemu-system-x86_64: -device vfio-pci,host=00:1d.2,bus=port.1: vfio 0000:00:1d.2: group 8 is not viable Please ensure all devices within the iommu_group are bound to their vfio bus driver. Here are my lsiommu results: IOMMU Group 0 00:00.0 Host bridge [0600]: Intel Corporation 5520/5500/X58 I/O Hub to ESI Port [8086:3405] (rev 13) IOMMU Group 10 00:1f.0 ISA bridge [0601]: Intel Corporation 82801JIR (ICH10R) LPC Interface Controller [8086:3a16] IOMMU Group 10 00:1f.2 IDE interface [0101]: Intel Corporation 82801JI (ICH10 Family) 4 port SATA IDE Controller #1 [8086:3a20] IOMMU Group 10 00:1f.3 SMBus [0c05]: Intel Corporation 82801JI (ICH10 Family) SMBus Controller [8086:3a30] IOMMU Group 10 00:1f.5 IDE interface [0101]: Intel Corporation 82801JI (ICH10 Family) 2 port SATA IDE Controller #2 [8086:3a26] IOMMU Group 11 02:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] [10de:1c03] (rev a1) IOMMU Group 11 02:00.1 Audio device [0403]: NVIDIA Corporation GP106 High Definition Audio Controller [10de:10f1] (rev a1) IOMMU Group 12 ff:00.0 Host bridge [0600]: Intel Corporation Xeon 5600 Series QuickPath Architecture Generic Non-core Registers [8086:2c70] (rev 02) IOMMU Group 12 ff:00.1 Host bridge [0600]: Intel Corporation Xeon 5600 Series QuickPath Architecture System Address Decoder [8086:2d81] (rev 02) IOMMU Group 13 ff:02.0 Host bridge [0600]: Intel Corporation Xeon 5600 Series QPI Link 0 [8086:2d90] (rev 02) IOMMU Group 13 ff:02.1 Host bridge [0600]: Intel Corporation Xeon 5600 Series QPI Physical 0 [8086:2d91] (rev 02) IOMMU Group 13 ff:02.2 Host bridge [0600]: Intel Corporation Xeon 5600 Series Mirror Port Link 0 [8086:2d92] (rev 02) IOMMU Group 13 ff:02.3 Host bridge [0600]: Intel Corporation Xeon 5600 Series Mirror Port Link 1 [8086:2d93] (rev 02) IOMMU Group 13 ff:02.4 Host bridge [0600]: Intel Corporation Xeon 5600 Series QPI Link 1 [8086:2d94] (rev 02) IOMMU Group 13 ff:02.5 Host bridge [0600]: Intel Corporation Xeon 5600 Series QPI Physical 1 [8086:2d95] (rev 02) IOMMU Group 14 ff:03.0 Host bridge [0600]: Intel Corporation Xeon 5600 Series Integrated Memory Controller Registers [8086:2d98] (rev 02) IOMMU Group 14 ff:03.1 Host bridge [0600]: Intel Corporation Xeon 5600 Series Integrated Memory Controller Target Address Decoder [8086:2d99] (rev 02) IOMMU Group 14 ff:03.2 Host bridge [0600]: Intel Corporation Xeon 5600 Series Integrated Memory Controller RAS Registers [8086:2d9a] (rev 02) IOMMU Group 14 ff:03.4 Host bridge [0600]: Intel Corporation Xeon 5600 Series Integrated Memory Controller Test Registers [8086:2d9c] (rev 02) IOMMU Group 15 ff:04.0 Host bridge [0600]: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 0 Control [8086:2da0] (rev 02) IOMMU Group 15 ff:04.1 Host bridge [0600]: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 0 Address [8086:2da1] (rev 02) IOMMU Group 15 ff:04.2 Host bridge [0600]: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 0 Rank [8086:2da2] (rev 02) IOMMU Group 15 ff:04.3 Host bridge [0600]: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 0 Thermal Control [8086:2da3] (rev 02) IOMMU Group 16 ff:05.0 Host bridge [0600]: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 1 Control [8086:2da8] (rev 02) IOMMU Group 16 ff:05.1 Host bridge [0600]: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 1 Address [8086:2da9] (rev 02) IOMMU Group 16 ff:05.2 Host bridge [0600]: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 1 Rank [8086:2daa] (rev 02) IOMMU Group 16 ff:05.3 Host bridge [0600]: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 1 Thermal Control [8086:2dab] (rev 02) IOMMU Group 17 ff:06.0 Host bridge [0600]: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 2 Control [8086:2db0] (rev 02) IOMMU Group 17 ff:06.1 Host bridge [0600]: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 2 Address [8086:2db1] (rev 02) IOMMU Group 17 ff:06.2 Host bridge [0600]: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 2 Rank [8086:2db2] (rev 02) IOMMU Group 17 ff:06.3 Host bridge [0600]: Intel Corporation Xeon 5600 Series Integrated Memory Controller Channel 2 Thermal Control [8086:2db3] (rev 02) IOMMU Group 1 00:01.0 PCI bridge [0604]: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 1 [8086:3408] (rev 13) IOMMU Group 2 00:03.0 PCI bridge [0604]: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 3 [8086:340a] (rev 13) IOMMU Group 3 00:07.0 PCI bridge [0604]: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 7 [8086:340e] (rev 13) IOMMU Group 4 00:14.0 PIC [0800]: Intel Corporation 7500/5520/5500/X58 I/O Hub System Management Registers [8086:342e] (rev 13) IOMMU Group 4 00:14.1 PIC [0800]: Intel Corporation 7500/5520/5500/X58 I/O Hub GPIO and Scratch Pad Registers [8086:3422] (rev 13) IOMMU Group 4 00:14.2 PIC [0800]: Intel Corporation 7500/5520/5500/X58 I/O Hub Control Status and RAS Registers [8086:3423] (rev 13) IOMMU Group 4 00:14.3 PIC [0800]: Intel Corporation 7500/5520/5500/X58 I/O Hub Throttle Registers [8086:3438] (rev 13) IOMMU Group 5 00:1a.0 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #4 [8086:3a37] IOMMU Group 5 00:1a.1 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #5 [8086:3a38] IOMMU Group 5 00:1a.2 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #6 [8086:3a39] IOMMU Group 5 00:1a.7 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #2 [8086:3a3c] IOMMU Group 6 00:1b.0 Audio device [0403]: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller [8086:3a3e] IOMMU Group 7 00:1c.0 PCI bridge [0604]: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 1 [8086:3a40] IOMMU Group 7 00:1c.1 PCI bridge [0604]: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 2 [8086:3a42] IOMMU Group 7 00:1c.4 PCI bridge [0604]: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 5 [8086:3a48] IOMMU Group 7 00:1c.5 PCI bridge [0604]: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 6 [8086:3a4a] IOMMU Group 7 05:00.0 SATA controller [0106]: JMicron Technology Corp. JMB363 SATA/IDE Controller [197b:2363] (rev 03) IOMMU Group 7 05:00.1 IDE interface [0101]: JMicron Technology Corp. JMB363 SATA/IDE Controller [197b:2363] (rev 03) IOMMU Group 7 06:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 02) IOMMU Group 7 07:00.0 FireWire (IEEE 1394) [0c00]: JMicron Technology Corp. IEEE 1394 Host Controller [197b:2380] (rev 10) IOMMU Group 8 00:1d.0 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1 [8086:3a34] IOMMU Group 8 00:1d.1 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2 [8086:3a35] IOMMU Group 8 00:1d.2 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #3 [8086:3a36] IOMMU Group 8 00:1d.7 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #1 [8086:3a3a] IOMMU Group 9 00:1e.0 PCI bridge [0604]: Intel Corporation 82801 PCI Bridge [8086:244e] (rev 90) I have to passthrough the USB UHCI / USB2 EHCI Controller right?

foxlet commented 4 years ago

You have 4 USB controllers in Group 8, so you just have to rebind them. Copy the IDs and run rebind.sh on each, then start the VM using 1 controller you plan to use.

IOMMU Group 8 00:1d.0 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1 [8086:3a34] 
IOMMU Group 8 00:1d.1 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2 [8086:3a35] 
IOMMU Group 8 00:1d.2 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #3 [8086:3a36] 
IOMMU Group 8 00:1d.7 USB controller [0c03]: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #1 [8086:3a3a] 
LaShakun commented 4 years ago

got it to boot but when i connect my phone after it has booted the os freezes and crashes and when I connect while I boot I get a SATA WARNING: IDENTIFY DEVICE checksum not implemented and it won't boot. edit: nvm got the booting problem solved but even when I plug it in and boot it doesn't get picked up by the os.

foxlet commented 4 years ago

Which USB Controller did you pass? What is in System Profiler/About This Mac?

LaShakun commented 4 years ago

iPhone 8 Thanks for the reply. I got it through by passing all my 4 USB port through but my problem now is that it freezes the os when I plug my phone in. This takes about 3-5 minutes until my phone is properly connected and even then disconnecting it or reconnecting it (this happens when running checkra1n) Will take the os even more time to just recognize the device and this causes problems with checkra1n.

glencoe2004 commented 4 years ago

How are you rebinding your devices? Are you running a separate script for every id, or just one? I got it to work for me with just one.

LaShakun commented 4 years ago

i am using one to rebind

BIND_PID1="8086 3a34" BIND_BDF1="0000:00:1d.0"

BIND_PID2="8086 3a35" BIND_BDF2="0000:00:1d.1"

BIND_PID3="8086 3a36" BIND_BDF3="0000:00:1d.2"

BIND_PID4="8086 3a3a" BIND_BDF4="0000:00:1d.7"

sudo modprobe vfio-pci echo "$BIND_PID1" > /sys/bus/pci/drivers/vfio-pci/new_id echo "$BIND_BDF1" > /sys/bus/pci/devices/$BIND_BDF1/driver/unbind echo "$BIND_BDF1" > /sys/bus/pci/drivers/vfio-pci/bind echo "$BIND_PID1" > /sys/bus/pci/drivers/vfio-pci/remove_id

echo "$BIND_PID2" > /sys/bus/pci/drivers/vfio-pci/new_id echo "$BIND_BDF2" > /sys/bus/pci/devices/$BIND_BDF2/driver/unbind echo "$BIND_BDF2" > /sys/bus/pci/drivers/vfio-pci/bind echo "$BIND_PID2" > /sys/bus/pci/drivers/vfio-pci/remove_id

echo "$BIND_PID3" > /sys/bus/pci/drivers/vfio-pci/new_id echo "$BIND_BDF3" > /sys/bus/pci/devices/$BIND_BDF3/driver/unbind echo "$BIND_BDF3" > /sys/bus/pci/drivers/vfio-pci/bind echo "$BIND_PID3" > /sys/bus/pci/drivers/vfio-pci/remove_id

echo "$BIND_PID4" > /sys/bus/pci/drivers/vfio-pci/new_id echo "$BIND_BDF4" > /sys/bus/pci/devices/$BIND_BDF4/driver/unbind echo "$BIND_BDF4" > /sys/bus/pci/drivers/vfio-pci/bind echo "$BIND_PID4" > /sys/bus/pci/drivers/vfio-pci/remove_id

and one to make it somewhat function

sudo ./driverctl/driverctl --nosave set-override 0000:00:1d.0 vfio-pci sudo ./driverctl/driverctl --nosave set-override 0000:00:1d.1 vfio-pci sudo ./driverctl/driverctl --nosave set-override 0000:00:1d.2 vfio-pci sudo ./driverctl/driverctl --nosave set-override 0000:00:1d.7 vfio-pci sudo ./macOS.sh

glencoe2004 commented 4 years ago

Remove the last paragraph and put ‘sudo modprobe vfio-pci’ before every paragraph after the first one; it should work

LaShakun commented 4 years ago

what script are you talking about

glencoe2004 commented 4 years ago

The script you just posted

LaShakun commented 4 years ago

I posted 2

glencoe2004 commented 4 years ago

The one with all of the BIND_PID things in it

LaShakun commented 4 years ago

already got it in but forgot to add it in my post (changed it)