Add a read barrier to the time-values-uptodate xenlinux time checking function.

Also fix monotonic clock to use just a compile barrier instead of smp_rmb.

Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2006-03-14 17:35:38 +01:00
1 parent 682857ee1f
commit a555857793
1 file changed
+3 -2
@@ -332,6 +332,7 @@ static inline int time_values_up_to_date(int cpu)
src = &HYPERVISOR_shared_info->vcpu_info[cpu].time;
dst = &per_cpu(shadow_time, cpu);
rmb();
return (dst->version == src->version);
}
@@ -558,11 +559,11 @@ unsigned long long monotonic_clock(void)
do {
local_time_version = shadow->version;
smp_rmb();
barrier();
time = shadow->system_timestamp + get_nsec_offset(shadow);
if (!time_values_up_to_date(cpu))
get_time_values_from_xen();
smp_rmb();
barrier();
} while (local_time_version != shadow->version);
put_cpu();
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.