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

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


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • 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
  • 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=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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

 


Rackspace

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