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?

To: "Jeremy Fitzhardinge" <jeremy@xxxxxxxx>
Subject: Re: [Xen-devel] how to callback from hypervisor to guest os?
From: weiming <zephyr.zhao@xxxxxxxxx>
Date: Mon, 7 Jul 2008 20:12:29 -0400
Cc: Xen Developers <xen-devel@xxxxxxxxxxxxxxxxxxx>, Daniel Stodden <stodden@xxxxxxxxxx>
Delivery-date: Mon, 07 Jul 2008 17:12:55 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=KTq5VSuidWDRH0WKLWT+eyhyTCV18ejVAVPuN4u3Xyw=; b=dXiw0oCdA97eiLAs0/3ZYJWrejFHbciz22XLjJSCEUdExR6cmUL2HtNsA60UhTg2fb InhnXJSkDiTzqk7+EXNHhpJnaLLzF4WJ1E7W8OwjL+QJqmrPZOkFHm/c4CF4Ibnu5FCE FLDuiscOzrbCuGtRK2FYBONkV5w1uzOIj4a8Y=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=mBw76TZdod1tAWIXIt9G13ZO0JqJvXRT5qYmWTpGBlf7a8vNQgu3L41gLroFq9j0CX PHgesumNH5Zj2xgylyWIbj7uOzOW3MTXsKA0onhfPHluVqAOURr1waY0SUrp1wcI3yES YELuqKX49W28TWCkYRMWgYh/t4r1obV6dA0WY=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <48729962.1090701@xxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <add59a3f0807052118o184a1d20q3f750b57ac96c8f7@xxxxxxxxxxxxxx> <1215335738.9407.39.camel@xxxxxxxxxxxxxxxxxxxx> <add59a3f0807060846w2cf4531v9fe036bb805818e1@xxxxxxxxxxxxxx> <1215379562.22922.21.camel@xxxxxxxxxxxxxxxxxxxx> <add59a3f0807071446h1de8fe70ic228774939c03667@xxxxxxxxxxxxxx> <4872915A.1080705@xxxxxxxx> <add59a3f0807071514l4095c7eft1bbe2a232ee9faa1@xxxxxxxxxxxxxx> <48729962.1090701@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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