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>
{
struct vcpu_register_runstate_memory_area area;
- rc = -EINVAL;
- if ( v != current )
- break;
-
rc = -EFAULT;
if ( copy_from_guest(&area, arg, 1) )
break;
rc = 0;
v->runstate_guest = area.addr.v;
- __copy_to_user(v->runstate_guest, &v->runstate, sizeof(v->runstate));
+
+ if ( v == current )
+ __copy_to_user(v->runstate_guest, &v->runstate,
+ sizeof(v->runstate));
break;
}