From: David Vrabel Subject: [PATCHv1 5/6] evtchn: remove the locking when unmasking an event channel Date: Tue, 9 Jun 2015 15:59:58 +0100 Message-ID: <1433861999-15771-6-git-send-email-david.vrabel@citrix.com> References: <1433861999-15771-1-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z2L1S-0005X7-Lm for xen-devel@lists.xenproject.org; Tue, 09 Jun 2015 15:01:02 +0000 In-Reply-To: <1433861999-15771-1-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: xen-devel@lists.xenproject.org Cc: Keir Fraser , Tim Deegan , David Vrabel , Jan Beulich , Ian Campbell List-Id: xen-devel@lists.xenproject.org The event channel lock is no longer required to check if the port is valid. Signed-off-by: David Vrabel --- xen/common/event_channel.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c index 71747d1..7ab0516 100644 --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -979,9 +979,7 @@ int evtchn_unmask(unsigned int port) struct domain *d = current->domain; struct evtchn *evtchn; - ASSERT(spin_is_locked(&d->event_lock)); - - if ( unlikely(!port_is_valid(d, port)) ) + if ( port >= atomic_read(&d->valid_evtchns) ) return -EINVAL; evtchn = evtchn_from_port(d, port); @@ -1147,9 +1145,7 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) struct evtchn_unmask unmask; if ( copy_from_guest(&unmask, arg, 1) != 0 ) return -EFAULT; - spin_lock(¤t->domain->event_lock); rc = evtchn_unmask(unmask.port); - spin_unlock(¤t->domain->event_lock); break; } -- 1.7.10.4