pavolelsig / passthrough_helper_manjaro

67 stars 18 forks source link

How to add a NVME ssd to the script? #5

Open Bliss3d opened 3 years ago

Bliss3d commented 3 years ago

I'd like to vfio stub my 2nd ssd: I tried to just add the id to vfio.conf

install vfio-pci /usr/bin/vfio-pci-override.sh options vfio-pci disable_vga=1 ids=126f:2263

[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.9-x86_64 root=UUID=0f8597aa-4c09-49a1-919f-6679beb19b85 rw quiet apparmor=1 security=apparmor resume=UUID=36e522f9-0a02-476f-b0eb-7909bc86e06e udev.log_priority=3 intel_iommu=on rd.driver.pre=vfio-pci kvm.ignore_msrs=1 [ 0.286941] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.9-x86_64 root=UUID=0f8597aa-4c09-49a1-919f-6679beb19b85 rw quiet apparmor=1 security=apparmor resume=UUID=36e522f9-0a02-476f-b0eb-7909bc86e06e udev.log_priority=3 intel_iommu=on rd.driver.pre=vfio-pci kvm.ignore_msrs=1 [ 3.871101] VFIO - User Level meta-driver version: 0.3 [ 3.898768] vfio-pci 0000:08:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=none [ 3.913247] vfio-pci 0000:85:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=none [ 3.946416] vfio_pci: add [126f:2263[ffffffff:ffffffff]] class 0x000000/00000000

lspci: 82:00.0 Non-Volatile memory controller [0108]: Silicon Motion, Inc. Device [126f:2263] (rev 03) Subsystem: Silicon Motion, Inc. Device [126f:2263] Kernel driver in use: nvme so that doesnt seem to work

pavolelsig commented 3 years ago

You don't need to bind the SSD to vfio-pci on boot. Just add it in VM manager and it will get bound to vfio-pci when the VM starts. Only GPUs need to be bound to vfio-pci at boot-time.

Bliss3d commented 3 years ago

I just tried and no it doesn't work

warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12] 2020-12-23T10:40:26.097726Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13] 2020-12-23T10:40:26.099515Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12] 2020-12-23T10:40:26.099537Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13] 2020-12-23T10:40:36.023980Z qemu-system-x86_64: -device vfio-pci,host=0000:82:00.0,id=hostdev2,bus=pci.7,addr=0x0,rombar=0: vfio 0000:82:00.0: failed to add PCI capability 0x11[0x50]@0xb0: table & pba overlap, or they don't fit in BARs, or don't align

Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper callback(asyncjob, *args, kwargs) File "/usr/share/virt-manager/virtManager/asyncjob.py", line 101, in tmpcb callback(*args, *kwargs) File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn ret = fn(self, args, kwargs) File "/usr/share/virt-manager/virtManager/object/domain.py", line 1330, in startup self._backend.create() File "/usr/lib/python3.8/site-packages/libvirt.py", line 1234, in create if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self) libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: 2020-12-23T10:40:26.097687Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12] 2020-12-23T10:40:26.097726Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13] 2020-12-23T10:40:26.099515Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12] 2020-12-23T10:40:26.099537Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13] 2020-12-23T10:40:36.023980Z qemu-system-x86_64: -device vfio-pci,host=0000:82:00.0,id=hostdev2,bus=pci.7,addr=0x0,rombar=0: vfio 0000:82:00.0: failed to add PCI capability 0x11[0x50]@0xb0: table & pba overlap, or they don't fit in BARs, or don't align

pavolelsig commented 3 years ago

In this case the issue might be a problem with that SSD. This is the error it's throwing: "table & pba overlap, or they don't fit in BARs, or don't align". I don't think there is any easy way of passing that through unless there is a kernel patch. Another option is using a different drive that might not suffer from this issue.