ia64/xen-unstable

changeset 4105:2b9699a37f17

bitkeeper revision 1.1236.25.6 (4231d11bY0LPS6C3wJjBX-5Tagm2NA)

Fix a couple of error paths. Use of domain_crash() probably needs
auditing for safe use, and it may need to do things like forcibly
release the per-domain BIGLOCK.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Mar 11 17:10:51 2005 +0000 (2005-03-11)
parents d5c2dbd99373
children c7af9ee33283 4a4b4a6ef605
files xen/arch/x86/mm.c xen/arch/x86/traps.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Fri Mar 11 16:35:53 2005 +0000
     1.2 +++ b/xen/arch/x86/mm.c	Fri Mar 11 17:10:51 2005 +0000
     1.3 @@ -2387,7 +2387,6 @@ void ptwr_flush(const int which)
     1.4                     (L1_PAGETABLE_ENTRIES - i) * sizeof(l1_pgentry_t));
     1.5              unmap_domain_mem(pl1e);
     1.6              ptwr_info[cpu].ptinfo[which].l1va = 0;
     1.7 -            UNLOCK_BIGLOCK(d);
     1.8              domain_crash();
     1.9          }
    1.10          
     2.1 --- a/xen/arch/x86/traps.c	Fri Mar 11 16:35:53 2005 +0000
     2.2 +++ b/xen/arch/x86/traps.c	Fri Mar 11 17:10:51 2005 +0000
     2.3 @@ -1007,6 +1007,7 @@ long do_set_trap_table(trap_info_t *trap
     2.4  {
     2.5      trap_info_t cur;
     2.6      trap_info_t *dst = current->arch.traps;
     2.7 +    long rc = 0;
     2.8  
     2.9      LOCK_BIGLOCK(current->domain);
    2.10  
    2.11 @@ -1014,16 +1015,25 @@ long do_set_trap_table(trap_info_t *trap
    2.12      {
    2.13          if ( hypercall_preempt_check() )
    2.14          {
    2.15 -            UNLOCK_BIGLOCK(current->domain);
    2.16 -            return hypercall1_create_continuation(
    2.17 +            rc = hypercall1_create_continuation(
    2.18                  __HYPERVISOR_set_trap_table, traps);
    2.19 +            break;
    2.20          }
    2.21  
    2.22 -        if ( copy_from_user(&cur, traps, sizeof(cur)) ) return -EFAULT;
    2.23 +        if ( copy_from_user(&cur, traps, sizeof(cur)) ) 
    2.24 +        {
    2.25 +            rc = -EFAULT;
    2.26 +            break;
    2.27 +        }
    2.28  
    2.29 -        if ( cur.address == 0 ) break;
    2.30 +        if ( cur.address == 0 )
    2.31 +            break;
    2.32  
    2.33 -        if ( !VALID_CODESEL(cur.cs) ) return -EPERM;
    2.34 +        if ( !VALID_CODESEL(cur.cs) )
    2.35 +        {
    2.36 +            rc = -EPERM;
    2.37 +            break;
    2.38 +        }
    2.39  
    2.40          memcpy(dst+cur.vector, &cur, sizeof(cur));
    2.41          traps++;
    2.42 @@ -1031,7 +1041,7 @@ long do_set_trap_table(trap_info_t *trap
    2.43  
    2.44      UNLOCK_BIGLOCK(current->domain);
    2.45  
    2.46 -    return 0;
    2.47 +    return rc;
    2.48  }
    2.49  
    2.50