[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Handling inter-domain interrupts in Dom0


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: "Srujan D. Kotikela" <ksrujandas@xxxxxxxxx>
  • Date: Tue, 19 Oct 2010 11:29:29 -0500
  • Delivery-date: Tue, 19 Oct 2010 09:30:30 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=hMj7zW+MtnD9SwOrnkYdf3+Qdp6TrofTgMShzpGWkt8LQwJRSoYQy6AqERWxMPmHN4 r9JFiFVB11pozj6uStO9uDnEli06Tvoj7zkNSyabFUAJzPiOmeEIA4zabPc3rBfbDAcY NdaA3OpX8eDm65hSwYanKhyqCY0fprEXe0h8c=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Hi,

If I understand correctly, events are used for asynchronous communication in Xen where these events can be mapped to incoming VIRQs, PIRQs or just mean inter-domain events. 
However to handle these events we should map the events to IRQs and handle the IRQ. (correct me if I am wrong)

I have few questions here. 

i am trying to simply notify Dom0 that something has occurred in DomU from application level. Ideally I would prefer a OS/Platform independent mechanism for this.
I tried to bind an event channel to an VIRQ (See the code below):

int main(void){

int xce_handle, src_port, dst_port, xc_handle;
int dom, remote_dom, ret, vchn;

dom=0;
remote_dom=2;

xc_handle=xc_interface_open(); //open the hypervisor interface
printf("\n Accquired HYPERVISOR INTERFACE HANDLE: %d \n", xc_handle);

dst_port = xc_evtchn_alloc_unbound(xc_handle, remote_dom, dom); //allocate a port on the remote domain
printf("\n Allocated the DEST port %d \n", dst_port);

xce_handle = xc_evtchn_open(); //create a handle for event channel
printf("\n Accquired HYPERVISOR INTERFACE EVTCHN HANDLE: %d\n", xce_handle);

src_port = xc_evtchn_bind_interdomain(xce_handle, remote_dom, dst_port);
printf("\n Allocated the SRC port %d \n", src_port);

ret = xc_evtchn_bind_virq(xce_handle, VIRQ_MYVIRQ); //MYVIRQ declared in xen.h
printf("\n EventChannel Bound to VIRQ %d \n", ret);

printf("\n NOTIFIED: %d\n", xc_evtchn_notify(xce_handle, ret));
xc_interface_close(xc_handle);
xc_evtchn_close(xce_handle);
return 0;
}


1. If I have to notify Dom0 about an event (anything I consider as an event). How should I do it? From the libraries/api available I can only see xc_evtchn_notify() for this purpose.
    But I don't want to assume the guest is having xen or xen libraries available.

2. When we say an event has been delivered (in the above setup) does it means that MYVIRQ occurs in Dom0 as soon as I call notify() in DomU (subject to pending and masking of evtchn and vcpu0)

3. I am thinking of a more minimal communication mechanism like an interrupt occurs in DomU which will be trapped by hypervisor and  forwarded to handler in Dom0. Is such a design feasible and beneficial?

My task requires an event notification. Event here is very specific to my application. Which should be followed by memory introspection using xenaccess from Dom0.

--
Regards,
Srujan D. Kotikela
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.