direct-io.hg

changeset 10314:b8e8b6aad8c8

[XEN] VCPU operation register_runstate should work even when
called from non-local VCPU. Necessary as Linux always calls
this operation from VCPU0 during secondary-VCPU bringup.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Jun 09 17:05:09 2006 +0100 (2006-06-09)
parents 96b1479305ce
children ea4829e30092
files xen/arch/x86/domain.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Fri Jun 09 16:49:49 2006 +0100
     1.2 +++ b/xen/arch/x86/domain.c	Fri Jun 09 17:05:09 2006 +0100
     1.3 @@ -377,10 +377,6 @@ arch_do_vcpu_op(
     1.4      {
     1.5          struct vcpu_register_runstate_memory_area area;
     1.6  
     1.7 -        rc = -EINVAL;
     1.8 -        if ( v != current )
     1.9 -            break;
    1.10 -
    1.11          rc = -EFAULT;
    1.12          if ( copy_from_guest(&area, arg, 1) )
    1.13              break;
    1.14 @@ -390,7 +386,10 @@ arch_do_vcpu_op(
    1.15  
    1.16          rc = 0;
    1.17          v->runstate_guest = area.addr.v;
    1.18 -        __copy_to_user(v->runstate_guest, &v->runstate, sizeof(v->runstate));
    1.19 +
    1.20 +        if ( v == current )
    1.21 +            __copy_to_user(v->runstate_guest, &v->runstate,
    1.22 +                           sizeof(v->runstate));
    1.23  
    1.24          break;
    1.25      }