I'm looking for assistance with pci-passthrough on CentOS 6.2.
I've installed libvirt version: 0.9.4, package: 23.el6_2.8 from yum.
I have a windows XP client setup via virt-manager which boots and runs fine until I attempt to assign a PCI device to it.
The error log reads:
-----------------/var/log/libvirt/qemu/SageTv.log----------------
2012-06-02 22:55:07.801: starting up
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=spice /usr/libexec/qemu-kvm -S -M rhel6.2.0 -cpu Opteron_G3,+wdt,+skinit,+osvw,+3dnowprefetch,+cr8legacy,+extapic,+cmp_legacy,+pdpe1gb,+fxsr_opt,+mmxext,+aes,+sse4.2,+sse4.1,+ssse3,+ht,+vme -enable-kvm -m 3048 -smp 2,sockets=2,cores=1,threads=1 -name SageTv -uuid bf80f6a5-1471-9415-e502-88c4999319c7 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/SageTv.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime,driftfix=slew -no-shutdown -boot order=c,menu=on -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 -drive file=/dev/vg_hdd/lv_sagetv,if=none,id=drive-virtio-disk0,format=raw,cache=none,aio=native -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=24,id=hostnet0,vhost=on,vhostfd=25 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:b9:bf:b0,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -usb -device usb-tablet,id=input0 -spice port=5900,addr=127.0.0.1,disable-ticketing -vga std -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device pci-assign,host=04:07.0,id=hostdev0,configfd=26,bus=pci.0,addr=0x8 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7
char device redirected to /dev/pts/1
do_spice_init: starting 0.8.3
spice_server_add_interface: SPICE_INTERFACE_MIGRATION
spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
spice_server_add_interface: SPICE_INTERFACE_MOUSE
spice_server_add_interface: SPICE_INTERFACE_PLAYBACK
spice_server_add_interface: SPICE_INTERFACE_RECORD
Failed to assign device "hostdev0" : Invalid argument
qemu-kvm: -device pci-assign,host=04:07.0,id=hostdev0,configfd=26,bus=pci.0,addr=0x8: Device 'pci-assign' could not be initialized
2012-06-02 22:55:08.744: shutting down
-----------------/var/log/libvirt/qemu/SageTv.log----------------
After this I find the dmesg shows:
-----------------dmesg------------------
pci-stub 0000:04:07.0: PCI INT A -> GSI 21 (level, low) -> IRQ 21
pci-stub 0000:04:07.0: restoring config space at offset 0x1 (was 0x2100000, writing 0x2100002)
assign device 4:7.0 failed
-----------------dmesg------------------
In case this was an IRQ problem I checked my /proc/interrupts.
-----------------interrupts------------------
CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7
0: 130 0 0 0 0 0 0 0 IO-APIC-edge timer
1: 0 0 1 1 0 0 0 0 IO-APIC-edge i8042
8: 0 1 0 0 0 0 0 0 IO-APIC-edge rtc0
9: 0 0 0 0 0 0 0 0 IO-APIC-fasteoi acpi
17: 0 0 0 0 0 0 0 0 IO-APIC-fasteoi ehci_hcd:usb1, ehci_hcd:usb2, ehci_hcd:usb3
18: 0 0 0 0 0 0 0 0 IO-APIC-fasteoi ohci_hcd:usb4, ohci_hcd:usb5, ohci_hcd:usb6, ohci_hcd:usb7
19: 587 2219 1807 588 602 600 687 607 IO-APIC-fasteoi ahci
21: 422 430 7316 402 410 405 429 412 IO-APIC-fasteoi
24: 0 0 0 0 0 0 0 0 PCI-MSI-edge AMD-Vi
25: 12 10 9 20 11 15 15 15 PCI-MSI-edge radeon
26: 7 8 7 10 9 8 10 9 PCI-MSI-edge hda_intel
27: 0 0 0 0 0 0 0 0 PCI-MSI-edge xhci_hcd
28: 7098 36221 19 24 19 20 28 20 PCI-MSI-edge eth0
NMI: 0 0 0 0 0 0 0 0 Non-maskable interrupts
LOC: 22088 22355 9472 12483 6371 11086 5211 7987 Local timer interrupts
SPU: 0 0 0 0 0 0 0 0 Spurious interrupts
PMI: 0 0 0 0 0 0 0 0 Performance monitoring interrupts
PND: 0 0 0 0 0 0 0 0 Performance pending work
RES: 61166 42503 6683 11920 2681 3534 4120 2460 Rescheduling interrupts
CAL: 197 302 301 303 290 300 314 318 Function call interrupts
TLB: 1406 1551 464 1749 350 897 485 563 TLB shootdowns
TRM: 0 0 0 0 0 0 0 0 Thermal event interrupts
THR: 0 0 0 0 0 0 0 0 Threshold APIC interrupts
MCE: 0 0 0 0 0 0 0 0 Machine check exceptions
MCP: 1 1 1 1 1 1 1 1 Machine check polls
ERR: 0
MIS: 0
-----------------interrupts------------------
To get to this point I've confirmed IOMMU is loading on boot. during boot a grep for AMD-Vi returns:
-----------------AMD-Vi------------------
AMD-Vi: Enabling IOMMU at 0000:00:00.2 cap 0x40
AMD-Vi: Initialized for Passthrough Mode
AMD-Vi: Enabling IOMMU at 0000:00:00.2 cap 0x40
-----------------AMD-Vi------------------
I've set: allow_unsafe_assigned_interrupts.
I've set selinux to permissive
I've set user and group for qemu to 'root'
I've set clear_emulator_capabilites = 0
I've set relaxed_acs_check = 1
Finally, if there's a better forum to ask this question in please let me know. I've already tried #kvm and #virt on IRC with no reply yet. I've tried the CentOS 6.2 forums with no reply.
Thanks,
Chris
P.S. I didn't subscribe, just sent this email. If by some odd chance, I can't see replies w/o subscribing someone please let me know.