今天因为kvm guest中upnp的问题翻了下kvm的wiki,在how-to里发现了"How to assign devices with VT-d in KVM "。大意是通过在编译内核时开启bus 选项中的某些特性,可以在host解除pci设备和host驱动的绑定,然后让guest直接使用物理pci设备。这样的话,似乎kvm guest直接使用物理显卡是可行的?或者我理解有误?
可惜仅仅提到了VT-d,我这台amd的机器没办法试验了。。。
地址在这里http://www.linux-kvm.org/page/How_to_assign_de ... T-d_in_KVM
在支持VT-d的cpu上,kvm似乎可以让guest直接访问host的pci设备?
-
- 帖子: 131
- 注册时间: 2009-05-25 23:38
-
- 帖子: 115
- 注册时间: 2007-05-26 18:09
Re: 在支持VT-d的cpu上,kvm似乎可以让guest直接访问host的pci设备?
具体开啥啊??pcidevice 这是啥啊?
-
- 帖子: 115
- 注册时间: 2007-05-26 18:09
Re: 在支持VT-d的cpu上,kvm似乎可以让guest直接访问host的pci设备?
新的PCI设备转让的支持
The new pci device assignment allows you to assign a device on your host to a guest.新的PCI设备分配允许您指定您的主机设备的客人。 There is a new command line option –pcidevice added for this support.有一个新的命令行选项- pcidevice增加了对这种支持。 As an example, if you have a pci device sitting at 04:08.0 ( pci bus:dev.fn) you can use the following option when starting kvm guest to assign the device.举例来说,如果您有一个PCI设备在04:08.0会议(PCI总线:dev.fn),你可以使用下面的选项启动时KVM客户指定的设备。
- pcidevice host=插槽号 要注意使用这一新功能。
The host driver for the device, if any, needs to be removed first or assignment will fail.该设备的主机驱动程序,如果有的话,需要先删除或转让将失败。
Currently, you cannot assign a device that shares irq with another host device目前,您不能指定一个共享的另一种主机设备的IRQ设备
The raw_io capability is needed for this to work该raw_io能力是需要这种工作
This works only with the in-kernel irqchip method.这只能与内核irqchip方法。 In order to use the userspace irqchip, a kernel module (irqhook) and some extra changes are needed.为了使用用户空间irqchip,一个内核模块(irqhook)和一些额外的改变是必要的。
In order to hot plug host pci devices into your guest , you have to issue the command from your monitor using the pci_add command.为了把你的客人热插拔PCI设备的主机,你发出的命令,从您的显示器使用pci_add命令。
The new pci device assignment allows you to assign a device on your host to a guest.新的PCI设备分配允许您指定您的主机设备的客人。 There is a new command line option –pcidevice added for this support.有一个新的命令行选项- pcidevice增加了对这种支持。 As an example, if you have a pci device sitting at 04:08.0 ( pci bus:dev.fn) you can use the following option when starting kvm guest to assign the device.举例来说,如果您有一个PCI设备在04:08.0会议(PCI总线:dev.fn),你可以使用下面的选项启动时KVM客户指定的设备。
- pcidevice host=插槽号 要注意使用这一新功能。
The host driver for the device, if any, needs to be removed first or assignment will fail.该设备的主机驱动程序,如果有的话,需要先删除或转让将失败。
Currently, you cannot assign a device that shares irq with another host device目前,您不能指定一个共享的另一种主机设备的IRQ设备
The raw_io capability is needed for this to work该raw_io能力是需要这种工作
This works only with the in-kernel irqchip method.这只能与内核irqchip方法。 In order to use the userspace irqchip, a kernel module (irqhook) and some extra changes are needed.为了使用用户空间irqchip,一个内核模块(irqhook)和一些额外的改变是必要的。
In order to hot plug host pci devices into your guest , you have to issue the command from your monitor using the pci_add command.为了把你的客人热插拔PCI设备的主机,你发出的命令,从您的显示器使用pci_add命令。
-
- 帖子: 115
- 注册时间: 2007-05-26 18:09
Re: 在支持VT-d的cpu上,kvm似乎可以让guest直接访问host的pci设备?
lspci -n
locate the entry for device 01:00.0 and note down the vendor & device ID 8086:10b9
...
01:00.0 0200: 8086:10b9 (rev 06)
...
echo "8086 10b9" > /sys/bus/pci/drivers/pci-stub/new_id
echo 0000:01:00.0 > /sys/bus/pci/devices/0000:01:00.0/driver/unbind
echo 0000:01:00.0 > /sys/bus/pci/drivers/pci-stub/bind
这和VT-d没关系。只和主板有光
locate the entry for device 01:00.0 and note down the vendor & device ID 8086:10b9
...
01:00.0 0200: 8086:10b9 (rev 06)
...
echo "8086 10b9" > /sys/bus/pci/drivers/pci-stub/new_id
echo 0000:01:00.0 > /sys/bus/pci/devices/0000:01:00.0/driver/unbind
echo 0000:01:00.0 > /sys/bus/pci/drivers/pci-stub/bind
这和VT-d没关系。只和主板有光
-
- 帖子: 131
- 注册时间: 2009-05-25 23:38
Re: 在支持VT-d的cpu上,kvm似乎可以让guest直接访问host的pci设备?
这个应该只是为了让pci设备和驱动的解绑,没有VT-d的虚拟化支持,kvm应该无法让guest直接访问物理pci设备。wheel 写了:lspci -n
locate the entry for device 01:00.0 and note down the vendor & device ID 8086:10b9
...
01:00.0 0200: 8086:10b9 (rev 06)
...
echo "8086 10b9" > /sys/bus/pci/drivers/pci-stub/new_id
echo 0000:01:00.0 > /sys/bus/pci/devices/0000:01:00.0/driver/unbind
echo 0000:01:00.0 > /sys/bus/pci/drivers/pci-stub/bind
这和VT-d没关系。只和主板有光
-
- 帖子: 1
- 注册时间: 2011-04-26 9:37
Re: 在支持VT-d的cpu上,kvm似乎可以让guest直接访问host的pci设备?
我在pci-stub目录下的new_id,bind,unbind等文件不能写进内容,提示的是没有权限,但我已经是root用户了,而且也用chmod更改了文件的读写权限,请问这是怎么回事
-
- 帖子: 215
- 注册时间: 2007-08-04 22:09
- 系统: ArchLinux
- 联系:
Re: 在支持VT-d的cpu上,kvm似乎可以让guest直接访问host的pci设备?
无操作过程无真相。dafengqixi 写了:我在pci-stub目录下的new_id,bind,unbind等文件不能写进内容,提示的是没有权限,但我已经是root用户了,而且也用chmod更改了文件的读写权限,请问这是怎么回事
Twitter: http://twitter.com/muxueqz
Literarylark: https://literarylark.com/
聊逍遥兮容与: http://muxueqz.top
Literarylark: https://literarylark.com/
聊逍遥兮容与: http://muxueqz.top
-
- 帖子: 1
- 注册时间: 2016-10-15 16:31
- 系统: ubuntu redhat suse
Re: 在支持VT-d的cpu上,kvm似乎可以让guest直接访问host的pci设备?
安装ubuntu14.04版本,没有/sys/bus/pci/drivers/pci-stub/这个目录,请教大家一下?