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] x86: physdev_[un]map_pirq() use rcu_lock_

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: physdev_[un]map_pirq() use rcu_lock_target_domain_by_id().
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Sat, 29 Jan 2011 15:05:31 -0800
Delivery-date: Sat, 29 Jan 2011 15:10:00 -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 1296032204 0
# Node ID 16c863cb99f253bcc404a381920b46e9389484bd
# Parent  e7f44fb4ecc378665d2cfd2353693a9f1a00cd72
x86: physdev_[un]map_pirq() use rcu_lock_target_domain_by_id().

More idiomatic, and avoids accidental failure to check caller
privilege. For example, the unmap path was not checking for any
privilege before calling unmap_domain_pirq_emuirq(), which can't be
right.

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---
 xen/arch/x86/physdev.c |   19 ++++++-------------
 1 files changed, 6 insertions(+), 13 deletions(-)

diff -r e7f44fb4ecc3 -r 16c863cb99f2 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c    Wed Jan 26 08:54:12 2011 +0000
+++ b/xen/arch/x86/physdev.c    Wed Jan 26 08:56:44 2011 +0000
@@ -87,14 +87,9 @@ static int physdev_map_pirq(struct physd
     struct msi_info _msi;
     void *map_data = NULL;
 
-    if ( !map )
-        return -EINVAL;
-
-    d = (map->domid == DOMID_SELF) ? rcu_lock_current_domain()
-        : rcu_lock_domain_by_id(map->domid);
-
-    if ( d == NULL )
-        return -ESRCH;
+    ret = rcu_lock_target_domain_by_id(map->domid, &d);
+    if ( ret )
+        return ret;
 
     if ( map->domid == DOMID_SELF && is_hvm_domain(d) )
     {
@@ -225,11 +220,9 @@ static int physdev_unmap_pirq(struct phy
     struct domain *d;
     int ret;
 
-    d = (unmap->domid == DOMID_SELF) ? rcu_lock_current_domain()
-        : rcu_lock_domain_by_id(unmap->domid);
-
-    if ( d == NULL )
-        return -ESRCH;
+    ret = rcu_lock_target_domain_by_id(unmap->domid, &d);
+    if ( ret )
+        return ret;
 
     if ( is_hvm_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] x86: physdev_[un]map_pirq() use rcu_lock_target_domain_by_id()., Xen patchbot-unstable <=