From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: how to callback from hypervisor to guest os? Date: Mon, 07 Jul 2008 15:32:02 -0700 Message-ID: <48729962.1090701@goop.org> References: <1215335738.9407.39.camel@thinkpad.localdomain> <1215379562.22922.21.camel@thinkpad.localdomain> <4872915A.1080705@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: weiming Cc: Xen Developers , Daniel Stodden List-Id: xen-devel@lists.xenproject.org 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