pvclock: introduce seqcount-like API
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 9 Jun 2016 11:06:08 +0000 (13:06 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 4 Aug 2016 11:52:21 +0000 (13:52 +0200)
commit3aed64f6d341cdb62bb2d6232589fb13448ce063
tree33c7906993c84a861d4575a19a667bb5d8749046
parent96b585267f552d4b6a28ea8bd75e5ed03deb6e71
pvclock: introduce seqcount-like API

The version field in struct pvclock_vcpu_time_info basically implements
a seqcount.  Wrap it with the usual read_begin and read_retry functions,
and use these APIs instead of peppering the code with smp_rmb()s.
While at it, change it to the more pedantically correct virt_rmb().

With this change, __pvclock_read_cycles can be simplified noticeably.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/entry/vdso/vclock_gettime.c
arch/x86/include/asm/pvclock.h
arch/x86/kernel/pvclock.c