From: kaf24@firebug.cl.cam.ac.uk Date: Fri, 9 Jun 2006 16:05:09 +0000 (+0100) Subject: [XEN] VCPU operation register_runstate should work even when X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15972^2~21 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=10d0541c1db0c494ea74e44e464c800b783ef8c8;p=xen.git [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 --- diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 1890956916..b4ad1a7a81 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -377,10 +377,6 @@ arch_do_vcpu_op( { struct vcpu_register_runstate_memory_area area; - rc = -EINVAL; - if ( v != current ) - break; - rc = -EFAULT; if ( copy_from_guest(&area, arg, 1) ) break; @@ -390,7 +386,10 @@ arch_do_vcpu_op( 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; }