mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
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();
|
||||
|
||||