From mboxrd@z Thu Jan 1 00:00:00 1970 From: freisei Subject: Re: PCI Passthrough - create_userspace_phys_mem: Invalid argument Date: Fri, 27 Feb 2009 18:27:36 +0100 Message-ID: <49A82288.8050402@xp8.de> References: <49A6AE23.1050107@xp8.de> <715D42877B251141A38726ABF5CABF2C0195AD0900@pdsmsx503.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "'kvm@vger.kernel.org'" To: unlisted-recipients:; (no To-header on input) Return-path: Received: from kunden.xp8.de ([88.198.145.222]:48099 "EHLO kunden.xp8.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751916AbZB0R2l (ORCPT ); Fri, 27 Feb 2009 12:28:41 -0500 Received: from [192.168.11.101] (p5B084914.dip.t-dialin.net [91.8.73.20]) (Authenticated sender: info@xp8.de) by kunden.xp8.de (Postfix) with ESMTP id 4873D2072D3 for ; Fri, 27 Feb 2009 18:26:48 +0100 (CET) In-Reply-To: <715D42877B251141A38726ABF5CABF2C0195AD0900@pdsmsx503.ccr.corp.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: Han, Weidong schrieb: > freisei wrote: > =20 >> Hi List! >> >> i want to passthrough my isdn-card in a kvm-vm. >> >> =20 >>> qemu-system-x86_64 -vnc :3 -m 2048 -name $vmname -hda >>> /dev/vg0/xp8asterisk -boot n -net nic,macaddr=3D52:54:00:58:08:03 -= net >>> tap,script=3D/etc/qemu-ifup -usbdevice tablet -k de -smp 2 -monitor >>> stdio -pcidevice host=3D05:04.0 >>> Running /etc/qemu-ifup >>> ...Bringing up for bridged mode >>> ...Adding tap0 to intern-interface >>> init_assigned_device: Registering real physical device 05:04.0 >>> (bus=3D5 dev=3D4 func=3D0) get_real_device: region 0 size 32 start >>> 0xf9100000 type 512 resource_fd 14 get_real_device: region 1 size 3= 2 >>> start 0x3000 type 256 resource_fd 0 QEMU 0.9.1 monitor - type 'help= ' >>> for more information (qemu) assigned_dev_pci_read_config: (6.0): >>> address=3D0000=20 >>> val=3D0x00001244 len=3D2 >>> assigned_dev_pci_read_config: (6.0): address=3D0002 val=3D0x00000e0= 0 >>> len=3D2 assigned_dev_pci_read_config: (6.0): address=3D0000 >>> val=3D0x00001244 len=3D2 assigned_dev_pci_read_config: (6.0): >>> address=3D0002 val=3D0x00000e00 len=3D2 assigned_dev_pci_read_confi= g: >>> (6.0): address=3D0000 val=3D0x00001244 len=3D2 >>> assigned_dev_pci_read_config: (6.0): address=3D0002 val=3D0x00000e0= 0 >>> len=3D2 assigned_dev_pci_read_config: (6.0): address=3D000a >>> val=3D0x00000280 len=3D2 assigned_dev_pci_read_config: (6.0): >>> address=3D0000 val=3D0x00001244 len=3D2 assigned_dev_pci_read_confi= g: >>> (6.0): address=3D0002 val=3D0x00000e00 len=3D2 >>> assigned_dev_pci_write_config: (6.0): address=3D0010 val=3D0xffffff= ff >>> len=3D4 assigned_dev_pci_read_config: (6.0): address=3D0010 >>> val=3D0xffffffe0 len=3D4 assigned_dev_pci_read_config: (6.0): >>> address=3D0010 val=3D0xffffffe0 len=3D4 assigned_dev_pci_write_conf= ig: >>> (6.0): address=3D0010 val=3D0xf2001100 len=3D4 assigned_dev_iomem_m= ap: >>> e_phys=3Df2001100 r_virt=3D0x7f9374876000 type=3D0 len=3D00000020 >>> region_num=3D0 create_userspace_phys_mem: Invalid argument =20 >>> assigned_dev_iomem_map: Error: create new mapping failed >>> =20 > > This error happened when the MMIO of assigned device is not page alig= ned. Here MMIO size of your device is 0x20 Bytes. The commit fb48c7c858= cc612e3e1cb011c534075ac5de553d in kvm userspace should fix it. Was it i= ncluded in your userspace? Thanks for your answer! How can i check if the commit is included? And where to checkout the=20 latest snapshot? I am using kvm-84 sources from sourceforge and kernel 2.6.29rc6 on=20 ubuntu 8.10 qemu-system-x86_64 |more QEMU PC emulator version 0.9.1 (kvm-84), Copyright (c) 2003-2008 Fabric= e=20 Bellard > The commit changes rom bios, you can use "make bios", and "make inst= all" to make it take effect. And I think replacing "-net nic,macaddr=3D= 52:54:00:58:08:03 -net tap,script=3D/etc/qemu-ifup" with "-net none" wi= ll also work for you. > > Regards, > Weidong > > =20 making and installing bios done - no changes. with "-net none" it WORKS! Bud i need network... i=B4ll try to passthro= ugh=20 my Intel PCIx NIC too... >> Already tried: >> - remove not needed-parameters >> - dma=3Dnone >> - set assign-device DEBUG (as you see) >> >> Additional Info: >> lspci: >> 05:04.0 Network controller: AVM GmbH Fritz!PCI v2.0 ISDN (rev 02) >> =20 > > Can you post output of "lspci -v"? We can see if its mmio is page ali= gned or not. Can you check if commit fb48c7c858cc612e3e1cb011c534075ac5= de553d was included in your kvm-userspace? > > =20 05:04.0 Network controller: AVM GmbH Fritz!PCI v2.0 ISDN (rev 02) Subsystem: AVM GmbH Fritz!PCI v2.0 ISDN Flags: medium devsel, IRQ 24 Memory at f9100000 (32-bit, non-prefetchable) [size=3D32] I/O ports at 3000 [size=3D32] Capabilities: [40] Power Management version 2 Kernel modules: hisax_fcpcipnp >> root@xp8main3:/etc/kvm# uname -a >> Linux xp8main3 2.6.29-rc6-xp8no7 #1 SMP Thu Feb 26 12:27:17 CET 2009 >> x86_64 GNU/Linux >> >> >> greets freisei >> =20 > > =20