[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <a3e63f3aff2762aa9ee0d6e0101584ca39abc9c7.1461323133.git.jslaby@suse.cz>
Date: Fri, 22 Apr 2016 13:05:29 +0200
From: Jiri Slaby <jslaby@...e.cz>
To: stable@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Wei Liu <wei.liu2@...rix.com>,
David Vrabel <david.vrabel@...rix.com>,
Jiri Slaby <jslaby@...e.cz>
Subject: [PATCH 3.12 46/78] xen/events: introduce test_and_set_mask()
From: Wei Liu <wei.liu2@...rix.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 3f70fa828249e3f37883be98f5b4d08e947f55b0 upstream.
In preparation for adding event channel port ops, add
test_and_set_mask().
Signed-off-by: Wei Liu <wei.liu2@...rix.com>
Signed-off-by: David Vrabel <david.vrabel@...rix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@...cle.com>
Signed-off-by: Jiri Slaby <jslaby@...e.cz>
---
drivers/xen/events.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 767fe735abd7..bd12a6660fe3 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -370,6 +370,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
@@ -1515,7 +1521,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;
@@ -1538,7 +1543,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
@@ -1570,7 +1575,7 @@ int resend_irq_on_evtchn(unsigned int irq)
if (!VALID_EVTCHN(evtchn))
return 1;
- 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);
--
2.8.1
Powered by blists - more mailing lists