Re: [patch 03/18] x86: pvclock: remove pvclock_shadow_time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/24/2012 03:13 PM, Marcelo Tosatti wrote:
> Originally from Jeremy Fitzhardinge.
> 
> We can copy the information directly from "struct pvclock_vcpu_time_info", 
> remove pvclock_shadow_time.
> 
> Signed-off-by: Marcelo Tosatti <mtosatti@xxxxxxxxxx>
> 
>  
>  unsigned long pvclock_tsc_khz(struct pvclock_vcpu_time_info *src)
> @@ -90,21 +54,20 @@ void pvclock_resume(void)
>  
>  cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src)
>  {
> -	struct pvclock_shadow_time shadow;
>  	unsigned version;
>  	cycle_t ret, offset;
>  	u64 last;
>  
>  	do {
> -		version = pvclock_get_time_values(&shadow, src);
> +		version = src->version;
>  		rdtsc_barrier();
> -		offset = pvclock_get_nsec_offset(&shadow);
> -		ret = shadow.system_timestamp + offset;
> +		offset = pvclock_get_nsec_offset(src);
> +		ret = src->system_time + offset;
>  		rdtsc_barrier();
> -	} while (version != src->version);
> +	} while ((src->version & 1) || version != src->version);
>  
>  	if ((valid_flags & PVCLOCK_TSC_STABLE_BIT) &&
> -		(shadow.flags & PVCLOCK_TSC_STABLE_BIT))
> +		(src->flags & PVCLOCK_TSC_STABLE_BIT))
>  		return ret;
>  

You're now reading PVCLOCK_TSC_STABLE outside the critical section.  We
could have live migrated to a tsc-unstable host and had this flag cleared.


-- 
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux