IOMMU howto

Reference:

How to assign devices with VT-d in KVM
http://www.linux-kvm.org/page/How_to_assign_devices_with_VT-d_in_KVM

Adding a PCI device with virsh
http://www.linuxtopia.org/online_books/rhel6/rhel_6_virtualization/rhel_6_virtualization_chap-Virtualization-PCI_passthrough.html

PCI passthrough on VirtualBox
http://howtoware.blogspot.com/2012/01/oracle-vm-virtualbox-how-to-use-pci.html

List of IOMMU-supporting hardware
http://en.wikipedia.org/wiki/List_of_IOMMU-supporting_hardware


http://pic.dhe.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=%2Fliaat%2Fliaatbppcipassthru.htm


SR-IOV howto:
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Virtualization/sect-Para-virtualized_Windows_Drivers_Guide-How_SR_IOV_Libvirt_Works.html

Linux virtualization and PCI passthrough
http://www.ibm.com/developerworks/library/l-pci-passthrough/


内核启动参数要加上intel_iommu=on


dmesg | grep -e DMAR -e IOMMU


有输出,没问题,继续


lspci -nn

找到相应的的pci设备,关于pci数据格式参考:http://prefetch.net/articles/linuxpci.html

01:00.0 Ethernet controller [0200]: Intel Corporation 82576 Gigabit Network Connection [8086:10c9] (rev 01)
01:00.1 Ethernet controller [0200]: Intel Corporation 82576 Gigabit Network Connection[8086:10c9] (rev 01)


如果通过libvirt:

<hostdev mode='subsystem' type='pci' managed='yes'>
    <source>
      <address domain='0x000' bus='0x01' slot='0x00' function='0x1'/>
    </source>
</hostdev> 


如果通过qemu命令行(未测试)

echo "8086 10c9" > /sys/bus/pci/drivers/pci-stub/new_id

echo "0000:01:00.1" > /sys/bus/pci/devices/0000:01:00.1/driver/unbind

echo "0000:01:00.1" > /sys/bus/pci/drivers/pci-stub/bind


qemu 参数:-device pci-assign,host=01:00.1


如参数:qemu-kvm   -enable-kvm -nographic -drive file=/mnt/sdb/vms/testfc/testfc.qcow2,if=virtio,index=0,format=qcow2 -device pci-assign,host=01:00.1

hot add: 
device_add pci-assign,host=01:00.0,id=mydevice
hot remove:
device_del mydevice


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值