From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brendan Cully Subject: Re: Event Channels Date: Fri, 12 Jan 2007 11:29:23 -0800 Message-ID: <20070112192923.GB4982@ventoux.cs.ubc.ca> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Julian Stecklina Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Friday, 12 January 2007 at 19:33, Julian Stecklina wrote: > Hello, > > in an application I develop, event channel semantics seem a bit odd to > me. Consider the following scenario: A Mini-OS binds an unbound port for > domain 0 and issues a notification every second: > > evtchn_alloc_unbound(0, msg_handler, NULL, > &port); > > printk("%u %u %u\n", domid, port); > > while (1) { > sleep(1000); > notify_remote_via_evtchn(port); > } > > A Linux program running on Domain 0 calls bind_interdomain using domid > and port to obtain local_port and watches for pending notifications: > > evtchn_port_t local_port = xc_evtchn_bind_interdomain(ev, domid, > port); > > while (1) { > evtchn_port_t port; > > port = xc_evtchn_pending(ev); > printf("%u\n", port); > xc_evtchn_unmask(ev, port); > } > > Now what I do not understand is, why the Linux program sees exactly one > notification and then indefinitely blocks. Any help on what I may be > doing wrong is greatly appreciated. This is with xen-3.0.4-testing. According to the interface guide http://www.cl.cam.ac.uk/research/srg/netos/xen/readmes/interface/interface.html#SECTION00600000000000000000 the event is masked until the receiver clears the notification. I think you do this by sending a notify back along the same port: while (1) { evtchn_port_t port; port = xc_evtchn_pending(ev); printf("%u\n", port); xc_evtchn_notify(ev, port); xc_evtchn_unmask(ev, port); }