vmx(3): document changes to devvmx interface

This commit is contained in:
cinap_lenrek 2017-09-10 03:12:00 +02:00
parent e6e745e776
commit b9b4797d56

View file

@ -3,12 +3,14 @@
vmx \- x86 virtualization interface vmx \- x86 virtualization interface
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #X/ctl .B #X/clone
.B #X/fpregs .B #X/n
.B #X/map .B #X/n/ctl
.B #X/regs .B #X/n/fpregs
.B #X/status .B #X/n/map
.B #X/wait .B #X/n/regs
.B #X/n/status
.B #X/n/wait
.fi .fi
.SH DESCRIPTION .SH DESCRIPTION
The The
@ -21,17 +23,25 @@ Access to the
.I vmx .I vmx
device is restricted to the hostowner. device is restricted to the hostowner.
.PP .PP
The top level directory contains a
.B clone
file and numbered subdirectories representing the
allocated virtual CPUs.
Opening the clone file allocates a new virtual CPU
and returns the file descriptor to its
.B ctl
file.
The The
.B ctl .B ctl
file provides the main control interface. file provides the main control interface. See below for
See below for a list of commands. a list of commands. Reading returns the subdirectory number.
Removing the
.B ctl
file marks the virtual CPU as moribund.
The The
.B status .B status
file contains the current status of the virtual CPU, which is one of file contains the current status of the virtual CPU, which is one of
.TF \fLinactive\fR .TF \fLrunning\fR
.TP
\fLinactive\fR
No virtual CPU.
.TP .TP
\fLinit\fR \fLinit\fR
The virtual CPU is being initialized. The virtual CPU is being initialized.
@ -128,10 +138,7 @@ file contains the virtual CPU's floating point registers, in the same binary for
.IR proc (3). .IR proc (3).
.SS Control messages .SS Control messages
.TF "\fLirq\fR [ \fIexcep\fR ]" .TF "\fLextrap\fR [ \fIexcep\fR ]"
.TP
.B init
Create a new virtual CPU.
.TP .TP
.B quit .B quit
Destroy the current virtual CPU. Destroy the current virtual CPU.
@ -143,11 +150,9 @@ Launch the virtual CPU.
.B stop .B stop
Stop the virtual CPU. Stop the virtual CPU.
.TP .TP
\fLstep\fR [ \fL-map\fR \fIaddr segment offset\fR ]\fR \fLstep\fR [ \fIregs\fR ]
Executes a single instruction with the virtual CPU. Executes a single instruction with the virtual CPU.
If the \fL-map\fR option is specified, a 4 KB page at address \fIaddr\fR will be temporarily (for the duration of the step) mapped to the spceified \fIsegment\fR and \fIoffset\fR. \fIRegs\fR is optinal, same as \fLgo\fR.
A step can fail, in which case a VM exit message is sent to
.BR wait .
.TP .TP
\fLexc\fR \fIexcep\fR \fLexc\fR \fIexcep\fR
The exception \fIexcep\fR is triggered in the virtual CPU. The exception \fIexcep\fR is triggered in the virtual CPU.
@ -162,6 +167,9 @@ message is sent to
.IExcep\fR uses the same format as the argument of \fBexc\fR. .IExcep\fR uses the same format as the argument of \fBexc\fR.
.B Irq .B Irq
cancels any interrupts that have been previously posted but not yet delivered and it can be called with no argument to cancel an interrupt. cancels any interrupts that have been previously posted but not yet delivered and it can be called with no argument to cancel an interrupt.
.TP
\fLextrap\fR \fIbitmap\fR
Changes the exception bitmap. Set bits cause a VM exits.
.SH SOURCE .SH SOURCE
.B /sys/src/9/pc/devvmx.c .B /sys/src/9/pc/devvmx.c
.SH "SEE ALSO" .SH "SEE ALSO"
@ -170,10 +178,6 @@ cancels any interrupts that have been previously posted but not yet delivered an
Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3B, Chapters 23-33. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3B, Chapters 23-33.
.SH BUGS .SH BUGS
Currently only one virtual CPU is supported and it is tied to the bootstrap processor.
.PP
The interface will almost certainly change in the future.
.PP
.I Devvmx .I Devvmx
can and will crash your kernel. can and will crash your kernel.
.SH HISTORY .SH HISTORY