xref: /openbsd-src/share/man/man4/pvbus.4 (revision 98dbb30ef2877b22f63981e6c70549f5664dbeb5)
1*98dbb30eSasou.\"	$OpenBSD: pvbus.4,v 1.15 2023/01/07 06:40:21 asou Exp $
21ae25d81Sreyk.\"
31ae25d81Sreyk.\" Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
41ae25d81Sreyk.\" Copyright (c) 2006 Jason McIntyre <jmc@openbsd.org>
51ae25d81Sreyk.\"
61ae25d81Sreyk.\" Permission to use, copy, modify, and distribute this software for any
71ae25d81Sreyk.\" purpose with or without fee is hereby granted, provided that the above
81ae25d81Sreyk.\" copyright notice and this permission notice appear in all copies.
91ae25d81Sreyk.\"
101ae25d81Sreyk.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
111ae25d81Sreyk.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
121ae25d81Sreyk.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
131ae25d81Sreyk.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
141ae25d81Sreyk.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
151ae25d81Sreyk.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
161ae25d81Sreyk.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
171ae25d81Sreyk.\"
18*98dbb30eSasou.Dd $Mdocdate: January 7 2023 $
191ae25d81Sreyk.Dt PVBUS 4
201ae25d81Sreyk.Os
211ae25d81Sreyk.Sh NAME
221ae25d81Sreyk.Nm pvbus
231ae25d81Sreyk.Nd paravirtual device tree root
241ae25d81Sreyk.Sh SYNOPSIS
251ae25d81Sreyk.Cd "pvbus0 at mainbus0"
26e36f7773Sreyk.Pp
27e36f7773Sreyk.In sys/types.h
28e36f7773Sreyk.In sys/ioctl.h
29e36f7773Sreyk.In dev/pv/pvvar.h
301ae25d81Sreyk.Sh DESCRIPTION
311ae25d81Sreyk.Nm
321ae25d81Sreykis used on virtual machines that are running on hypervisors.
331ae25d81SreykIt provides a pseudo-bus for all paravirtual devices that do not
341ae25d81Sreykattach to a well-known bus like
351ae25d81Sreyk.Xr pci 4 .
361ae25d81SreykThe
371ae25d81Sreyk.Nm
381ae25d81Sreykdriver is responsible for detecting the hypervisor interface,
39e36f7773Sreykchecking the capabilities, attaching the paravirtual devices,
40e36f7773Sreykand providing access to supported information stores.
411ae25d81Sreyk.Ss Supported hypervisors
421ae25d81Sreyk.Bl -tag -width 13n -offset ind -compact
43dc036062Sschwarze.It KVM
441ae25d81SreykKernel-based Virtual Machine
45dc036062Sschwarze.It Hyper-V
461ae25d81SreykMicrosoft Hyper-V
472647838eSreyk.It OpenBSD
4815da3b7aSreyk.Ox
492647838eSreyk.Xr vmm 4
50dc036062Sschwarze.It VMware
511ae25d81SreykVMware vSphere Hypervisor and ESXi
52dc036062Sschwarze.It Xen
531ae25d81SreykXen VMM
541ae25d81Sreyk.El
551ae25d81Sreyk.Pp
561ae25d81SreykNote that a hypervisor can attempt to emulate other hypervisors, so
571ae25d81Sreykmultiple hypervisor interfaces may be available on the same host.
581ae25d81Sreyk.Ss VMware paravirtual devices
591ae25d81Sreyk.Bl -tag -width 13n -offset ind -compact
601ae25d81Sreyk.It Xr vmt 4
61e36f7773SreykVMware Tools driver and
62e36f7773Sreyk.Dq guestinfo
63e36f7773Sreykinformation store
64b03ffcd3Smikeb.El
650236b278Smikeb.Ss Hyper-V paravirtual devices
660236b278Smikeb.Bl -tag -width 13n -offset ind -compact
670236b278Smikeb.It Xr hvn 4
680236b278SmikebHyper-V virtual networking interface
6954e8dec6Smikeb.It Xr hvs 4
706b0dedc2SjmcHyper-V virtual disk
714686a139Sjmc.It Xr hyperv 4
724686a139SjmcHyper-V guest nexus device
730236b278Smikeb.El
74b03ffcd3Smikeb.Ss Xen paravirtual devices
75b03ffcd3Smikeb.Bl -tag -width 13n -offset ind -compact
7698536906Sjmc.It Xr xbf 4
7798536906SjmcXen Blkfront virtual disk
782647838eSreyk.It Xr xen 4
79e36f7773SreykXen domU nexus device and XenStore information store
80b03ffcd3Smikeb.It Xr xnf 4
81b03ffcd3SmikebXen Netfront virtual networking interface
821ae25d81Sreyk.El
83e36f7773Sreyk.Sh IOCTL INTERFACE
84e36f7773Sreyk.Nm
85e36f7773Sreyksupports
86e36f7773Sreyk.Xr ioctl 2
87e36f7773Sreykcommands to exchange information with the hypervisor interface,
88e36f7773Sreykas implemented in the
89e36f7773Sreyk.Xr hostctl 8
90e36f7773Sreykprogram.
91e36f7773SreykEach detected hypervisor interface is available as a character special
92e36f7773Sreykdevice file,
93e36f7773Sreyk.Pa /dev/pvbus0 ,
94e36f7773Sreyk.Pa /dev/pvbus1 ,
95e36f7773Sreyketc.
96e36f7773SreykAll available commands use the same
97e36f7773Sreyk.Fa pvbus_req
98e36f7773Sreykstructure:
99e36f7773Sreyk.Bd -literal
100e36f7773Sreykstruct pvbus_req {
101e36f7773Sreyk	size_t			 pvr_keylen;
102e36f7773Sreyk	char			*pvr_key;
103e36f7773Sreyk	size_t			 pvr_valuelen;
104e36f7773Sreyk	char			*pvr_value;
105e36f7773Sreyk};
106e36f7773Sreyk.Ed
107e36f7773Sreyk.Pp
108e36f7773SreykThe caller is responsible for attaching character buffers to the
109e36f7773Sreyk.Fa pvr_key
110e36f7773Sreykand
111e36f7773Sreyk.Fa pvr_value
112e36f7773Sreykfields and to set their length in
113e36f7773Sreyk.Fa pvr_keylen
114e36f7773Sreykand
115e36f7773Sreyk.Fa pvr_valuelen
116e36f7773Sreykaccordingly.
117e36f7773SreykAll keys and values are nul-terminated strings.
118e36f7773Sreyk.Pp
119e36f7773SreykThe following
120e36f7773Sreyk.Xr ioctl 2
121e36f7773Sreykcommands are available:
122e36f7773Sreyk.Bl -tag -width PVBUSIOC_KVWRITE
123e36f7773Sreyk.It Dv PVBUSIOC_KVREAD
124e36f7773SreykRead the value from
125e36f7773Sreyk.Fa pvr_key
126e36f7773Sreykand return it in
127e36f7773Sreyk.Fa pvr_value .
128*98dbb30eSasouIf
129*98dbb30eSasou.Fa pvr_valuelen
130*98dbb30eSasouis not enough for the value,
131*98dbb30eSasouthe command will fail and
132*98dbb30eSasou.Xr errno 2
133*98dbb30eSasouis set to
134*98dbb30eSasou.Er ERANGE .
135e36f7773Sreyk.It Dv PVBUSIOC_KVTYPE
136e36f7773SreykReturn the type of the attached hypervisor interface as a string in
137e36f7773Sreyk.Fa pvr_key ;
138e36f7773Sreyksee
1395442aaa2Smikeb.Sx Supported hypervisors .
140e36f7773Sreyk.It Dv PVBUSIOC_KVWRITE
141e36f7773SreykWrite the new value
142e36f7773Sreyk.Fa pvr_value
143e36f7773Sreykto the key
144e36f7773Sreyk.Fa pvr_key .
145e36f7773SreykThis command requires write permissions on the device file.
146e36f7773Sreyk.El
147e36f7773Sreyk.Sh FILES
148e36f7773Sreyk.Bl -tag -width "/dev/pvbusX" -compact
149e36f7773Sreyk.It /dev/pvbus Ns Ar u
150444faeeeSjmc.Nm
151e36f7773Sreykdevice unit
152e36f7773Sreyk.Ar u
153e36f7773Sreykfile.
154e36f7773Sreyk.El
1551ae25d81Sreyk.Sh SEE ALSO
1561ae25d81Sreyk.Xr autoconf 4 ,
1571ae25d81Sreyk.Xr intro 4 ,
15815da3b7aSreyk.Xr mainbus 4 ,
159e36f7773Sreyk.Xr vmm 4 ,
160e36f7773Sreyk.Xr hostctl 8
1611ae25d81Sreyk.Sh HISTORY
1621ae25d81SreykThe
1631ae25d81Sreyk.Nm
1641ae25d81Sreykpseudo-bus first appeared in
1651ae25d81Sreyk.Ox 5.8 .
1661ae25d81Sreyk.Sh AUTHORS
1671ae25d81SreykThe
1681ae25d81Sreyk.Nm
1691ae25d81Sreykpseudo-bus was written by
1701ae25d81Sreyk.An Reyk Floeter Aq Mt reyk@openbsd.org .
171