ia64/xen-unstable

changeset 17251:b2a3fe7f5591

domain_shutdown() needs to vcpu_pause_nosync() rather than directly
incrementing the pause_count field. The latter ensures that the VCPU
gets descheduled --- synchronously in the case of the
currently-running VCPU.

Based on a bug report and proposed patch by Ben Guthro and Robert
Phillips of Virtual Iron.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 18 15:23:25 2008 +0000 (2008-03-18)
parents 64b19db801b6
children c4de13817571
files xen/common/domain.c
line diff
     1.1 --- a/xen/common/domain.c	Tue Mar 18 15:03:43 2008 +0000
     1.2 +++ b/xen/common/domain.c	Tue Mar 18 15:23:25 2008 +0000
     1.3 @@ -110,10 +110,6 @@ static void __domain_finalise_shutdown(s
     1.4              return;
     1.5  
     1.6      d->is_shut_down = 1;
     1.7 -
     1.8 -    for_each_vcpu ( d, v )
     1.9 -        vcpu_sleep_nosync(v);
    1.10 -
    1.11      send_guest_global_virq(dom0, VIRQ_DOM_EXC);
    1.12  }
    1.13  
    1.14 @@ -126,7 +122,7 @@ static void vcpu_check_shutdown(struct v
    1.15      if ( d->is_shutting_down )
    1.16      {
    1.17          if ( !v->paused_for_shutdown )
    1.18 -            atomic_inc(&v->pause_count);
    1.19 +            vcpu_pause_nosync(v);
    1.20          v->paused_for_shutdown = 1;
    1.21          v->defer_shutdown = 0;
    1.22          __domain_finalise_shutdown(d);
    1.23 @@ -426,7 +422,7 @@ void domain_shutdown(struct domain *d, u
    1.24      {
    1.25          if ( v->defer_shutdown )
    1.26              continue;
    1.27 -        atomic_inc(&v->pause_count);
    1.28 +        vcpu_pause_nosync(v);
    1.29          v->paused_for_shutdown = 1;
    1.30      }
    1.31