qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

docs: Add section for NVMe VFIO driver

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20180116060901.17413-9-famz@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>

+38
+37
docs/qemu-block-drivers.texi
··· 785 785 With sufficiently new versions of libssh2 and OpenSSH, @code{fsync} is 786 786 supported. 787 787 788 + @node disk_images_nvme 789 + @subsection NVMe disk images 790 + 791 + NVM Express (NVMe) storage controllers can be accessed directly by a userspace 792 + driver in QEMU. This bypasses the host kernel file system and block layers 793 + while retaining QEMU block layer functionalities, such as block jobs, I/O 794 + throttling, image formats, etc. Disk I/O performance is typically higher than 795 + with @code{-drive file=/dev/sda} using either thread pool or linux-aio. 796 + 797 + The controller will be exclusively used by the QEMU process once started. To be 798 + able to share storage between multiple VMs and other applications on the host, 799 + please use the file based protocols. 800 + 801 + Before starting QEMU, bind the host NVMe controller to the host vfio-pci 802 + driver. For example: 803 + 804 + @example 805 + # modprobe vfio-pci 806 + # lspci -n -s 0000:06:0d.0 807 + 06:0d.0 0401: 1102:0002 (rev 08) 808 + # echo 0000:06:0d.0 > /sys/bus/pci/devices/0000:06:0d.0/driver/unbind 809 + # echo 1102 0002 > /sys/bus/pci/drivers/vfio-pci/new_id 810 + 811 + # qemu-system-x86_64 -drive file=nvme://@var{host}:@var{bus}:@var{slot}.@var{func}/@var{namespace} 812 + @end example 813 + 814 + Alternative syntax using properties: 815 + 816 + @example 817 + qemu-system-x86_64 -drive file.driver=nvme,file.device=@var{host}:@var{bus}:@var{slot}.@var{func},file.namespace=@var{namespace} 818 + @end example 819 + 820 + @var{host}:@var{bus}:@var{slot}.@var{func} is the NVMe controller's PCI device 821 + address on the host. 822 + 823 + @var{namespace} is the NVMe namespace number, starting from 1. 824 + 788 825 @node disk_image_locking 789 826 @subsection Disk image file locking 790 827
+1
qemu-doc.texi
··· 621 621 * disk_images_iscsi:: iSCSI LUNs 622 622 * disk_images_gluster:: GlusterFS disk images 623 623 * disk_images_ssh:: Secure Shell (ssh) disk images 624 + * disk_images_nvme:: NVMe userspace driver 624 625 * disk_image_locking:: Disk image file locking 625 626 @end menu 626 627