Skip to contentSkip to conversation

DMA-Bug using PCI-Passthrough (xen-3.1.0, gentoo amd64)

DISCUSSION Stefan Neuwirth 3 participants 5 messages Jun 25, 2007

lore
Share & tools
lore
#0 lore raw

Hi there,

I'm running xen-3.1.0 using gentoo amd64 for dom0. When starting a PV guest domain everything is fine, up to the moment I try to configure the ethernet device. The device is a real ethernet card that shown to the guest by using pci passthrough.

~ # ifconfig eth4
eth4 Link encap:Ethernet HWaddr 00:00:D1:ED:14:02
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:22

~ # ifconfig eth4 192.168.0.131 netmask 255.255.255.0 up ----------- [cut here ] --------- [please bite here ] ---------

Kernel BUG at ...arch/x86_64/kernel/../../i386/kernel/pci-dma-xen.c:331
invalid opcode: 0000 [1] SMP 
CPU 0 
Modules linked in: usbcore starfire mii
Pid: 2978, comm: ifconfig Not tainted 2.6.18-xen #8
RIP: e030:[<ffffffff80210bdd>]  [<ffffffff80210bdd>] dma_map_single+0x19a/0x1b2
RSP: e02b:ffff88001f517d48  EFLAGS: 00010292
RAX: 000000000000002f RBX: ffff88000019a810 RCX: ffff88001f516000
RDX: ffffffffff578000 RSI: 0000000000000001 RDI: ffffffff80561340
RBP: 00000004397da810 R08: 00000000a83abafa R09: 0000000000000000
R10: 0000000000000000 R11: 00000000000000c8 R12: 0000000000000600
R13: ffff88000007f070 R14: 0000000000000070 R15: ffff88001f7e0000
FS:  00002b009bbc36d0(0000) GS:ffffffff805e5000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000
Process ifconfig (pid: 2978, threadinfo ffff88001f516000, task ffff8800001eb8c0)
Stack:  ffff88001f7e05e0 ffff88001f6d37c0 ffff88001f7e05e0 ffff88001f7e0500
 000000000000000f ffffffff880047e4 0000000000000000 ffffc20000280000
 000000001fad8340 ffffc200002d0070 ffffc200002d0040 ffff88001f7e0000
Call Trace:
 [<ffffffff880047e4>] :starfire:netdev_open+0x264/0x690
 [<ffffffff80452ee0>] dev_open+0x2d/0x70
 [<ffffffff80450ccb>] dev_change_flags+0x5c/0x11e
 [<ffffffff8049394d>] devinet_ioctl+0x2a4/0x6a7
 [<ffffffff80217749>] do_page_fault+0xdf8/0x1198
 [<ffffffff80446c55>] sock_ioctl+0x214/0x239
 [<ffffffff80287f71>] do_ioctl+0x21/0x79
 [<ffffffff8028823d>] vfs_ioctl+0x274/0x28d
 [<ffffffff802740e5>] fd_install+0x25/0x5f
 [<ffffffff802882b1>] sys_ioctl+0x5b/0x7e
 [<ffffffff80209f8a>] system_call+0x86/0x8b
 [<ffffffff80209f04>] system_call+0x0/0x8b


Code: 0f 0b 68 78 15 4f 80 c2 4b 01 48 89 e8 48 83 c4 08 5b 5d 41 
RIP  [<ffffffff80210bdd>] dma_map_single+0x19a/0x1b2
 RSP <ffff88001f517d48>
 Segmentation fault

The same happens when using a tulip based ethernet card instead of the adaptec starfire card.

Any hints?

Stefan

#1 lore raw
Quoted 4 lines

I'm running xen-3.1.0 using gentoo amd64 for dom0. When starting a PV guest domain everything is fine, up to the moment I try to configure the ethernet device. The device is a real ethernet card that shown to the guest by using pci passthrough.

Can you repro using the linux kernel that's part of the Xen 3.1.0 distribution?

Ian

Quoted 9 lines

~ # ifconfig eth4
eth4 Link encap:Ethernet HWaddr 00:00:D1:ED:14:02
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:22

Quoted 3 lines

~ # ifconfig eth4 192.168.0.131 netmask 255.255.255.0 up ----------- [cut here ] --------- [please bite here ] ---------

Kernel BUG at

...arch/x86_64/kernel/../../i386/kernel/pci-dma-xen.c:331

Quoted 52 lines

invalid opcode: 0000 [1] SMP
CPU 0

Modules linked in: usbcore starfire mii
Pid: 2978, comm: ifconfig Not tainted 2.6.18-xen #8
RIP: e030:[<ffffffff80210bdd>]  [<ffffffff80210bdd>]
dma_map_single+0x19a/0x1b2
RSP: e02b:ffff88001f517d48  EFLAGS: 00010292
RAX: 000000000000002f RBX: ffff88000019a810 RCX: ffff88001f516000
RDX: ffffffffff578000 RSI: 0000000000000001 RDI: ffffffff80561340
RBP: 00000004397da810 R08: 00000000a83abafa R09: 0000000000000000
R10: 0000000000000000 R11: 00000000000000c8 R12: 0000000000000600
R13: ffff88000007f070 R14: 0000000000000070 R15: ffff88001f7e0000
FS:  00002b009bbc36d0(0000) GS:ffffffff805e5000(0000)

knlGS:0000000000000000
CS: e033 DS: 0000 ES: 0000
Process ifconfig (pid: 2978, threadinfo ffff88001f516000, task ffff8800001eb8c0)

