|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] how to callback from hypervisor to guest os?
Hi Jeremy,
Thanks for your answering.
If my understanding is correct, do you mean the hypervisor side should look like:
Xen:
_interrupt_handler()
...
...
event_send(guest_dom) while(event_receive(&result)) {
}
post: xxx()
...
}
Thanks a lot! Weiming
On Mon, Jul 7, 2008 at 6:32 PM, Jeremy Fitzhardinge < jeremy@xxxxxxxx> wrote:
weiming wrote:
Do you mean making a hypercall after guest domain finishes processing? If so, in xen, after event_send(), will xxx() be executed immediately (non-blocking)?
Xen: Guest:
_interrupt_handler() {
...
...
event_send(guest_dom) event_virq_handler()
post: xxx() {
do_process()
hypercall_xxx()?
}
...
}
You can get Xen to do a callback into the guest. You can either define this as an event callback (probably a virq like the timer or debug interrupts), or a specific callback like syscall, event delivery, failsafe exceptions etc. That schedules the guest vcpu running at a particular address in kernel context; it can do whatever processing you want, then do a hypercall to pass the results back into the hypervisor.
It's a close as you're going to get to a syncronous "call into guest" mechanism. On the hypervisor side you're going to have to deal with it as an async operation with split "call into guest" and "get results from guest" phases. You also have to deal with the guest calling the hypercall 0-N times - with no correlation to your callbacks, and with arbitrary arguments (ie, can't trust the guest's data).
J
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|