WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Introduce rcu_lock_remote_target_domain_b

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Introduce rcu_lock_remote_target_domain_by_id().
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Wed, 09 Feb 2011 06:50:35 -0800
Delivery-date: Wed, 09 Feb 2011 06:52:32 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1297072293 0
# Node ID 7a772fc4d92f9b04885fc2207670ecaec5c3e553
# Parent  098c8a6483c9140f82f8d39ddb5e2b7d6e394151
Introduce rcu_lock_remote_target_domain_by_id().

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---
 xen/common/domain.c     |   14 ++++++++++++++
 xen/include/xen/sched.h |    7 +++++++
 2 files changed, 21 insertions(+)

diff -r 098c8a6483c9 -r 7a772fc4d92f xen/common/domain.c
--- a/xen/common/domain.c       Mon Feb 07 09:39:59 2011 +0000
+++ b/xen/common/domain.c       Mon Feb 07 09:51:33 2011 +0000
@@ -438,6 +438,20 @@ int rcu_lock_target_domain_by_id(domid_t
     return 0;
 }
 
+int rcu_lock_remote_target_domain_by_id(domid_t dom, struct domain **d)
+{
+    if ( (*d = rcu_lock_domain_by_id(dom)) == NULL )
+        return -ESRCH;
+
+    if ( (*d == current->domain) || !IS_PRIV_FOR(current->domain, *d) )
+    {
+        rcu_unlock_domain(*d);
+        return -EPERM;
+    }
+
+    return 0;
+}
+
 int domain_kill(struct domain *d)
 {
     int rc = 0;
diff -r 098c8a6483c9 -r 7a772fc4d92f xen/include/xen/sched.h
--- a/xen/include/xen/sched.h   Mon Feb 07 09:39:59 2011 +0000
+++ b/xen/include/xen/sched.h   Mon Feb 07 09:51:33 2011 +0000
@@ -435,6 +435,13 @@ struct domain *rcu_lock_domain_by_id(dom
  */
 int rcu_lock_target_domain_by_id(domid_t dom, struct domain **d);
 
+/*
+ * As rcu_lock_target_domain_by_id(), but will fail EPERM rather than resolve
+ * to local domain. Successful return always resolves to a remote domain that
+ * the local domain is privileged to control.
+ */
+int rcu_lock_remote_target_domain_by_id(domid_t dom, struct domain **d);
+
 /* Finish a RCU critical region started by rcu_lock_domain_by_id(). */
 static inline void rcu_unlock_domain(struct domain *d)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Introduce rcu_lock_remote_target_domain_by_id()., Xen patchbot-unstable <=