]> git.baikalelectronics.ru Git - kernel.git/commit
pvclock: Add CPU barriers to get correct version value
authorMinfei Huang <mnghuan@gmail.com>
Fri, 27 May 2016 06:17:10 +0000 (14:17 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 27 Jun 2016 13:12:14 +0000 (15:12 +0200)
commit0fc7ccd0b1b7dad1a4256d8d101b7ac3fc519eb5
tree03a21cc3d1eb86ecc2e0a45c889e63a1cb366a3f
parentdf5a8a9ace16d9351a8a97dd598e0b53b307b766
pvclock: Add CPU barriers to get correct version value

Protocol for the "version" fields is: hypervisor raises it (making it
uneven) before it starts updating the fields and raises it again (making
it even) when it is done.  Thus the guest can make sure the time values
it got are consistent by checking the version before and after reading
them.

Add CPU barries after getting version value just like what function
vread_pvclock does, because all of callees in this function is inline.

Fixes: ebdaf7cd8697e43d401daa7af6321ce7c8d564c7
Cc: stable@vger.kernel.org
Signed-off-by: Minfei Huang <mnghuan@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/pvclock.h
arch/x86/kernel/pvclock.c