From: Keir Fraser Date: Thu, 28 Aug 2008 12:31:49 +0000 (+0100) Subject: x86: time_calibration_rendezvous must be invoked with @wait=1. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14113^2~10 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1d534660ad9487622a23d4deff31fe8131bd83fb;p=xen.git x86: time_calibration_rendezvous must be invoked with @wait=1. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index 15d6e4a26c..9bdd920c10 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -1008,6 +1008,7 @@ static void time_calibration_rendezvous(void *_r) while ( atomic_read(&r->nr_cpus) != (total_cpus - 1) ) cpu_relax(); r->master_stime = read_platform_stime(); + mb(); /* write r->master_stime /then/ signal */ atomic_inc(&r->nr_cpus); } else @@ -1015,6 +1016,7 @@ static void time_calibration_rendezvous(void *_r) atomic_inc(&r->nr_cpus); while ( atomic_read(&r->nr_cpus) != total_cpus ) cpu_relax(); + mb(); /* receive signal /then/ read r->master_stime */ } rdtscll(c->local_tsc_stamp); @@ -1030,7 +1032,8 @@ static void time_calibration(void *unused) .nr_cpus = ATOMIC_INIT(0) }; - on_each_cpu(time_calibration_rendezvous, &r, 0, 0); + /* @wait=1 because we must wait for all cpus before freeing @r. */ + on_each_cpu(time_calibration_rendezvous, &r, 0, 1); } void init_percpu_time(void)