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-ia64-devel

[Xen-ia64-devel] [PATCH 2/7] introduce rcu_lock_target_domain_by_id() fo

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH 2/7] introduce rcu_lock_target_domain_by_id() for later use
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Thu, 2 Oct 2008 18:08:04 +0900
Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Delivery-date: Thu, 02 Oct 2008 02:03:53 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
[IA64] add helper function rcu_lock_target_domain_by_id()

Introduce helper function, rcu_lock_target_domain_by_id().

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r 4a2b1b8dc9c2 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c    Thu Oct 02 15:23:26 2008 +0900
+++ b/xen/arch/ia64/xen/mm.c    Thu Oct 02 15:24:17 2008 +0900
@@ -3134,6 +3134,23 @@
     return (efi_mem_type(p) == EFI_CONVENTIONAL_MEMORY);
 }
 
+int
+rcu_lock_target_domain_by_id(domid_t domid, struct domain **d)
+{
+    if (domid == DOMID_SELF)
+        *d = rcu_lock_current_domain();
+    else {
+        *d = rcu_lock_domain_by_id(domid);
+        if (d == NULL)
+            return -ESRCH;
+        if (!IS_PRIV_FOR(current->domain, *d)) {
+            rcu_lock_domain(*d);
+            return -EPERM;
+        }
+    }
+
+    return 0;
+}
 
 long
 arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
diff -r 4a2b1b8dc9c2 xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h     Thu Oct 02 15:23:26 2008 +0900
+++ b/xen/include/asm-ia64/domain.h     Thu Oct 02 15:24:17 2008 +0900
@@ -316,6 +316,9 @@
            unsigned long iim, unsigned long itir, unsigned long arg5,
            unsigned long arg6, unsigned long arg7, unsigned long stack);
 
+int
+rcu_lock_target_domain_by_id(domid_t domid, struct domain **d);
+
 #endif /* __ASM_DOMAIN_H__ */
 
 /*

Attachment: rcu-get-target-domain-by-id.patch
Description: Text Data

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [PATCH 2/7] introduce rcu_lock_target_domain_by_id() for later use, Isaku Yamahata <=