debuggers.hg

changeset 21227:9d5ecf79f1b5

acpi sleep: domain_freeze() pauses all vcpus, but does not sync the
current vcpu (since that would obviously deadlock).

This simplifies thaw_domains() which is required now that thawing can
happen in deifferent context to freeze_domains().

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Apr 15 12:21:00 2010 +0100 (2010-04-15)
parents 11423ce78ee0
children 960ed5e75e64
files xen/arch/x86/acpi/power.c
line diff
     1.1 --- a/xen/arch/x86/acpi/power.c	Thu Apr 15 11:36:20 2010 +0100
     1.2 +++ b/xen/arch/x86/acpi/power.c	Thu Apr 15 12:21:00 2010 +0100
     1.3 @@ -82,16 +82,12 @@ static void freeze_domains(void)
     1.4      rcu_read_lock(&domlist_read_lock);
     1.5      for_each_domain ( d )
     1.6      {
     1.7 -        switch ( d->domain_id )
     1.8 +        for_each_vcpu ( d, v )
     1.9          {
    1.10 -        case 0:
    1.11 -            for_each_vcpu ( d, v )
    1.12 -                if ( v != current )
    1.13 -                    vcpu_pause(v);
    1.14 -            break;
    1.15 -        default:
    1.16 -            domain_pause(d);
    1.17 -            break;
    1.18 +            if ( v != current )
    1.19 +                vcpu_pause(v);
    1.20 +            else
    1.21 +                vcpu_pause_nosync(v);
    1.22          }
    1.23      }
    1.24      rcu_read_unlock(&domlist_read_lock);
    1.25 @@ -105,17 +101,8 @@ static void thaw_domains(void)
    1.26      rcu_read_lock(&domlist_read_lock);
    1.27      for_each_domain ( d )
    1.28      {
    1.29 -        switch ( d->domain_id )
    1.30 -        {
    1.31 -        case 0:
    1.32 -            for_each_vcpu ( d, v )
    1.33 -                if ( v != current )
    1.34 -                    vcpu_unpause(v);
    1.35 -            break;
    1.36 -        default:
    1.37 -            domain_unpause(d);
    1.38 -            break;
    1.39 -        }
    1.40 +        for_each_vcpu ( d, v )
    1.41 +            vcpu_unpause(v);
    1.42      }
    1.43      rcu_read_unlock(&domlist_read_lock);
    1.44  }