x86/kvmclock: set pvti_cpu0_va after enabling kvmclock
authorRadim Krčmář <rkrcmar@redhat.com>
Sun, 15 Jul 2018 15:43:11 +0000 (17:43 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 15 Jul 2018 15:44:16 +0000 (17:44 +0200)
commit94ffba484663ab3fc695ce2a34871e8c3db499f7
treeedcb88187a928c488180db09517ae2edc4fed386
parentd30f370d3a4998c13ed3e5c8ef607d05be0a987a
x86/kvmclock: set pvti_cpu0_va after enabling kvmclock

pvti_cpu0_va is the address of shared kvmclock data structure.

pvti_cpu0_va is currently kept unset (1) on 32 bit systems, (2) when
kvmclock vsyscall is disabled, and (3) if kvmclock is not stable.
This poses a problem, because kvm_ptp needs pvti_cpu0_va, but (1) can
work on 32 bit, (2) has little relation to the vsyscall, and (3) does
not need stable kvmclock (although kvmclock won't be used for system
clock if it's not stable, so kvm_ptp is pointless in that case).

Expose pvti_cpu0_va whenever kvmclock is enabled to allow all users to
work with it.

This fixes a regression found on Gentoo: https://bugs.gentoo.org/658544.

Fixes: 9f08890ab906 ("x86/pvclock: add setter for pvclock_pvti_cpu0_va")
Cc: stable@vger.kernel.org
Reported-by: Andreas Steinmetz <ast@domdv.de>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kernel/kvmclock.c