]> xenbits.xensource.com Git - people/jgross/xen.git/commitdiff
common: don't (kind of) open-code rcu_lock_domain_by_any_id()
authorJan Beulich <jbeulich@suse.com>
Thu, 7 Jan 2021 14:06:15 +0000 (15:06 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 7 Jan 2021 14:06:15 +0000 (15:06 +0100)
Even more so when using rcu_lock_domain_by_id() in place of the more
efficient rcu_lock_current_domain().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/event_channel.c
xen/common/page_alloc.c

index 4a4809435691ada868974ed26f6373c9f82dc0de..3aa4189d7a0b7d0d8f6ae4178b5fe8b3518df616 100644 (file)
@@ -349,10 +349,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     domid_t        rdom = bind->remote_dom;
     long           rc;
 
-    if ( rdom == DOMID_SELF )
-        rdom = current->domain->domain_id;
-
-    if ( (rd = rcu_lock_domain_by_id(rdom)) == NULL )
+    if ( (rd = rcu_lock_domain_by_any_id(rdom)) == NULL )
         return -ESRCH;
 
     /* Avoid deadlock by first acquiring lock of domain with smaller id. */
index 4e86d7993503b83434063f67b8b9a23db0540ee1..fcb308d92f97e98e4dba3597db976c972519fc85 100644 (file)
@@ -2568,12 +2568,6 @@ struct domain *get_pg_owner(domid_t domid)
 {
     struct domain *pg_owner = NULL, *curr = current->domain;
 
-    if ( likely(domid == DOMID_SELF) )
-    {
-        pg_owner = rcu_lock_current_domain();
-        goto out;
-    }
-
     if ( unlikely(domid == curr->domain_id) )
     {
         gdprintk(XENLOG_WARNING, "Cannot specify itself as foreign domain\n");
@@ -2591,7 +2585,7 @@ struct domain *get_pg_owner(domid_t domid)
         break;
 
     default:
-        if ( (pg_owner = rcu_lock_domain_by_id(domid)) == NULL )
+        if ( (pg_owner = rcu_lock_domain_by_any_id(domid)) == NULL )
             gdprintk(XENLOG_WARNING, "Unknown domain d%d\n", domid);
         break;
     }