From: kvm-owner@xxxxxxxxxxxxxxx [kvm-owner@xxxxxxxxxxxxxxx] on behalf of Chris Wright [chrisw@xxxxxxxxxxxx] Sent: 21 December 2010 18:33 To: Prasad Joshi Cc: Chris Wright; kvm@xxxxxxxxxxxxxxx Subject: Re: Query on IOMMU * Prasad Joshi (P.G.Joshi@xxxxxxxxxxxxxxxxxxxxx) wrote: > > From: kvm-owner@xxxxxxxxxxxxxxx [kvm-owner@xxxxxxxxxxxxxxx] on behalf of Chris Wright [chrisw@xxxxxxxxxxxx] > > Yes I am using AMD processor and ASUS motherboard. Both of them have the IOMMU support, atleast it is mentioned on the Xen VT-d > > > Looks like we need some additional info in the wiki. Care to create an > > account and add the info? > > Sure I would love to. > Thanks, you can use the VT-d portion as an example. > The useful dmesg info will be AMD-Vi: messages, the important line > is this one: > AMD-Vi: Enabling IOMMU at ... > (and if you boot with amd_iommu_dump you'll get extra debugging info) I will add this information ASAP > > Thanks a lot for your reply. Yes I am interested in working on GPU pass-through to Virtual Machine. But for now I am trying to pass-through a network card to VM. > Great, GPU assignment has plenty of issues ;) <snip> > It still fails with the same error, here is the screen shot. > > root@prasad-kvm:/sys# uptime > 17:29:11 up 2 min, 3 users, load average: 0.93, 0.52, 0.20 > > root@prasad-kvm:/sys# ls -l /sys/bus/pci/devices/0000:01:05.0/driver > lrwxrwxrwx 1 root root 0 2010-12-21 17:26 /sys/bus/pci/devices/0000:01:05.0/driver -> ../../../../bus/pci/drivers/e100 > > root@prasad-kvm:/sys# lsmod | grep pci_stub > > root@prasad-kvm:/sys# modprobe pci_stub > > root@prasad-kvm:/sys# lsmod | grep pci_stub > pci_stub 1590 0 > > root@prasad-kvm:/sys# echo "8086 1229" > /sys/bus/pci/drivers/pci-stub/new_id > > root@prasad-kvm:/sys# echo "0000:01:05.0" > /sys/bus/pci/drivers/e100/unbind > > root@prasad-kvm:/sys# echo "0000:01:05.0" > /sys/bus/pci/drivers/pci-stub/bind > > root@prasad-kvm:/sys# echo "8086 1229" > /sys/bus/pci/drivers/pci-stub/remove_id > > root@prasad-kvm:/sys# ls -l /sys/bus/pci/devices/0000:01:05.0/driver > lrwxrwxrwx 1 root root 0 2010-12-21 17:31 /sys/bus/pci/devices/0000:01:05.0/driver -> ../../../../bus/pci/drivers/pci-stub > > root@prasad-kvm:~/VMDisks# modprobe kvm_amd > > root@prasad-kvm:~/VMDisks# lsmod | grep -i kvm > kvm_amd 56416 0 > kvm 348987 1 kvm_amd > > root@prasad-kvm:~/VMDisks# qemu-system-x86_64 -hda Ubuntu-10.10-amd64.img -m 1024M -device pci-assign,host=01:05.0 > Failed to assign device "(null)" : Device or resource busy > *** The driver 'pci-stub' is occupying your device 0000:01:05.0. > *** > *** You can try the following commands to free it: > *** > *** $ echo "8086 1229" > /sys/bus/pci/drivers/pci-stub/new_id > *** $ echo "0000:01:05.0" > /sys/bus/pci/drivers/pci-stub/unbind > *** $ echo "0000:01:05.0" > /sys/bus/pci/drivers/pci-stub/bind > *** $ echo "8086 1229" > /sys/bus/pci/drivers/pci-stub/remove_id > *** > qemu-system-x86_64: -device pci-assign,host=01:05.0: Device 'pci-assign' could not be initialized > root@prasad-kvm:~/VMDisks# echo $? > 1 > root@prasad-kvm:~/VMDisks# > > The VM does not boot. > Are you still seeing the same errors in dmesg? Your first dmesg showed > that the e100 driver couldn't allocate BAR0: No I must have done something terribly wrong, the first time I ran those assignment commands. > e100 0000:01:05.0: BAR 0: can't reserve [mem 0xf9cff000-0xf9cfffff] > If the host driver can't, then kvm_vm_ioctl_assign_device() will fail as > well. Seems as if there's a resource conflict on your machine. > Can you include a full dmesg, /proc/iomem, and lspci -vvv -xxxx? Please note the files attached. Please ignore few messages in dmesg file, I was trying to debug the problem by adding few printks. The following condition from __attach_device() returns the error. static int __attach_device(struct device *dev, struct protection_domain *domain) { ... if (alias_data->domain != NULL && alias_data->domain != domain) goto out_unlock; ... } Besides when I insert the pci_stub module, it emits a messages [ 49.197112] pci-stub: invalid id string "" I don't know why? Thanks and Regards, Prasad > thanks, > -chris -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html