xref: /freebsd/share/man/man4/virtio.4 (revision 02f2706606e1a4364d10a313dade29a9d4cfffe1)
110b59a9bSPeter Grehan.\" Copyright (c) 2011 Bryan Venteicher
210b59a9bSPeter Grehan.\" All rights reserved.
310b59a9bSPeter Grehan.\"
410b59a9bSPeter Grehan.\" Redistribution and use in source and binary forms, with or without
510b59a9bSPeter Grehan.\" modification, are permitted provided that the following conditions
610b59a9bSPeter Grehan.\" are met:
710b59a9bSPeter Grehan.\" 1. Redistributions of source code must retain the above copyright
810b59a9bSPeter Grehan.\"    notice, this list of conditions and the following disclaimer.
910b59a9bSPeter Grehan.\" 2. Redistributions in binary form must reproduce the above copyright
1010b59a9bSPeter Grehan.\"    notice, this list of conditions and the following disclaimer in the
1110b59a9bSPeter Grehan.\"    documentation and/or other materials provided with the distribution.
1210b59a9bSPeter Grehan.\"
1310b59a9bSPeter Grehan.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1410b59a9bSPeter Grehan.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1510b59a9bSPeter Grehan.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1610b59a9bSPeter Grehan.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1710b59a9bSPeter Grehan.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1810b59a9bSPeter Grehan.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1910b59a9bSPeter Grehan.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2010b59a9bSPeter Grehan.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2110b59a9bSPeter Grehan.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2210b59a9bSPeter Grehan.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2310b59a9bSPeter Grehan.\" SUCH DAMAGE.
2410b59a9bSPeter Grehan.\"
25b1adb000SConrad Meyer.Dd May 26, 2019
2610b59a9bSPeter Grehan.Dt VIRTIO 4
2710b59a9bSPeter Grehan.Os
2810b59a9bSPeter Grehan.Sh NAME
2910b59a9bSPeter Grehan.Nm virtio
3010b59a9bSPeter Grehan.Nd VirtIO Device Support
3110b59a9bSPeter Grehan.Sh SYNOPSIS
3210b59a9bSPeter GrehanTo compile VirtIO device support into the kernel, place the following lines
3310b59a9bSPeter Grehanin your kernel configuration file:
3410b59a9bSPeter Grehan.Bd -ragged -offset indent
3510b59a9bSPeter Grehan.Cd "device virtio"
3610b59a9bSPeter Grehan.Cd "device virtio_pci"
3710b59a9bSPeter Grehan.Ed
3810b59a9bSPeter Grehan.Pp
3910b59a9bSPeter GrehanAlternatively, to load VirtIO support as modules at boot time, place the
4010b59a9bSPeter Grehanfollowing lines in
4110b59a9bSPeter Grehan.Xr loader.conf 5 :
4210b59a9bSPeter Grehan.Bd -literal -offset indent
4310b59a9bSPeter Grehanvirtio_load="YES"
4410b59a9bSPeter Grehanvirtio_pci_load="YES"
4510b59a9bSPeter Grehan.Ed
4610b59a9bSPeter Grehan.Sh DESCRIPTION
4710b59a9bSPeter GrehanVirtIO is a specification for para-virtualized I/O in a virtual machine (VM).
4810b59a9bSPeter GrehanTraditionally, the hypervisor emulated real devices such as an Ethernet
4928083eaaSChristian Bruefferinterface or disk controller to provide the VM with I/O.
5028083eaaSChristian BruefferThis emulation is often inefficient.
5110b59a9bSPeter Grehan.Pp
5210b59a9bSPeter GrehanVirtIO defines an interface for efficient I/O between the hypervisor and VM.
5310b59a9bSPeter GrehanThe
54abd6790cSBryan Venteicher.Nm
5510b59a9bSPeter Grehanmodule provides a shared memory transport called a virtqueue.
5610b59a9bSPeter GrehanThe
57abd6790cSBryan Venteicher.Xr virtio_pci
5810b59a9bSPeter Grehandevice driver represents an emulated PCI device that the hypervisor makes
5928083eaaSChristian Bruefferavailable to the VM.
6028083eaaSChristian BruefferThis device provides the probing, configuration, and
6128083eaaSChristian Bruefferinterrupt notifications needed to interact with the hypervisor.
6210b59a9bSPeter Grehan.Fx
6310b59a9bSPeter Grehansupports the following VirtIO devices:
6410b59a9bSPeter Grehan.Bl -hang -offset indent -width xxxxxxxx
65b1adb000SConrad Meyer.It Sy Ethernet
6610b59a9bSPeter GrehanAn emulated Ethernet device is provided by the
6728083eaaSChristian Brueffer.Xr vtnet 4
6810b59a9bSPeter Grehandevice driver.
69b1adb000SConrad Meyer.It Sy Block
7010b59a9bSPeter GrehanAn emulated disk controller is provided by the
7110b59a9bSPeter Grehan.Xr virtio_blk 4
7210b59a9bSPeter Grehandevice driver.
73b1adb000SConrad Meyer.It Sy Console
74b1adb000SConrad MeyerProvided by the
75b1adb000SConrad Meyer.Xr virtio_console 4
76b1adb000SConrad Meyerdriver.
77b1adb000SConrad Meyer.It Sy Entropy
78b1adb000SConrad MeyerProvided by the
79b1adb000SConrad Meyer.Xr virtio_random 4
80b1adb000SConrad Meyerdriver.
81b1adb000SConrad Meyer.It Sy Balloon
8210b59a9bSPeter GrehanA pseudo-device to allow the VM to release memory back to the hypervisor is
8310b59a9bSPeter Grehanprovided by the
8410b59a9bSPeter Grehan.Xr virtio_balloon 4
8510b59a9bSPeter Grehandevice driver.
86*02f27066SAndrew Turner.It Sy GPU
87*02f27066SAndrew TurnerGraphics support is provided by the
88*02f27066SAndrew Turner.Xr virtio_gpu 4
89*02f27066SAndrew Turnerdevice driver.
90b1adb000SConrad Meyer.It Sy SCSI
91b1adb000SConrad MeyerAn emulated SCSI HBA is provided by the
92b1adb000SConrad Meyer.Xr virtio_scsi 4
93b1adb000SConrad Meyerdevice driver.
9410b59a9bSPeter Grehan.El
9510b59a9bSPeter Grehan.Sh SEE ALSO
9628083eaaSChristian Brueffer.Xr virtio_balloon 4 ,
9710b59a9bSPeter Grehan.Xr virtio_blk 4 ,
986f744ddeSBryan Venteicher.Xr virtio_console 4 ,
99*02f27066SAndrew Turner.Xr virtio_gpu 4 ,
100b1adb000SConrad Meyer.Xr virtio_random 4 ,
1012f001371SPeter Grehan.Xr virtio_scsi 4 ,
10228083eaaSChristian Brueffer.Xr vtnet 4
10310b59a9bSPeter Grehan.Sh HISTORY
10410b59a9bSPeter GrehanSupport for VirtIO first appeared in
10510b59a9bSPeter Grehan.Fx 9.0 .
10610b59a9bSPeter Grehan.Sh AUTHORS
10710b59a9bSPeter Grehan.An -nosplit
10810b59a9bSPeter Grehan.Fx
10910b59a9bSPeter Grehansupport for VirtIO was first added by
1106c899950SBaptiste Daroussin.An Bryan Venteicher Aq Mt bryanv@FreeBSD.org .
111