x86/time: introduce and use rdtsc_ordered()
authorJan Beulich <jbeulich@suse.com>
Wed, 3 Aug 2016 12:40:44 +0000 (14:40 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 3 Aug 2016 12:40:44 +0000 (14:40 +0200)
commitfa74e70500fd73dd2fc441c7dc00b190fb37cee5
treee5f4e22a682a82492ce76c7dcae2921b09cb8b51
parentbb49fd3092a84ce151f5528794c0e612eeb4961a
x86/time: introduce and use rdtsc_ordered()

Matching Linux commit 03b9730b76 ("x86/asm/tsc: Add rdtsc_ordered() and
use it in trivial call sites") and earlier ones it builds upon, let's
make sure timing loops don't have their rdtsc()-s re-ordered, as that
would harm precision of the result (values were observed to be several
hundred clocks off without this adjustment).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Joao Martins <joao.m.martins@oracle.com>
xen/arch/x86/apic.c
xen/arch/x86/cpu/amd.c
xen/arch/x86/delay.c
xen/arch/x86/smpboot.c
xen/arch/x86/time.c
xen/include/asm-x86/cpufeature.h
xen/include/asm-x86/msr.h