[SOLVED] PCI Passthrough SATA Controller VFIO-PCI

W3isserWolf

New Member
Dec 29, 2023
15
2
3
Hey Ho zusammen,
ich habe ein Problem was ich einfach nicht gelöst bekomme.

Das Problem:
ich versuche einen Sata Controller (ASM1166) an eine VM durchzureichen. Erstmal ist es nur eine Basis Windows Server 2019 Datacenter Eval.
Wenn ich die VM ohne die PCI Karte starte geht alles super.
Füge ich die PCI Karte hinzu zeigt der Task Viewer nur...
Code:
TASK ERROR: start failed: command '/usr/bin/kvm -id 100 -name 'Test,debug-threads=on' -no-shutdown -chardev 'socket,id=qmp,path=/var/run/qemu-server/100.qmp,server=on,wait=off' -mon 'chardev=qmp,mode=control' -chardev 'socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect=5' -mon 'chardev=qmp-event,mode=control' -pidfile /var/run/qemu-server/100.pid -daemonize -smbios 'type=1,uuid=bdc11de3-864f-4947-8dd3-efdd76713a77' -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE_4M.secboot.fd' -drive 'if=pflash,unit=1,id=drive-efidisk0,format=raw,file=/dev/pve/vm-100-disk-3,size=540672' -smp '2,sockets=1,cores=2,maxcpus=2' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' -vnc 'unix:/var/run/qemu-server/100.vnc,password=on' -cpu 'qemu64,+aes,enforce,hv_ipi,hv_relaxed,hv_reset,hv_runtime,hv_spinlocks=0x1fff,hv_stimer,hv_synic,hv_time,hv_vapic,hv_vpindex,+kvm_pv_eoi,+kvm_pv_unhalt,+pni,+popcnt,+sse4.1,+sse4.2,+ssse3' -m 4096 -object 'iothread,id=iothread-virtio0' -readconfig /usr/share/qemu-server/pve-q35-4.0.cfg -device 'vmgenid,guid=5060019a-b7fc-4f3d-adf2-2f5932c3d7d4' -device 'usb-tablet,id=tablet,bus=ehci.0,port=1' -device 'vfio-pci,host=0000:05:00.0,id=hostpci0,bus=pci.0,addr=0x10' -device 'VGA,id=vga,bus=pcie.0,addr=0x1' -chardev 'socket,path=/var/run/qemu-server/100.qga,server=on,wait=off,id=qga0' -device 'virtio-serial,id=qga0,bus=pci.0,addr=0x8' -device 'virtserialport,chardev=qga0,name=org.qemu.guest_agent.0' -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' -iscsi 'initiator-name=iqn.1993-08.org.debian:01:ff8e58c6ed18' -drive 'file=/var/lib/vz/template/iso/virtio-win-0.1.225.iso,if=none,id=drive-ide0,media=cdrom,aio=io_uring' -device 'ide-cd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=103' -drive 'file=/var/lib/vz/template/iso/de_windows_server_2019_updated_sept_2019_x64_dvd_5d81ecbf.iso,if=none,id=drive-ide2,media=cdrom,aio=io_uring' -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=101' -drive 'file=/dev/pve/vm-100-disk-2,if=none,id=drive-virtio0,format=raw,cache=none,aio=io_uring,detect-zeroes=on' -device 'virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,iothread=iothread-virtio0,bootindex=100' -netdev 'type=tap,id=net0,ifname=tap100i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on' -device 'virtio-net-pci,mac=12:C2:CC:C8:5D:CA,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=1024,bootindex=102' -rtc 'driftfix=slew,base=localtime' -machine 'hpet=off,type=pc-q35-8.0+pve0' -global 'kvm-pit.lost_tick_policy=discard'' failed: got timeout

Und auf dem Monitor direkt am Host angeschlossen:
Code:
vfio-pci 0000:05:00.0: Unable to change power state from D3cold to D0, device inaccessible

Aber erstmal ein paar Grundinfos:

Zum System:
AMD Ryzen 5 5600G
ASRock B450M Pro4 R2.0
32 GB RAM Crucial 3200
Proxmox 8.0.3
Kernel Version

