Re: [PATCH v3 2/3] x86/hyperv: move TSC reading method to asm/mshyperv.h

2017-03-04 Thread Thomas Gleixner
On Fri, 3 Mar 2017, Stephen Hemminger wrote: > static inline u64 hv_read_tsc_page(const struct ms_hyperv_tsc_page *tsc_pg) > { > u64 scale, offset, cur_tsc; > u32 start; > > /* >* The protocol for reading Hyper-V TSC page is specified in Hypervisor >* Top-Level

Re: [PATCH v3 2/3] x86/hyperv: move TSC reading method to asm/mshyperv.h

2017-03-03 Thread Stephen Hemminger
Minor coding comments > diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h > index d324dce..4ff25436 100644 > --- a/arch/x86/include/asm/mshyperv.h > +++ b/arch/x86/include/asm/mshyperv.h > @@ -178,6 +178,56 @@ void hyperv_cleanup(void); > #endif > #ifdef

[PATCH v3 2/3] x86/hyperv: move TSC reading method to asm/mshyperv.h

2017-03-03 Thread Vitaly Kuznetsov
As a preparation to making Hyper-V TSC page suitable for vDSO move the TSC page reading logic to asm/mshyperv.h. While on it, do the following - Document the reading algorithm. - Simplify the code a bit. - Add explicit READ_ONCE() to not rely on 'volatile'. - Add explicit barriers to prevent