From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 03/13] xen/events: introduce test_and_set_mask Date: Tue, 24 Sep 2013 10:40:30 -0400 Message-ID: <20130924144030.GD4712@phenom.dumpdata.com> References: <1379091601-30358-1-git-send-email-david.vrabel@citrix.com> <1379091601-30358-4-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1379091601-30358-4-git-send-email-david.vrabel@citrix.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: David Vrabel Cc: Boris Ostrovsky , Wei Liu , Jan Beulich , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, Sep 13, 2013 at 05:59:51PM +0100, David Vrabel wrote: > From: Wei Liu > > Signed-off-by: Wei Liu > Signed-off-by: David Vrabel Reviewed-by: Konrad Rzeszutek Wilk > --- > drivers/xen/events.c | 11 ++++++++--- > 1 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/xen/events.c b/drivers/xen/events.c > index 1e2c74b..359e983 100644 > --- a/drivers/xen/events.c > +++ b/drivers/xen/events.c > @@ -352,6 +352,12 @@ static inline int test_evtchn(int port) > return sync_test_bit(port, BM(&s->evtchn_pending[0])); > } > > +static inline int test_and_set_mask(int port) > +{ > + struct shared_info *s = HYPERVISOR_shared_info; > + return sync_test_and_set_bit(port, BM(&s->evtchn_mask[0])); > +} > + > > /** > * notify_remote_via_irq - send event to remote end of event channel via irq > @@ -1493,7 +1499,6 @@ void rebind_evtchn_irq(int evtchn, int irq) > /* Rebind an evtchn so that it gets delivered to a specific cpu */ > static int rebind_irq_to_cpu(unsigned irq, unsigned tcpu) > { > - struct shared_info *s = HYPERVISOR_shared_info; > struct evtchn_bind_vcpu bind_vcpu; > int evtchn = evtchn_from_irq(irq); > int masked; > @@ -1516,7 +1521,7 @@ static int rebind_irq_to_cpu(unsigned irq, unsigned tcpu) > * Mask the event while changing the VCPU binding to prevent > * it being delivered on an unexpected VCPU. > */ > - masked = sync_test_and_set_bit(evtchn, BM(s->evtchn_mask)); > + masked = test_and_set_mask(evtchn); > > /* > * If this fails, it usually just indicates that we're dealing with a > @@ -1548,7 +1553,7 @@ static int retrigger_evtchn(int evtchn) > if (!VALID_EVTCHN(evtchn)) > return 0; > > - masked = sync_test_and_set_bit(evtchn, BM(s->evtchn_mask)); > + masked = test_and_set_mask(evtchn); > sync_set_bit(evtchn, BM(s->evtchn_pending)); > if (!masked) > unmask_evtchn(evtchn); > -- > 1.7.2.5 >