ia64/xen-unstable

changeset 9261:e3d7c2183866

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>
author kaf24@firebug.cl.cam.ac.uk
date Tue Mar 14 17:35:38 2006 +0100 (2006-03-14)
parents f4cef1aa2521
children c445d4a0dd76
files linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c	Tue Mar 14 16:09:34 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c	Tue Mar 14 17:35:38 2006 +0100
     1.3 @@ -332,6 +332,7 @@ static inline int time_values_up_to_date
     1.4  	src = &HYPERVISOR_shared_info->vcpu_info[cpu].time;
     1.5  	dst = &per_cpu(shadow_time, cpu);
     1.6  
     1.7 +	rmb();
     1.8  	return (dst->version == src->version);
     1.9  }
    1.10  
    1.11 @@ -558,11 +559,11 @@ unsigned long long monotonic_clock(void)
    1.12  
    1.13  	do {
    1.14  		local_time_version = shadow->version;
    1.15 -		smp_rmb();
    1.16 +		barrier();
    1.17  		time = shadow->system_timestamp + get_nsec_offset(shadow);
    1.18  		if (!time_values_up_to_date(cpu))
    1.19  			get_time_values_from_xen();
    1.20 -		smp_rmb();
    1.21 +		barrier();
    1.22  	} while (local_time_version != shadow->version);
    1.23  
    1.24  	put_cpu();