foxlet / vmra1n

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

Problem with rebind.sh #5

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi

When I rebind.sh i got errors

:+1: sh: echo: I/O error sh: echo: I/O error Before i did rebind.sh , i did ./basic.sh and i got an error:

qemu-system-x86_64: -device vfio-pci,host=00:14.0,bus=port.1,multifunction=on: vfio error: 0000:00:14.0: group 2 is not viable

Please ensure all devices within the iommu_group are bound to their vfio bus driver.

This is my lsiommu.sh

IOMMU Group 0 00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers [8086:1904] (rev 08) IOMMU Group 10 00:1f.0 ISA bridge [0601]: Intel Corporation Sunrise Point-LP LPC Controller [8086:9d48] (rev 21) IOMMU Group 10 00:1f.2 Memory controller [0580]: Intel Corporation Sunrise Point-LP PMC [8086:9d21] (rev 21) IOMMU Group 10 00:1f.3 Audio device [0403]: Intel Corporation Sunrise Point-LP HD Audio [8086:9d70] (rev 21) IOMMU Group 10 00:1f.4 SMBus [0c05]: Intel Corporation Sunrise Point-LP SMBus [8086:9d23] (rev 21) IOMMU Group 11 01:00.0 3D controller [0302]: NVIDIA Corporation GM107M [GeForce GTX 950M] [10de:139a] (rev a2) IOMMU Group 12 03:00.0 Network controller [0280]: Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter [168c:0042] (rev 30) IOMMU Group 13 04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTL8411B PCI Express Card Reader [10ec:5287] (rev 01) IOMMU Group 13 04:00.1 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 12) IOMMU Group 1 00:02.0 VGA compatible controller [0300]: Intel Corporation Skylake GT2 [HD Graphics 520] [8086:1916] (rev 07) IOMMU Group 2 00:14.0 USB controller [0c03]: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller [8086:9d2f] (rev 21) IOMMU Group 2 00:14.2 Signal processing controller [1180]: Intel Corporation Sunrise Point-LP Thermal subsystem [8086:9d31] (rev 21) IOMMU Group 3 00:15.0 Signal processing controller [1180]: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #0 [8086:9d60] (rev 21) IOMMU Group 4 00:16.0 Communication controller [0780]: Intel Corporation Sunrise Point-LP CSME HECI #1 [8086:9d3a] (rev 21) IOMMU Group 5 00:17.0 SATA controller [0106]: Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode] [8086:9d03] (rev 21) IOMMU Group 6 00:1c.0 PCI bridge [0604]: Intel Corporation Sunrise Point-LP PCI Express Root Port #1 [8086:9d10] (rev f1) IOMMU Group 7 00:1d.0 PCI bridge [0604]: Intel Corporation Sunrise Point-LP PCI Express Root Port #9 [8086:9d18] (rev f1) IOMMU Group 8 00:1d.2 PCI bridge [0604]: Intel Corporation Device [8086:9d1a] (rev f1) IOMMU Group 9 00:1d.3 PCI bridge [0604]: Intel Corporation Device [8086:9d1b] (rev f1)

When i put the 00:14.2 (Signal processing controller [1180]: Intel Corporation Sunrise Point-LP Thermal subsystem [8086:9d31] (rev 21)) with the vfio-pci kernel like the USB 00:14.0 Qemu was started, but when I boot to mac, i got to much error and Mac didn't started

Can you help me ? Thanks

ghost commented 4 years ago

This is my lspci -k

