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/
Home Products Support Community News


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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Handling inter-domain interrupts in Dom0
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
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=nAWwRoL/HAuTrZzMbLREL8oO1lMYRVz32TLUdjLHTzw=; b=iBGqRl+I/1dIYo1t8G75QDeaVI7AHp5sL1xihdrTZHWWHLZ1IxAdFjlyNofHMMglBs oQWUXd5QIOf6Ln1pISiIe1k1Z26O+zFmOkmo/WX0/o8shIVYOvCvKMtNm3g+zZLaY7PM 0BuSwX3GoqEUOFjI8dDogpaDmDcJBVsUIEZzk=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

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;


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));
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.

Srujan D. Kotikela
Xen-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>