FWIW, I'm also rehashing the interface between the
user program and the kernel/monitor. Having a number
of different message types to be passed, makes it
easy to send requests/responses/commands between
the 2 spaces.
Rather than just have one RUNGUEST ioctl command,
I changed that to a MESSAGEQ command, and RunGuest
is now one particular type of message you can
send. The user prog can send more than one message
to the kernel via ioctl at a time. For efficiency,
this means you can easily piggy back, say a response
to an IO Request from the kernel, on a RunGuest
message. Thus only one system call.
For kicks, following are the messages defined thus far.
I'm not at a good place to release some code, but just
to keep you informed...
-Kevin
// ==========================================================
// Messages which are passed between the user program (u) and
// the monitor (m) of the VM.
// ==========================================================
#define VMMessageIntRequest 1 // u->m
#define VMMessageIACRequest 2 // m->u
#define VMMessageIACResponse 3 // u->m
#define VMMessageIORequest 4 // m->u
#define VMMessageIOResponse 5 // u->m
#define VMMessageUCMemRequest 6 // m->u
#define VMMessageUCMemResponse 7 // u->m
#define VMMessagePanic 8 // m->u
#define VMMessagePanicWithDump 9 // m->u
#define VMMessageRunGuest 10 // u->m
#define VMMessageSetContext 11 // u->m