From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH] evtchn: don't lose pending state if FIFO event array page is missing Date: Fri, 18 Oct 2013 15:47:20 +0100 Message-ID: <526149F8.706@citrix.com> References: <1382105218-30287-1-git-send-email-david.vrabel@citrix.com> <526164D202000078000FC1E9@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VXBKo-00054Z-Cd for xen-devel@lists.xenproject.org; Fri, 18 Oct 2013 14:47:26 +0000 In-Reply-To: <526164D202000078000FC1E9@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org On 18/10/13 15:41, Jan Beulich wrote: >>>> On 18.10.13 at 16:06, David Vrabel wrote: >> From: David Vrabel >> >> When the FIFO-based ABI is in use, if an event is bound when the >> corresponding event array page is missing any attempt to set the event >> pending will lose the event (because there is nowhere to write the >> pending state). >> >> This wasn't initially considered an issue because guests were expected >> to only bind events once they had expanded the event array, however: >> >> 1. A domain may start with events already bound (by the toolstack). > > But a domain wouldn't start in FIFO mode, would it? Yes, guests always start in 2-level mode, but if the guest doesn't unmask the events they should still be pending after switching to FIFO mode so must copy the pending bits from the 2-level array and set them pending in the into the FIFO event array (when the pages turn up). David >> 2. The guest does not know what the port number will be until the >> event is bound (it doesn't know how many already bound events there >> are), so it does not know how many event array pages are required. >> This makes it difficult to expand in advanced (the current Linux >> implementation expands after binding for example). >> >> To prevent pending events from being lost because there is no array >> page, temporarily store the pending state in evtchn->pending. When an >> array page is added, use this state to set the port as pending.