debuggers.hg

changeset 22821:e4688c57c230

xen: fix XEN_DOMCTL_memory_mapping to not return with domain RCU lock held

Broken in 20358:ecc649ec3675

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir@xen.org>
date Tue Jan 18 09:04:04 2011 +0000 (2011-01-18)
parents 96441daf4a5b
children 78e2e5a50daa
files xen/arch/x86/domctl.c
line diff
     1.1 --- a/xen/arch/x86/domctl.c	Tue Jan 18 09:01:57 2011 +0000
     1.2 +++ b/xen/arch/x86/domctl.c	Tue Jan 18 09:04:04 2011 +0000
     1.3 @@ -965,15 +965,15 @@ long arch_do_domctl(
     1.4          if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
     1.5              break;
     1.6  
     1.7 -        ret = -ESRCH;
     1.8 -        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
     1.9 -            break;
    1.10 -
    1.11          ret = -EPERM;
    1.12          if ( !IS_PRIV(current->domain) &&
    1.13               !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
    1.14              break;
    1.15  
    1.16 +        ret = -ESRCH;
    1.17 +        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
    1.18 +            break;
    1.19 +
    1.20          ret=0;
    1.21          if ( domctl->u.memory_mapping.add_mapping )
    1.22          {