* PCI Passthrough - create_userspace_phys_mem: Invalid argument
@ 2009-02-26 14:58 freisei
2009-02-27 1:44 ` Han, Weidong
0 siblings, 1 reply; 3+ messages in thread
From: freisei @ 2009-02-26 14:58 UTC (permalink / raw)
To: kvm
Hi List!
i want to passthrough my isdn-card in a kvm-vm.
> qemu-system-x86_64 -vnc :3 -m 2048 -name $vmname -hda
> /dev/vg0/xp8asterisk -boot n -net nic,macaddr=52:54:00:58:08:03 -net
> tap,script=/etc/qemu-ifup -usbdevice tablet -k de -smp 2 -monitor
> stdio -pcidevice host=05: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=5
> dev=4 func=0)
> get_real_device: region 0 size 32 start 0xf9100000 type 512 resource_fd 14
> get_real_device: region 1 size 32 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=0000
> val=0x00001244 len=2
> assigned_dev_pci_read_config: (6.0): address=0002 val=0x00000e00 len=2
> assigned_dev_pci_read_config: (6.0): address=0000 val=0x00001244 len=2
> assigned_dev_pci_read_config: (6.0): address=0002 val=0x00000e00 len=2
> assigned_dev_pci_read_config: (6.0): address=0000 val=0x00001244 len=2
> assigned_dev_pci_read_config: (6.0): address=0002 val=0x00000e00 len=2
> assigned_dev_pci_read_config: (6.0): address=000a val=0x00000280 len=2
> assigned_dev_pci_read_config: (6.0): address=0000 val=0x00001244 len=2
> assigned_dev_pci_read_config: (6.0): address=0002 val=0x00000e00 len=2
> assigned_dev_pci_write_config: (6.0): address=0010 val=0xffffffff len=4
> assigned_dev_pci_read_config: (6.0): address=0010 val=0xffffffe0 len=4
> assigned_dev_pci_read_config: (6.0): address=0010 val=0xffffffe0 len=4
> assigned_dev_pci_write_config: (6.0): address=0010 val=0xf2001100 len=4
> assigned_dev_iomem_map: e_phys=f2001100 r_virt=0x7f9374876000 type=0
> len=00000020 region_num=0
> create_userspace_phys_mem: Invalid argument
> assigned_dev_iomem_map: Error: create new mapping failed
Already tried:
- remove not needed-parameters
- dma=none
- set assign-device DEBUG (as you see)
Additional Info:
lspci:
05:04.0 Network controller: AVM GmbH Fritz!PCI v2.0 ISDN (rev 02)
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: PCI Passthrough - create_userspace_phys_mem: Invalid argument
2009-02-26 14:58 PCI Passthrough - create_userspace_phys_mem: Invalid argument freisei
@ 2009-02-27 1:44 ` Han, Weidong
2009-02-27 17:27 ` freisei
0 siblings, 1 reply; 3+ messages in thread
From: Han, Weidong @ 2009-02-27 1:44 UTC (permalink / raw)
To: 'freisei', 'kvm@vger.kernel.org'
freisei wrote:
> Hi List!
>
> i want to passthrough my isdn-card in a kvm-vm.
>
>> qemu-system-x86_64 -vnc :3 -m 2048 -name $vmname -hda
>> /dev/vg0/xp8asterisk -boot n -net nic,macaddr=52:54:00:58:08:03 -net
>> tap,script=/etc/qemu-ifup -usbdevice tablet -k de -smp 2 -monitor
>> stdio -pcidevice host=05: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=5 dev=4 func=0) get_real_device: region 0 size 32 start
>> 0xf9100000 type 512 resource_fd 14 get_real_device: region 1 size 32
>> 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=0000
>> val=0x00001244 len=2
>> assigned_dev_pci_read_config: (6.0): address=0002 val=0x00000e00
>> len=2 assigned_dev_pci_read_config: (6.0): address=0000
>> val=0x00001244 len=2 assigned_dev_pci_read_config: (6.0):
>> address=0002 val=0x00000e00 len=2 assigned_dev_pci_read_config:
>> (6.0): address=0000 val=0x00001244 len=2
>> assigned_dev_pci_read_config: (6.0): address=0002 val=0x00000e00
>> len=2 assigned_dev_pci_read_config: (6.0): address=000a
>> val=0x00000280 len=2 assigned_dev_pci_read_config: (6.0):
>> address=0000 val=0x00001244 len=2 assigned_dev_pci_read_config:
>> (6.0): address=0002 val=0x00000e00 len=2
>> assigned_dev_pci_write_config: (6.0): address=0010 val=0xffffffff
>> len=4 assigned_dev_pci_read_config: (6.0): address=0010
>> val=0xffffffe0 len=4 assigned_dev_pci_read_config: (6.0):
>> address=0010 val=0xffffffe0 len=4 assigned_dev_pci_write_config:
>> (6.0): address=0010 val=0xf2001100 len=4 assigned_dev_iomem_map:
>> e_phys=f2001100 r_virt=0x7f9374876000 type=0 len=00000020
>> region_num=0 create_userspace_phys_mem: Invalid argument
>> assigned_dev_iomem_map: Error: create new mapping failed
This error happened when the MMIO of assigned device is not page aligned. Here MMIO size of your device is 0x20 Bytes. The commit fb48c7c858cc612e3e1cb011c534075ac5de553d in kvm userspace should fix it. Was it included in your userspace? The commit changes rom bios, you can use "make bios", and "make install" to make it take effect. And I think replacing "-net nic,macaddr=52:54:00:58:08:03 -net tap,script=/etc/qemu-ifup" with "-net none" will also work for you.
Regards,
Weidong
> Already tried:
> - remove not needed-parameters
> - dma=none
> - set assign-device DEBUG (as you see)
>
> Additional Info:
> lspci:
> 05:04.0 Network controller: AVM GmbH Fritz!PCI v2.0 ISDN (rev 02)
Can you post output of "lspci -v"? We can see if its mmio is page aligned or not. Can you check if commit fb48c7c858cc612e3e1cb011c534075ac5de553d was included in your kvm-userspace?
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PCI Passthrough - create_userspace_phys_mem: Invalid argument
2009-02-27 1:44 ` Han, Weidong
@ 2009-02-27 17:27 ` freisei
0 siblings, 0 replies; 3+ messages in thread
From: freisei @ 2009-02-27 17:27 UTC (permalink / raw)
Cc: 'kvm@vger.kernel.org'
Han, Weidong schrieb:
> freisei wrote:
>
>> Hi List!
>>
>> i want to passthrough my isdn-card in a kvm-vm.
>>
>>
>>> qemu-system-x86_64 -vnc :3 -m 2048 -name $vmname -hda
>>> /dev/vg0/xp8asterisk -boot n -net nic,macaddr=52:54:00:58:08:03 -net
>>> tap,script=/etc/qemu-ifup -usbdevice tablet -k de -smp 2 -monitor
>>> stdio -pcidevice host=05: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=5 dev=4 func=0) get_real_device: region 0 size 32 start
>>> 0xf9100000 type 512 resource_fd 14 get_real_device: region 1 size 32
>>> 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=0000
>>> val=0x00001244 len=2
>>> assigned_dev_pci_read_config: (6.0): address=0002 val=0x00000e00
>>> len=2 assigned_dev_pci_read_config: (6.0): address=0000
>>> val=0x00001244 len=2 assigned_dev_pci_read_config: (6.0):
>>> address=0002 val=0x00000e00 len=2 assigned_dev_pci_read_config:
>>> (6.0): address=0000 val=0x00001244 len=2
>>> assigned_dev_pci_read_config: (6.0): address=0002 val=0x00000e00
>>> len=2 assigned_dev_pci_read_config: (6.0): address=000a
>>> val=0x00000280 len=2 assigned_dev_pci_read_config: (6.0):
>>> address=0000 val=0x00001244 len=2 assigned_dev_pci_read_config:
>>> (6.0): address=0002 val=0x00000e00 len=2
>>> assigned_dev_pci_write_config: (6.0): address=0010 val=0xffffffff
>>> len=4 assigned_dev_pci_read_config: (6.0): address=0010
>>> val=0xffffffe0 len=4 assigned_dev_pci_read_config: (6.0):
>>> address=0010 val=0xffffffe0 len=4 assigned_dev_pci_write_config:
>>> (6.0): address=0010 val=0xf2001100 len=4 assigned_dev_iomem_map:
>>> e_phys=f2001100 r_virt=0x7f9374876000 type=0 len=00000020
>>> region_num=0 create_userspace_phys_mem: Invalid argument
>>> assigned_dev_iomem_map: Error: create new mapping failed
>>>
>
> This error happened when the MMIO of assigned device is not page aligned. Here MMIO size of your device is 0x20 Bytes. The commit fb48c7c858cc612e3e1cb011c534075ac5de553d in kvm userspace should fix it. Was it included in your userspace?
Thanks for your answer!
How can i check if the commit is included? And where to checkout the
latest snapshot?
I am using kvm-84 sources from sourceforge and kernel 2.6.29rc6 on
ubuntu 8.10
qemu-system-x86_64 |more
QEMU PC emulator version 0.9.1 (kvm-84), Copyright (c) 2003-2008 Fabrice
Bellard
> The commit changes rom bios, you can use "make bios", and "make install" to make it take effect. And I think replacing "-net nic,macaddr=52:54:00:58:08:03 -net tap,script=/etc/qemu-ifup" with "-net none" will also work for you.
>
> Regards,
> Weidong
>
>
making and installing bios done - no changes.
with "-net none" it WORKS! Bud i need network... i´ll try to passthrough
my Intel PCIx NIC too...
>> Already tried:
>> - remove not needed-parameters
>> - dma=none
>> - set assign-device DEBUG (as you see)
>>
>> Additional Info:
>> lspci:
>> 05:04.0 Network controller: AVM GmbH Fritz!PCI v2.0 ISDN (rev 02)
>>
>
> Can you post output of "lspci -v"? We can see if its mmio is page aligned or not. Can you check if commit fb48c7c858cc612e3e1cb011c534075ac5de553d was included in your kvm-userspace?
>
>
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=32]
I/O ports at 3000 [size=32]
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
>>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-02-27 17:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-26 14:58 PCI Passthrough - create_userspace_phys_mem: Invalid argument freisei
2009-02-27 1:44 ` Han, Weidong
2009-02-27 17:27 ` freisei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox