ia64/xen-unstable

changeset 18410:a37902923a67

x86: time_calibration_rendezvous must be invoked with @wait=1.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Aug 28 13:31:49 2008 +0100 (2008-08-28)
parents b674d7159549
children 26daab313faa
files xen/arch/x86/time.c
line diff
     1.1 --- a/xen/arch/x86/time.c	Thu Aug 28 13:09:02 2008 +0100
     1.2 +++ b/xen/arch/x86/time.c	Thu Aug 28 13:31:49 2008 +0100
     1.3 @@ -1008,6 +1008,7 @@ static void time_calibration_rendezvous(
     1.4          while ( atomic_read(&r->nr_cpus) != (total_cpus - 1) )
     1.5              cpu_relax();
     1.6          r->master_stime = read_platform_stime();
     1.7 +        mb(); /* write r->master_stime /then/ signal */
     1.8          atomic_inc(&r->nr_cpus);
     1.9      }
    1.10      else
    1.11 @@ -1015,6 +1016,7 @@ static void time_calibration_rendezvous(
    1.12          atomic_inc(&r->nr_cpus);
    1.13          while ( atomic_read(&r->nr_cpus) != total_cpus )
    1.14              cpu_relax();
    1.15 +        mb(); /* receive signal /then/ read r->master_stime */
    1.16      }
    1.17  
    1.18      rdtscll(c->local_tsc_stamp);
    1.19 @@ -1030,7 +1032,8 @@ static void time_calibration(void *unuse
    1.20          .nr_cpus = ATOMIC_INIT(0)
    1.21      };
    1.22  
    1.23 -    on_each_cpu(time_calibration_rendezvous, &r, 0, 0);
    1.24 +    /* @wait=1 because we must wait for all cpus before freeing @r. */
    1.25 +    on_each_cpu(time_calibration_rendezvous, &r, 0, 1);
    1.26  }
    1.27  
    1.28  void init_percpu_time(void)