Stack:  ffff88001f7e05e0 ffff88001f6d37c0 ffff88001f7e05e0
ffff88001f7e0500
 000000000000000f ffffffff880047e4 0000000000000000 ffffc20000280000
 000000001fad8340 ffffc200002d0070 ffffc200002d0040 ffff88001f7e0000
Call Trace:
 [<ffffffff880047e4>] :starfire:netdev_open+0x264/0x690
 [<ffffffff80452ee0>] dev_open+0x2d/0x70
 [<ffffffff80450ccb>] dev_change_flags+0x5c/0x11e
 [<ffffffff8049394d>] devinet_ioctl+0x2a4/0x6a7
 [<ffffffff80217749>] do_page_fault+0xdf8/0x1198
 [<ffffffff80446c55>] sock_ioctl+0x214/0x239
 [<ffffffff80287f71>] do_ioctl+0x21/0x79
 [<ffffffff8028823d>] vfs_ioctl+0x274/0x28d
 [<ffffffff802740e5>] fd_install+0x25/0x5f
 [<ffffffff802882b1>] sys_ioctl+0x5b/0x7e
 [<ffffffff80209f8a>] system_call+0x86/0x8b
 [<ffffffff80209f04>] system_call+0x0/0x8b


Code: 0f 0b 68 78 15 4f 80 c2 4b 01 48 89 e8 48 83 c4 08 5b 5d 41
RIP  [<ffffffff80210bdd>] dma_map_single+0x19a/0x1b2
 RSP <ffff88001f517d48>
 Segmentation fault

The same happens when using a tulip based ethernet card instead of the adaptec starfire card.

Any hints?

Stefan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 7 lines · Ian Pratt
Quoted 4 lines

I'm running xen-3.1.0 using gentoo amd64 for dom0. When starting a PV guest domain everything is fine, up to the moment I try to configure the ethernet device. The device is a real ethernet card that shown to the guest by using pci passthrough.

Can you repro using the linux kernel that's part of the Xen 3.1.0 distribution?

It's a source build of xen-3.1.0 and the kernel is linux-2.6.18-xen (same for dom0 and domU), I just changed some config items to get things running on the machine.

Stefan

#3 lore raw
In reply to Stefan Neuwirth

You might need to explicitly request a swiotlb ('swiotlb=force').

K.

Quoted 69 lines · Stefan Neuwirth

Hi there,

I'm running xen-3.1.0 using gentoo amd64 for dom0. When starting a PV guest domain everything is fine, up to the moment I try to configure the ethernet device. The device is a real ethernet card that shown to the guest by using pci passthrough.

~ # ifconfig eth4
eth4 Link encap:Ethernet HWaddr 00:00:D1:ED:14:02
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:22

~ # ifconfig eth4 192.168.0.131 netmask 255.255.255.0 up ----------- [cut here ] --------- [please bite here ] ---------

Kernel BUG at ...arch/x86_64/kernel/../../i386/kernel/pci-dma-xen.c:331
invalid opcode: 0000 [1] SMP
CPU 0 
Modules linked in: usbcore starfire mii
Pid: 2978, comm: ifconfig Not tainted 2.6.18-xen #8
RIP: e030:[<ffffffff80210bdd>]  [<ffffffff80210bdd>]
dma_map_single+0x19a/0x1b2
RSP: e02b:ffff88001f517d48  EFLAGS: 00010292
RAX: 000000000000002f RBX: ffff88000019a810 RCX: ffff88001f516000
RDX: ffffffffff578000 RSI: 0000000000000001 RDI: ffffffff80561340
RBP: 00000004397da810 R08: 00000000a83abafa R09: 0000000000000000
R10: 0000000000000000 R11: 00000000000000c8 R12: 0000000000000600
R13: ffff88000007f070 R14: 0000000000000070 R15: ffff88001f7e0000
FS:  00002b009bbc36d0(0000) GS:ffffffff805e5000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000
Process ifconfig (pid: 2978, threadinfo ffff88001f516000, task
ffff8800001eb8c0)
Stack:  ffff88001f7e05e0 ffff88001f6d37c0 ffff88001f7e05e0 ffff88001f7e0500
 000000000000000f ffffffff880047e4 0000000000000000 ffffc20000280000
 000000001fad8340 ffffc200002d0070 ffffc200002d0040 ffff88001f7e0000
Call Trace:
 [<ffffffff880047e4>] :starfire:netdev_open+0x264/0x690
 [<ffffffff80452ee0>] dev_open+0x2d/0x70
 [<ffffffff80450ccb>] dev_change_flags+0x5c/0x11e
 [<ffffffff8049394d>] devinet_ioctl+0x2a4/0x6a7
 [<ffffffff80217749>] do_page_fault+0xdf8/0x1198
 [<ffffffff80446c55>] sock_ioctl+0x214/0x239
 [<ffffffff80287f71>] do_ioctl+0x21/0x79
 [<ffffffff8028823d>] vfs_ioctl+0x274/0x28d
 [<ffffffff802740e5>] fd_install+0x25/0x5f
 [<ffffffff802882b1>] sys_ioctl+0x5b/0x7e
 [<ffffffff80209f8a>] system_call+0x86/0x8b
 [<ffffffff80209f04>] system_call+0x0/0x8b


Code: 0f 0b 68 78 15 4f 80 c2 4b 01 48 89 e8 48 83 c4 08 5b 5d 41
RIP  [<ffffffff80210bdd>] dma_map_single+0x19a/0x1b2
 RSP <ffff88001f517d48>
 Segmentation fault

The same happens when using a tulip based ethernet card instead of the adaptec starfire card.

Any hints?

Stefan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#4 lore raw
Quoted 1 line · Keir Fraser

You might need to explicitly request a swiotlb ('swiotlb=force').

Solved the problem, thank you.

Stefan