ia64/xen-unstable

changeset 18819:db7a713071fe

x86: freeze non-current vCPUs of dom0 before entering S5

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Nov 20 14:21:17 2008 +0000 (2008-11-20)
parents 857bda0c15b3
children 6468257e9e62
files xen/arch/x86/acpi/power.c
line diff
     1.1 --- a/xen/arch/x86/acpi/power.c	Thu Nov 20 14:17:09 2008 +0000
     1.2 +++ b/xen/arch/x86/acpi/power.c	Thu Nov 20 14:21:17 2008 +0000
     1.3 @@ -77,19 +77,47 @@ static void device_power_up(void)
     1.4  static void freeze_domains(void)
     1.5  {
     1.6      struct domain *d;
     1.7 +    struct vcpu *v;
     1.8  
     1.9 +    rcu_read_lock(&domlist_read_lock);
    1.10      for_each_domain ( d )
    1.11 -        if ( d->domain_id != 0 )
    1.12 +    {
    1.13 +        switch ( d->domain_id )
    1.14 +        {
    1.15 +        case 0:
    1.16 +            for_each_vcpu ( d, v )
    1.17 +                if ( v != current )
    1.18 +                    vcpu_pause(v);
    1.19 +            break;
    1.20 +        default:
    1.21              domain_pause(d);
    1.22 +            break;
    1.23 +        }
    1.24 +    }
    1.25 +    rcu_read_unlock(&domlist_read_lock);
    1.26  }
    1.27  
    1.28  static void thaw_domains(void)
    1.29  {
    1.30      struct domain *d;
    1.31 +    struct vcpu *v;
    1.32  
    1.33 +    rcu_read_lock(&domlist_read_lock);
    1.34      for_each_domain ( d )
    1.35 -        if ( d->domain_id != 0 )
    1.36 +    {
    1.37 +        switch ( d->domain_id )
    1.38 +        {
    1.39 +        case 0:
    1.40 +            for_each_vcpu ( d, v )
    1.41 +                if ( v != current )
    1.42 +                    vcpu_unpause(v);
    1.43 +            break;
    1.44 +        default:
    1.45              domain_unpause(d);
    1.46 +            break;
    1.47 +        }
    1.48 +    }
    1.49 +    rcu_read_unlock(&domlist_read_lock);
    1.50  }
    1.51  
    1.52  static void acpi_sleep_prepare(u32 state)