From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wright Subject: Re: Query on IOMMU Date: Tue, 21 Dec 2010 10:33:22 -0800 Message-ID: <20101221183322.GG15023@sequoia.sous-sol.org> References: <000DF292CEBFBB41A633359D615F1514022A5F7C@DB2PRD0103MB011.eurprd01.prod.exchangelabs.com> <20101221161502.GE15023@sequoia.sous-sol.org> <000DF292CEBFBB41A633359D615F1514022A5FA9@DB2PRD0103MB011.eurprd01.prod.exchangelabs.com> <20101221171225.GF15023@sequoia.sous-sol.org> <000DF292CEBFBB41A633359D615F1514022A5FDB@DB2PRD0103MB011.eurprd01.prod.exchangelabs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Chris Wright , "kvm@vger.kernel.org" To: Prasad Joshi Return-path: Received: from sous-sol.org ([216.99.217.87]:60422 "EHLO sequoia.sous-sol.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751042Ab0LUSd3 (ORCPT ); Tue, 21 Dec 2010 13:33:29 -0500 Content-Disposition: inline In-Reply-To: <000DF292CEBFBB41A633359D615F1514022A5FDB@DB2PRD0103MB011.eurprd01.prod.exchangelabs.com> Sender: kvm-owner@vger.kernel.org List-ID: * Prasad Joshi (P.G.Joshi@student.reading.ac.uk) wrote: > > From: kvm-owner@vger.kernel.org [kvm-owner@vger.kernel.org] on behalf of Chris Wright [chrisw@sous-sol.org] > > 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) > > 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 ;) > 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: 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? thanks, -chris