1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
.\" $OpenBSD: pvbus.4,v 1.12 2016/12/07 17:11:09 jmc Exp $
.\"
.\" Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
.\" Copyright (c) 2006 Jason McIntyre <jmc@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: December 7 2016 $
.Dt PVBUS 4
.Os
.Sh NAME
.Nm pvbus
.Nd paravirtual device tree root
.Sh SYNOPSIS
.Cd "pvbus0 at mainbus0"
.Pp
.In sys/types.h
.In sys/ioctl.h
.In dev/pv/pvvar.h
.Sh DESCRIPTION
.Nm
is used on virtual machines that are running on hypervisors.
It provides a pseudo-bus for all paravirtual devices that do not
attach to a well-known bus like
.Xr pci 4 .
The
.Nm
driver is responsible for detecting the hypervisor interface,
checking the capabilities, attaching the paravirtual devices,
and providing access to supported information stores.
.Ss Supported hypervisors
.Bl -tag -width 13n -offset ind -compact
.It KVM
Kernel-based Virtual Machine
.It Hyper-V
Microsoft Hyper-V
.It OpenBSD
.Ox
.Xr vmm 4
.It VMware
VMware vSphere Hypervisor and ESXi
.It Xen
Xen VMM
.El
.Pp
Note that a hypervisor can attempt to emulate other hypervisors, so
multiple hypervisor interfaces may be available on the same host.
.Ss VMware paravirtual devices
.Bl -tag -width 13n -offset ind -compact
.It Xr vmt 4
VMware Tools driver and
.Dq guestinfo
information store
.El
.Ss Hyper-V paravirtual devices
.Bl -tag -width 13n -offset ind -compact
.It Xr hvn 4
Hyper-V virtual networking interface
.It Xr hyperv 4
Hyper-V guest nexus device
.El
.Ss Xen paravirtual devices
.Bl -tag -width 13n -offset ind -compact
.It Xr xbf 4
Xen Blkfront virtual disk
.It Xr xen 4
Xen domU nexus device and XenStore information store
.It Xr xnf 4
Xen Netfront virtual networking interface
.El
.Sh IOCTL INTERFACE
.Nm
supports
.Xr ioctl 2
commands to exchange information with the hypervisor interface,
as implemented in the
.Xr hostctl 8
program.
Each detected hypervisor interface is available as a character special
device file,
.Pa /dev/pvbus0 ,
.Pa /dev/pvbus1 ,
etc.
All available commands use the same
.Fa pvbus_req
structure:
.Bd -literal
struct pvbus_req {
size_t pvr_keylen;
char *pvr_key;
size_t pvr_valuelen;
char *pvr_value;
};
.Ed
.Pp
The caller is responsible for attaching character buffers to the
.Fa pvr_key
and
.Fa pvr_value
fields and to set their length in
.Fa pvr_keylen
and
.Fa pvr_valuelen
accordingly.
All keys and values are nul-terminated strings.
.Pp
The following
.Xr ioctl 2
commands are available:
.Bl -tag -width PVBUSIOC_KVWRITE
.It Dv PVBUSIOC_KVREAD
Read the value from
.Fa pvr_key
and return it in
.Fa pvr_value .
.It Dv PVBUSIOC_KVTYPE
Return the type of the attached hypervisor interface as a string in
.Fa pvr_key ;
see
.Sx Supported hypervisors .
.It Dv PVBUSIOC_KVWRITE
Write the new value
.Fa pvr_value
to the key
.Fa pvr_key .
This command requires write permissions on the device file.
.El
.Sh FILES
.Bl -tag -width "/dev/pvbusX" -compact
.It /dev/pvbus Ns Ar u
.Nm
device unit
.Ar u
file.
.El
.Sh SEE ALSO
.Xr autoconf 4 ,
.Xr intro 4 ,
.Xr mainbus 4 ,
.Xr vmm 4 ,
.Xr hostctl 8
.Sh HISTORY
The
.Nm
pseudo-bus first appeared in
.Ox 5.8 .
.Sh AUTHORS
The
.Nm
pseudo-bus was written by
.An Reyk Floeter Aq Mt reyk@openbsd.org .
|