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


Re: [Xen-devel] Handle for events?

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] Handle for events?
From: "Srujan D. Kotikela" <ksrujandas@xxxxxxxxx>
Date: Tue, 26 Oct 2010 22:19:07 -0500
Delivery-date: Tue, 26 Oct 2010 20:19:56 -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=rgDFOTHr7P2Gq0hIjm32ZCeTKcRSadl6sfbeARlr+MI=; b=jap/vEiOJlsP/IEMNCMqBYBqqJG/2iq5LEOiADw1xYUadcD5EcjbhJiKRgPG4cWcGx OxMZLF1m9zabuyn9/C4xI8UjAIdaShf9W0w3no72I4aCGxwe7kTUE/17Na2sxhiqp0hi /g6pg1ZOsVyVhVKJCJh3Q9F+hQmMmoY/Afycc=
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=QHBl/JNuM+FUTYhZK8FdC1gTDjScFa1voEEyBB5R94BXabiJfzFk08jvpf+GnGLnZI z1EfMvcvRBrvvBCF2lmnR/DlyK7RZFhcSWV46w2xAtjBAc3eXVz4CvzhXvCJzeRvjWQh 8ZsQ2t0IX1dG+GudDpTpIuDTENCUU9GxyuFOw=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4CB4A18F.3040203@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: <AANLkTi=TafOCtvaBtfQbmRWyKA1y3_N+fjAT1XzWHZba@xxxxxxxxxxxxxx> <4CA36471.5040503@xxxxxxxx> <AANLkTimHQ=-4ppSs2LuQGmA5v-39EvB59CHM1uFKUW=6@xxxxxxxxxxxxxx> <4CA36965.4040208@xxxxxxxx> <AANLkTim2isZwXL=+xmHN5E66RZv+rtG+iSWGQb63XHyp@xxxxxxxxxxxxxx> <4CA3745A.10900@xxxxxxxx> <AANLkTimqZS_5+rjO5uv9ZBnTKM9feAnupe9KbhZkrug5@xxxxxxxxxxxxxx> <4CB4A18F.3040203@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi jeremy,

I have looked into the events.c

The function bind_evtchn_to_irqhandler((int evtchn, irq_handler_t handler, unsigned long irqflags, const char *devname, void *dev_id) looks the most appropriate for me. However, I wouldn't have any device name or Id. So I am not sure how I can use it to set up the handler.

I am looking to setup a very light weight communication mechanism from DomU to Dom0. The application in DomU will raise a hypercall. The hypercall handler will send an event to Dom0. This communication setup is just to notify an event to Dom0 excluding the DomU kernel. 

I am facing 2 roadblocks for this setup. 
 - How to install an event handler for the event channel (between Dom0 and hypervisor).
 - How can I send an event to Dom0. The only function I found was xc_evtchn_notify() But AFAIK this function or the                                                         event_channel_op send are to be done by from a domain (through port). So how can I trigger/send an event from hypervisor to Dom0.

Finally, does establishing an event channel (using xc_evtchn_open) guarantee an event channel between Dom0 and hypervisor? Or is there any specific function for the same.

Thanks and regards,
Srujan D. Kotikela

On Tue, Oct 12, 2010 at 12:57 PM, Jeremy Fitzhardinge <jeremy@xxxxxxxx> wrote:
 On 10/08/2010 09:10 AM, Srujan D. Kotikela wrote:
> From what I read in the Xen Definitive guide, There is a single
> handler for all events (hypervisor_callback) which in turn should call
> individual handlers, which are registered before hand, for each event.
> I have few questions regarding this:
> 1. Is there a default event handler for Dom0 kernel (like
> hypervisor_callback in mini-os). If so, what is the function to
> register event handlers for specific port/channel (I tried searching
> the code and couldn't find any)?

Yes, xen_do_hypervisor_callback in kernel/entry_64.S.  Events are mapped
to the Linux IRQ subsystem, so registering for an event channel requires
mapping it to an irq, then registering an irq as normal.  The code to
implement it is in drivers/xen/events.c.

> 2. If no default handler exists how are the handlers for xen_console
> and xen_store events or any other events setup?

The events are bound to irqs, and the irq handler deals with the
events.  You can see the registrations in /proc/interrupts.

> 3. Is the ./xen/arch/x86/x86_64/entry.S analogous to
> ./extras/mini-os/arch/x86/x86_64.S? I mean If I have to write event
> handler, should I edit entry.S?

That looks like a path into the source for Xen (the hypervisor) itself.
Xen doesn't need an event upcall entrypoint because it is initiating all
the upcalls.


> --
> Srujan D. Kotikela
> On Wed, Sep 29, 2010 at 12:16 PM, Jeremy Fitzhardinge <jeremy@xxxxxxxx
> <mailto:jeremy@xxxxxxxx>> wrote:
>      On 09/29/2010 09:34 AM, Srujan D. Kotikela wrote:
>     > Sorry,
>     >
>     > But from what I read I may not get notifications on
>     /dev/xen/evtchn if
>     > my xen-evtchn module is not functioning. However if it is statically
>     > compiled it wont be found as a module. I can confirm it's working by
>     > checking if there are directories in my /proc/xen
>     >
>     > correct me if I am wrong.
>     /proc/xen is irrelevant to xen-evtchn; you would not expect to see any
>     changes in /proc/xen as a result of xen-evtchn being present or
>     absent.
>     >
>     > I am calling notify() and I am getting a return value 0 but no
>     > notification mesages in /dev/xen/evtchn
>     You should look carefully at the existing examples of how to use that
>     device to see where you're going wrong.
>        J

Xen-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>