Linux 6.2.16-3-pve #1 SMP PREEMPT_DYNAMIC PVE 6.2.16-3 (2023-06-17T05:58Z)
PVE Manager Version

pve-manager/8.0.3/bbf3993334bfa916

Fehlermeldung direkt auf der Shell vom Host wenn ich die VM starten will:
Code:
vfio-pci 0000:05:00.0: Unable to change power state from D3cold to D0, device inaccessible

/etc/modules
Code:
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd


/etc/default/grub
Code:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on pcie_acs_override=downstream,multifunction"
GRUB_CMDLINE_LINUX=""

# If your computer has multiple operating systems installed, then you
# probably want to run os-prober. However, if your computer is a host
# for guest OSes installed via LVM or raw disk devices, running
# os-prober can cause damage to those guest OSes as it mounts
# filesystems to look for things.
#GRUB_DISABLE_OS_PROBER=false

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

pvesh get /nodes/proxmox01/hardware/pci --pci-class-blacklist ""
1706729681629.png
(iommugroup 15 ist der ASM1166 Sata Controller)

Im BIOS ist iommu auch aktiv.

Vielleicht hat ja jemand ne Idee
 
pcie_acs_override=downstream,multifunction
wie sieht die aufteilung ohne das hier aus?

Code:
vfio-pci 0000:05:00.0: Unable to change power state from D3cold to D0, device inaccessible
das sieht so aus als würde der controller keinen reset unterstützten... manchmal ist die verbaute hardware leider einfach nicht für passthrough geeignet, gerade onboard devices auf consumer hardware machen oft probleme mit solchen dingen (weils einfach ein sehr seltener use-case ist)
 
das sieht so aus als würde der controller keinen reset unterstützten... manchmal ist die verbaute hardware leider einfach nicht für passthrough geeignet, gerade onboard devices auf consumer hardware machen oft probleme mit solchen dingen (weils einfach ein sehr seltener use-case ist)
Danke für deine Antwort.

Ich habe mal einen PCI Sata Controller versucht, wo ich weiß, dass er dafür verwendet werden kann:
Funktioniert.

Alten Controller nochmal zum testen durchgereicht:
Funktioniert auch auf einmal obwohl ich nichts geändert hab?
wie sieht die aufteilung ohne das hier aus?
Alles eine große Familie
1706776808613.png

Das mit dem
Code:
pcie_acs_override=downstream,multifunction
habe ich aus einem Tutorial, was macht das denn genau? Teilt das einfach alles in einzelne Gruppen auf?
 

Attachments

  • 1706776802665.png
    1706776802665.png
    122 KB · Views: 2
Funktioniert auch auf einmal obwohl ich nichts geändert hab?
Mhmm... vielleicht war die hardware in einem komischen state?

Alles eine große Familie
das ist generell ein problem

habe ich aus einem Tutorial, was macht das denn genau? Teilt das einfach alles in einzelne Gruppen auf?
ja, aber das kann einige nachteile haben, zb reduzierte security oder hardware instabilität.
pci devices können untereinander reden ohne dass es der host mitbekommt, zumindest innerhalb einer iommugroup und der patch "schummelt" und lässt es nur so aussehen als ob die karten getrennt wären

aber wenn es jetzt funkioniert,super ;)
 
Mhmm... vielleicht war die hardware in einem komischen state?
Ich vermute eher das es an Consumer Hardware liegt. Das board vermute ich eher weniger da ich das ja nur bei dem Controller hatte. Bis jetzt läuft er intressanterweise ohne Fehlermeldungen usw.... Technik, man muss Sie nicht verstehen.

Ist eh nur mein Testsystem, das andere ich ein wirklich Fujitsu Server Primergy RX2540 M2 den ich vor der verschrottung gerettet habe. Da funktioniert komischerweise alles ohne Probleme. Zufall? Ich denke nicht (Gut, da ist auch ein LSI Raid Controller drauf, den darf man nicht mit nem Consumer Controller vergleichen)

Aber danke für die Antworten. Ich werde das nun als gelöst markieren.

Was war die Lösung?
(Wenn mal jemand nach dem Problem sucht)

Anderer PCI Slot auf dem Board und es läuft.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!