WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] how to callback from hypervisor to guest os?

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