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

[Xen-devel] Send an event using event channels


  • To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Daniele Sgandurra <dansgan@xxxxxxxx>
  • Date: Thu, 10 May 2007 17:20:30 +0200 (CEST)
  • Delivery-date: Thu, 10 May 2007 08:18:55 -0700
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.it; h=Message-ID:X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type; b=RxjfVdVLgCmAknpPZ2SSwB64gY8WjK+IxkZmxymPT0iu8HlD0jEgysud7BwH98xmS2qelurhpUWyJD95xwv5Eu1n/DWIokfqc8LQgIQ18/IV5uc71/FPGzA1Igda3pJde7hRvWCetbqVNv3b7fGL141TA0uMy1UUhVqeocqAKKM= ;
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

I have a question regarding event channels. This is a
simplified version of the code I'm using to set up an
event channel between two domains (domU and dom0):

Code in domU (kernel space)
--------------------------------------------------

==alloc a page for shared memory:
        p=__get_free_page(GFP_KERNEL);
        machine_address = virt_to_machine(p);
        mfn = machine_address >> PAGE_SHIFT;

==alloc an event channel HYPERVISOR_event_channel_op

==pass the values to dom0 using xenbus_write (mfn and
channel_port)
--------------------------------------------------

Code in dom0 (user space, using libxenstore and
libxenctrl)
---------------------------------------------
==watch on xenbus, then read the values mfn and
channel_port:

    th = xs_transaction_start(xs)
    xs_read(xs, th, mfn , &len);
    xs_read(xs, th, chan , &len2);
    xs_transaction_end(xs, th, 1);

==bind an interdomain event channel with
HYPERVISOR_event_channel_op:
      evtchn_op_t op = {
      .cmd = EVTCHNOP_bind_interdomain,
      .u.bind_interdomain.remote_dom = otherdomain_id,
      .u.bind_interdomain.remote_port = chan_port,
      };
--------------------------------------------------

After the channel is established I don't understand
how to use it to send notification from domU to dom0.
I'd like also dom0 to acknowledge back domU using the
same channel.

How can dom0 be notified of an event sent from domU?
Looking through the code in drivers/xen/blkfront/ and
drivers/xen/blkback/, usually the driver associates a
virtual-irq and a callback function to the channel,
but I don't understand how to do it in user space
(using libxc), test the channel, reset it, and
acknowledge domU.

I hope I made myself clear :) Thank you very much!


      ___________________________________ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: 
http://it.docs.yahoo.com/nowyoucan.html

_______________________________________________
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®.