Xen SATA PCI Passthrough到Ubutnu DomU不识别磁盘

我有一个Debian Wheezy 7.4 Dom0(hmpyxen01)的Xen 4.1服务器。 它有一个SATA PCI卡,我正在通过一个Ubuntu Precise 12.04 DomU(hmvmtmp01),通过xen-tools安装,在这种情况下,这只是一个debootstrap的包装,所以DomU是非常小的(像lshw和lspci这样的工具在启动DomU后手动安装)。

存储控制器使用Dom0中的pciback模块时,传递本身似乎可以正常工作:

root@hmpyxen01:~# lspci -k ...snip... 00:1f.2 SATA controller: Intel Corporation 82801JI (ICH10 Family) SATA AHCI Controller Subsystem: ASUSTeK Computer Inc. P5Q Deluxe Motherboard Kernel driver in use: pciback ...snip... 

并出现在DomU:

 root@hmvmtmp01:~# lspci -k 00:00.2 SATA controller: Intel Corporation 82801JI (ICH10 Family) SATA AHCI Controller Subsystem: ASUSTeK Computer Inc. P5Q Deluxe Motherboard Kernel driver in use: ahci root@hmvmtmp01:~# lshw -class storage *-storage description: SATA controller product: 82801JI (ICH10 Family) SATA AHCI Controller vendor: Intel Corporation physical id: 0.2 bus info: pci@0000:00:00.2 version: 00 width: 32 bits clock: 66MHz capabilities: storage msi pm ahci_1.0 bus_master cap_list configuration: driver=ahci latency=0 resources: irq:29 ioport:9c00(size=8) ioport:9880(size=4) ioport:9800(size=8) ioport:9480(size=4) ioport:9400(size=32) memory:f9cfc000-f9cfc7ff 

不幸的是,在DomU中似乎没有连接的磁盘,只有由pipe理程序设置的root / swap Xen驱动器。

 root@hmvmtmp01:~# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvda2 202:2 0 10G 0 disk / xvda1 202:1 0 1G 0 disk [SWAP] root@hmvmtmp01:~# lshw -class disk root@hmvmtmp01:~# 

它看起来好像dmesgfind控制器和磁盘,但有些失败:

 root@hmvmtmp01:~# dmesg ...snip... [ 4.192202] pcifront pci-0: Installing PCI frontend [ 4.192263] pcifront pci-0: Creating PCI Frontend Bus 0000:00 [ 4.192636] pci 0000:00:00.2: [8086:3a22] type 0 class 0x000106 [ 4.192810] pci 0000:00:00.2: reg 10: [io 0x9c00-0x9c07] [ 4.192886] pci 0000:00:00.2: reg 14: [io 0x9880-0x9883] [ 4.192959] pci 0000:00:00.2: reg 18: [io 0x9800-0x9807] [ 4.193033] pci 0000:00:00.2: reg 1c: [io 0x9480-0x9483] [ 4.193132] pci 0000:00:00.2: reg 20: [io 0x9400-0x941f] [ 4.193198] pci 0000:00:00.2: reg 24: [mem 0xf9cfc000-0xf9cfc7ff] [ 4.193718] pcifront pci-0: New device on 0000:00:00.02 found. [ 4.195283] pcifront pci-0: claiming resource 0000:00:00.2/0 [ 4.195286] pcifront pci-0: claiming resource 0000:00:00.2/1 [ 4.195287] pcifront pci-0: claiming resource 0000:00:00.2/2 [ 4.195289] pcifront pci-0: claiming resource 0000:00:00.2/3 [ 4.195290] pcifront pci-0: claiming resource 0000:00:00.2/4 [ 4.195292] pcifront pci-0: claiming resource 0000:00:00.2/5 [ 4.195325] ahci 0000:00:00.2: version 3.0 [ 4.195352] ahci 0000:00:00.2: enabling device (0000 -> 0003) [ 4.195421] ahci 0000:00:00.2: Xen PCI mapped GSI20 to IRQ28 [ 4.195650] ahci: SSS flag set, parallel bus scan disabled [ 4.195702] ahci 0000:00:00.2: AHCI 0001.0200 32 slots 6 ports 3 Gbps 0x3f impl SATA mode [ 4.195705] ahci 0000:00:00.2: flags: 64bit ncq sntf stag pm led clo pmp pio slum part ccc ems sxs [ 4.195752] ahci 0000:00:00.2: setting latency timer to 64 [ 4.235098] scsi0 : ahci [ 4.236153] scsi1 : ahci [ 4.238341] scsi2 : ahci [ 4.241175] scsi3 : ahci [ 4.242971] scsi4 : ahci [ 4.245287] scsi5 : ahci [ 4.245331] ata1: SATA max UDMA/133 abar m2048@0xf9cfc000 port 0xf9cfc100 irq 29 [ 4.245333] ata2: SATA max UDMA/133 abar m2048@0xf9cfc000 port 0xf9cfc180 irq 29 [ 4.245336] ata3: SATA max UDMA/133 abar m2048@0xf9cfc000 port 0xf9cfc200 irq 29 [ 4.245338] ata4: SATA max UDMA/133 abar m2048@0xf9cfc000 port 0xf9cfc280 irq 29 [ 4.245340] ata5: SATA max UDMA/133 abar m2048@0xf9cfc000 port 0xf9cfc300 irq 29 [ 4.245342] ata6: SATA max UDMA/133 abar m2048@0xf9cfc000 port 0xf9cfc380 irq 29 [ 6.427298] init: failsafe main process (429) killed by TERM signal [ 6.460121] init: rc-sysinit main process (550) killed by TERM signal [ 14.244071] ata1: softreset failed (1st FIS failed) [ 14.480058] eth0: no IPv6 routers present [ 24.244072] ata1: softreset failed (1st FIS failed) [ 59.244072] ata1: softreset failed (1st FIS failed) [ 59.244087] ata1: limiting SATA link speed to 1.5 Gbps [ 64.244070] ata1: softreset failed (1st FIS failed) [ 64.244082] ata1: reset failed, giving up [ 74.244070] ata2: softreset failed (1st FIS failed) [ 84.244071] ata2: softreset failed (1st FIS failed) [ 119.244072] ata2: softreset failed (1st FIS failed) [ 119.244084] ata2: limiting SATA link speed to 1.5 Gbps [ 124.244071] ata2: softreset failed (1st FIS failed) [ 124.244083] ata2: reset failed, giving up [ 124.372116] init: udevtrigger post-stop process (335) terminated with status 1 [ 124.390542] init: udev-fallback-graphics main process (674) terminated with status 1 [ 124.407645] init: plymouth-splash main process (682) terminated with status 1 [ 134.244071] ata3: softreset failed (1st FIS failed) [ 144.244071] ata3: softreset failed (1st FIS failed) [ 179.244070] ata3: softreset failed (1st FIS failed) [ 179.244083] ata3: limiting SATA link speed to 1.5 Gbps [ 184.244071] ata3: softreset failed (1st FIS failed) [ 184.244083] ata3: reset failed, giving up [ 194.244071] ata4: softreset failed (1st FIS failed) [ 204.244071] ata4: softreset failed (1st FIS failed) [ 239.244071] ata4: softreset failed (1st FIS failed) [ 239.244083] ata4: limiting SATA link speed to 1.5 Gbps [ 244.244070] ata4: softreset failed (1st FIS failed) [ 244.244082] ata4: reset failed, giving up [ 244.564074] ata5: SATA link down (SStatus 0 SControl 300) [ 244.884073] ata6: SATA link down (SStatus 0 SControl 300) 

