From: Wei Liu Subject: Re: [PATCH 07/13] xen: generalized event channel operations Date: Tue, 5 Feb 2013 17:23:21 +0000 Message-ID: <1360085001.7477.166.camel@zion.uk.xensource.com> References: <1359643627-29486-1-git-send-email-wei.liu2@citrix.com> <1359643627-29486-8-git-send-email-wei.liu2@citrix.com> <20130205170430.GF2187@konrad-lan.dumpdata.com> <1360084131.7477.156.camel@zion.uk.xensource.com> <20130205171938.GI2187@konrad-lan.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130205171938.GI2187@konrad-lan.dumpdata.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: Konrad Rzeszutek Wilk Cc: David Vrabel , wei.liu2@citrix.com, Ian Campbell , "jbeulich@suse.com" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Tue, 2013-02-05 at 17:19 +0000, Konrad Rzeszutek Wilk wrote: > On Tue, Feb 05, 2013 at 05:08:51PM +0000, Wei Liu wrote: > > On Tue, 2013-02-05 at 17:04 +0000, Konrad Rzeszutek Wilk wrote: > > > On Thu, Jan 31, 2013 at 02:47:01PM +0000, Wei Liu wrote: > > > > Use global pointers in common operations to allow for better code sharing > > > > between N-level event channel. > > > > > > > > Functions which are not suitable for sharing are also taken care of. > > > > > > > > Also update drivers/xen/evtchn.c to use exported variable instead of macro. > > > > > > > > Signed-off-by: Wei Liu > > > > --- > > > > drivers/xen/events.c | 180 ++++++++++++++++++++++++++++++++------------------ > > > > drivers/xen/evtchn.c | 12 ++-- > > > > include/xen/events.h | 2 + > > > > 3 files changed, 123 insertions(+), 71 deletions(-) > > > > > > > > diff --git a/drivers/xen/events.c b/drivers/xen/events.c > > > > index 0679d27..4820a52 100644 > > > > --- a/drivers/xen/events.c > > > > +++ b/drivers/xen/events.c > > > > @@ -51,6 +51,16 @@ > > > > #include > > > > #include > > > > > > > > +/* N-level event channel, starting from 2 */ > > > > +unsigned int evtchn_level = 2; > > > > > > What if the hypervisor does not support that? Shouldn't be by default > > > at 1? > > > > > > > the default implementation is 2 level. ;-) > > I am looking at evtchn_pending and evtchn_mask in the 'struct > shared_info' (include/xen/interface/xen.h) and it is not obvious from > that. What am I missing? > To avoid scanning the whole bitmap when doing upcall, every vcpu is equipped with a selector - embedded in struct vcpu_info. So it is a 2-level event lookup path. Wei