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

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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: Handling inter-domain interrupts in Dom0
From: "Srujan D. Kotikela" <ksrujandas@xxxxxxxxx>
Date: Tue, 19 Oct 2010 12:22:24 -0500
Delivery-date: Tue, 19 Oct 2010 10:23:29 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=9OKyxqK+MMgC46uXFUsM9Q9RwfjqlvJRR6GyW+KRqSQ=; b=x3iRkNd5bExcuk0oC8LutZauUhbiPgDnW6sw+JpKKP7dSII2uXkUGb/XNeKGKbTjcg 4F2/UWqB3BdjimLoCQAJAK1wAiIlW7WkA3eqCkUhVwSo5K9e3pVB70rJKMqIuy9U6SjB XzMrbR0ujXc/dKCdK06+jASQUdj4FKdZ9O4c0=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=S3KoIqjB1iS4pJlRdPE3jPFEpZKuIpk3T8gg40Vc4VlSlyurqTQt0SZQX3G/WINR1P cUT2CVSV2L0u+43d312oSF0OkCdeT4Y20LUisBAcknt6aazMZKQtVzGWSMQ+r+aZyPr0 ZTx3oe5rl/1c8h7YKRhOt5N5VqAfHZCrhiyy8=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTinuYX2DGrAiW_wqKWiYvtd3_mN6dZE3=61j2Sg7@xxxxxxxxxxxxxx>
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: <AANLkTinuYX2DGrAiW_wqKWiYvtd3_mN6dZE3=61j2Sg7@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
To put all that in simple words:

How does hypervisor forward interrupts to domains?
Can I configure handler in hypervisor such that an interrupt from DomU can be forwarded to handler in Dom0 ?

--
Srujan D. Kotikela


On Tue, Oct 19, 2010 at 11:29 AM, Srujan D. Kotikela <ksrujandas@xxxxxxxxx> wrote:
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
<Prev in Thread] Current Thread [Next in Thread>