正如我之前提到的,我有一种感觉,这是与xen-tools的安装方法有关,DomU可能会丢失一些简单的东西,但我不知道是什么…

很感谢任何forms的帮助。

编辑:添加信息RE热插拔

所以我重新启动了没有连接驱动器的DomU机器,并将它们插入已经运行的系统中。 这里是输出forms:

 [ 305.424655] ata3: exception Emask 0x10 SAct 0x0 SErr 0x4040000 action 0xe frozen [ 305.424671] ata3: irq_stat 0x00000040, connection status changed [ 305.424681] ata3: SError: { CommWake DevExch } [ 305.424688] ata3: hard resetting link [ 308.353316] ata4: exception Emask 0x10 SAct 0x0 SErr 0x4040000 action 0xe frozen [ 308.353328] ata4: irq_stat 0x00000040, connection status changed [ 308.353337] ata4: SError: { CommWake DevExch } [ 308.353346] ata4: hard resetting link [ 310.651627] ata1: exception Emask 0x10 SAct 0x0 SErr 0x4040000 action 0xe frozen [ 310.651639] ata1: irq_stat 0x00000040, connection status changed [ 310.651648] ata1: SError: { CommWake DevExch } [ 310.651661] ata1: hard resetting link [ 313.120770] ata2: exception Emask 0x10 SAct 0x0 SErr 0x4040000 action 0xe frozen [ 313.120783] ata2: irq_stat 0x00000040, connection status changed [ 313.120791] ata2: SError: { CommWake DevExch } [ 313.120804] ata2: hard resetting link [ 315.428073] ata3: softreset failed (1st FIS failed) [ 315.428083] ata3: hard resetting link [ 318.356070] ata4: softreset failed (1st FIS failed) [ 318.356080] ata4: hard resetting link 

所有驱动器都可以正常工作,因为没有启用xen-passthrough,驱动器都可以从Dom0访问和读取。

哇,把我的头发拉出来三天

我不知道是不是因为我的主板芯片组不支持VT-d(只有VT-x),但是在DomU中,我必须添加一个简单的iommu=soft/boot/grub/menu.lst ,它解决了一切!

最后总是很简单的事情。