Bug 29232

Summary: [VT-d] VT-d device passthrough fail to guest
Product: Virtualization Reporter: xudong (xudong.hao)
Component: kvmAssignee: virtualization_kvm
Status: CLOSED CODE_FIX    
Severity: high CC: alex.williamson, avi, florian, maciej.rutecki, rjw, yongjie.ren
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.38-rc4 Tree: Mainline
Regression: Yes
Bug Depends on:    
Bug Blocks: 27352    

Description xudong 2011-02-16 08:56:35 UTC
Environment:
------------
Host OS : IA32E
Guest OS : IA32E
kvm.git Commit: a685b38e272587e644fedd37269ddb82df21c052
qemu-kvm Commit: 671d89d6411655bb4f8058ce6eb86bb0bb8ec978
Host Kernel Version: 2.6.38-rc4


Bug detailed description:
--------------------------
When assign one PCI/e device to guest, qemu report error and guest can not boot
up. If do hot-add device to guest, qemu will be killed.

[root@vt-nhm9 qemu-kvm]# qemu-system-x86_64  -m 512 -smp 2  -device
pci-assign,host=13:00.0 -net none -hda /path/rhel5.img
assigned_dev_pci_read: pread failed, ret = 0 errno = 22



Reproduce steps:
----------------
1) install latest kvm and qemu-kvm
2) qemu-system-x86_64  -m 512 -smp 2  -device pci-assign,host=13:00.0 -net none
-hda /path/rhel5.img
3) there will be a qemu error
Comment 1 Alex Williamson 2011-02-16 16:43:26 UTC
This will be fixed with the 2.6.38-rc5 merge of kvm.git.  Commit 47970b1b was bad and later reverted in f00eaeea.  A corrected version was added in 683034fca.
Comment 2 Jay Ren 2011-03-04 02:28:49 UTC
This bug has been verified. It's OK with b35049715 kvm.git.
Comment 3 Florian Mickler 2011-03-04 20:33:57 UTC
merged for v2.6.38-rc5:

commit f00eaeea7a42b5ea327e9ce8839cb0b53d3bdb4e
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sun Feb 13 07:50:50 2011 -0800

    Revert "pci: use security_capable() when checking capablities during config space read"