00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers (rev 08) Subsystem: Acer Incorporated [ALI] Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers Kernel driver in use: skl_uncore 00:02.0 VGA compatible controller: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07) Subsystem: Acer Incorporated [ALI] Skylake GT2 [HD Graphics 520] Kernel driver in use: i915 Kernel modules: i915 00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21) Subsystem: Acer Incorporated [ALI] Sunrise Point-LP USB 3.0 xHCI Controller Kernel driver in use: vfio-pci 00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21) Subsystem: Acer Incorporated [ALI] Sunrise Point-LP Thermal subsystem Kernel driver in use: intel_pch_thermal Kernel modules: intel_pch_thermal 00:15.0 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #0 (rev 21) Subsystem: Acer Incorporated [ALI] Sunrise Point-LP Serial IO I2C Controller Kernel driver in use: intel-lpss Kernel modules: intel_lpss_pci 00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI #1 (rev 21) Subsystem: Acer Incorporated [ALI] Sunrise Point-LP CSME HECI Kernel driver in use: mei_me Kernel modules: mei_me 00:17.0 SATA controller: Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode] (rev 21) Subsystem: Acer Incorporated [ALI] Sunrise Point-LP SATA Controller [AHCI mode] Kernel driver in use: ahci Kernel modules: ahci 00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #1 (rev f1) Kernel driver in use: pcieport 00:1d.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #9 (rev f1) Kernel driver in use: pcieport 00:1d.2 PCI bridge: Intel Corporation Device 9d1a (rev f1) Kernel driver in use: pcieport 00:1d.3 PCI bridge: Intel Corporation Device 9d1b (rev f1) Kernel driver in use: pcieport 00:1f.0 ISA bridge: Intel Corporation Sunrise Point-LP LPC Controller (rev 21) Subsystem: Acer Incorporated [ALI] Sunrise Point-LP LPC Controller 00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21) Subsystem: Acer Incorporated [ALI] Sunrise Point-LP PMC 00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21) Subsystem: Acer Incorporated [ALI] Sunrise Point-LP HD Audio Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel, snd_soc_skl 00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21) Subsystem: Acer Incorporated [ALI] Sunrise Point-LP SMBus Kernel modules: i2c_i801 01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 950M] (rev a2) Subsystem: Acer Incorporated [ALI] GM107M [GeForce GTX 950M] Kernel modules: nvidiafb, nouveau 03:00.0 Network controller: Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter (rev 30) Subsystem: Lite-On Communications Inc QCA9377 802.11ac Wireless Network Adapter Kernel driver in use: ath10k_pci Kernel modules: ath10k_pci 04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTL8411B PCI Express Card Reader (rev 01) Subsystem: Acer Incorporated [ALI] RTL8411B PCI Express Card Reader Kernel driver in use: rtsx_pci Kernel modules: rtsx_pci 04:00.1 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 12) Subsystem: Acer Incorporated [ALI] RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller Kernel driver in use: r8169 Kernel modules: r8169

ghost commented 4 years ago

And This is my rebind.sh

BIND_PID1="8086:9d2f" BIND_BDF1="0000:00:14.0" 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

foxlet commented 4 years ago

It should be BIND_PID1="8086 9d2f" with a space, not a colon.

foxlet commented 4 years ago

Rebind both the USB controller, and the Thermal Subsystem, then run the VM.

foxlet commented 4 years ago
BIND_PID1="8086 9d2f"
BIND_BDF1="0000:00:14.0"

then


BIND_PID1="8086 9d31"
BIND_BDF1="0000:00:14.2"
schu7max commented 4 years ago

chmod +rwx rebind.sh ./rebind.sh

./rebind.sh: line 5: /sys/bus/pci/drivers/vfio-pci/new_id: Permission denied ./rebind.sh: line 6: /sys/bus/pci/devices/0000:00:14.0/driver/unbind: Permission denied ./rebind.sh: line 7: /sys/bus/pci/drivers/vfio-pci/bind: Permission denied ./rebind.sh: line 8: /sys/bus/pci/drivers/vfio-pci/remove_id: Permission denied

any ideas how to grant permission?? (as you can see i've tried chmod +rwx)

ghost commented 4 years ago

Hi foxlet,

Your proposition wasn't resolve my problem But I resolve the problem, I unbind the 14.2 then I ./basic.sh and Mac started. Thanks

@schu7max do

sudo ./rebind.sh

ghost commented 4 years ago

Error unbind 14.2 didn't work , i install driverctl package and I change the kernel of 14.2 to vfio-pci

driverctl set-override 0000:00:14.2 vfio-pci

the same kernel of 14.0 and it worked