ia64/xen-unstable

changeset 11943:c6747b81d308

[XEN] Fill in runstate_info when virtual address is registered,
even when it is registered from the 'wrong' VCPU.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Oct 23 13:10:24 2006 +0100 (2006-10-23)
parents 356520dca6df
children 93f0957e02ce
files xen/arch/x86/domain.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Mon Oct 23 12:43:32 2006 +0100
     1.2 +++ b/xen/arch/x86/domain.c	Mon Oct 23 13:10:24 2006 +0100
     1.3 @@ -378,6 +378,7 @@ arch_do_vcpu_op(
     1.4      case VCPUOP_register_runstate_memory_area:
     1.5      {
     1.6          struct vcpu_register_runstate_memory_area area;
     1.7 +        struct vcpu_runstate_info runstate;
     1.8  
     1.9          rc = -EFAULT;
    1.10          if ( copy_from_guest(&area, arg, 1) )
    1.11 @@ -390,8 +391,15 @@ arch_do_vcpu_op(
    1.12          v->runstate_guest = area.addr.v;
    1.13  
    1.14          if ( v == current )
    1.15 +        {
    1.16              __copy_to_user(v->runstate_guest, &v->runstate,
    1.17                             sizeof(v->runstate));
    1.18 +        }
    1.19 +        else
    1.20 +        {
    1.21 +            vcpu_runstate_get(v, &runstate);
    1.22 +            __copy_to_user(v->runstate_guest, &runstate, sizeof(runstate));
    1.23 +        }
    1.24  
    1.25          break;
    1.26      }