![尝试将 NIC 传递到 domU 导致内核崩溃](https://linux22.com/image/516892/%E5%B0%9D%E8%AF%95%E5%B0%86%20NIC%20%E4%BC%A0%E9%80%92%E5%88%B0%20domU%20%E5%AF%BC%E8%87%B4%E5%86%85%E6%A0%B8%E5%B4%A9%E6%BA%83.png)
我在 dom0 和 domU 上都使用 CentOS 5.5 x64。我尝试通过 3 端口 NIC(瑞昱半导体有限公司 RTL-8110SC/8169SC 千兆以太网(修订版 10)) 使用 pciback 连接到 domU。但是,当 NIC 上的第一个端口联机时,它会导致 domU 崩溃。有什么建议吗?(eth0 是板载 NIC,工作正常)。
编辑:顺便说一下,将“swiotlb = force”添加到 domU 内核行(如转储中所建议的)会导致 domU 失败并出现相同的错误,只是它会在启动 vm 时立即发生。
Bringing up interface eth0:
Determining IP information for eth0... done. [ OK ]
Bringing up interface eth1:
Determining IP information for eth1...Fatal DMA error! Please use 'swiotlb=force'
----------- [cut here ] --------- [please bite here ] ---------
Kernel BUG at arch/x86_64/kernel/../../i386/kernel/pci-dma-xen.c:394
invalid opcode: 0000 [1] SMP
last sysfs file: /class/net/eth1/address
CPU 0
Modules linked in: be2iscsi ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp bnx2i cnic ipv6 xfrm_nalgo crypto_api uio cxgb3i cxgb3 8021q libiscsi_tcp libiscsi2 scsi_transport_iscsi2 scsi_transport_iscsi loop dm_mirror dm_multipath scsi_dh scsi_mod parport_pc lp parport r8169 mii pcspkr xennet dm_raid45 dm_message dm_region_hash dm_log dm_mod dm_mem_cache xenblk ext3 jbd uhci_hcd ohci_hcd ehci_hcd
Pid: 1359, comm: ip Not tainted 2.6.18-194.el5xen #1
RIP: e030:[<ffffffff802723ff>] [<ffffffff802723ff>] dma_map_single+0x12d/0x17d
RSP: e02b:ffff880014bedcb8 EFLAGS: 00010282
RAX: 000000000000002f RBX: ffff880014a60012 RCX: ffff880017f01870
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000003724012 R08: 000000000000002c R09: ffff880000def000
R10: 000000000000002d R11: ffff880015d091e0 R12: 0000000000003fff
R13: ffff880017f01870 R14: 0000000000000000 R15: 0000000000003fff
FS: 00002ad23cbecaf0(0000) GS:ffffffff805d2000(0000) knlGS:0000000000000000
CS: e033 DS: 0000 ES: 0000
Process ip (pid: 1359, threadinfo ffff880014bec000, task ffff8800144b77a0)
Stack: 0000000000000002 ffff880015e304c0 ffff880011f61000 0000000000000000
0000000000000002 ffffffff8810b474 0000001e00000000 0000000000000100
ffff880016f64000 ffff880016f64500
Call Trace:
[<ffffffff8810b474>] :r8169:rtl8169_rx_fill+0x11e/0x188
[<ffffffff8810c6c6>] :r8169:rtl8169_init_ring+0x70/0x9f
[<ffffffff8810c9a3>] :r8169:rtl8169_open+0x9f/0x1c6
[<ffffffff80420ace>] dev_open+0x58/0x97
[<ffffffff8041e9d8>] dev_change_flags+0x5a/0x11a
[<ffffffff804534d2>] devinet_ioctl+0x235/0x59c
[<ffffffff804162b2>] sock_ioctl+0x1c1/0x1e5
[<ffffffff80244265>] do_ioctl+0x21/0x6b
[<ffffffff80231924>] vfs_ioctl+0x457/0x4b9
[<ffffffff8024ea38>] sys_ioctl+0x59/0x78
[<ffffffff80260106>] system_call+0x86/0x8b
[<ffffffff80260080>] system_call+0x0/0x8b
Code: 0f 0b 68 f6 7e 49 80 c2 8a 01 4d 85 ed 74 11 49 8b 85 18 02
RIP [<ffffffff802723ff>] dma_map_single+0x12d/0x17d
RSP <ffff880014bedcb8>
<0>Kernel panic - not syncing: Fatal exception
答案1
问题出在 NIC 驱动程序故障。我的研究表明,我可以修补并重新编译驱动程序,但更简单的方法是更换不同的 NIC。