X86/KVM: Properly update 'tsc_offset' to represent the running guest
authorKarimAllah Ahmed <karahmed@amazon.de>
Sat, 14 Apr 2018 03:10:52 +0000 (05:10 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Apr 2018 15:50:11 +0000 (17:50 +0200)
commite79f245ddec17bbd89d73cd0169dba4be46c9b55
tree0cf1274bfc8df0b80aeb1908a052e707fe9082c0
parent4e1acd7b31a03f24cc6108d37d005e6b1d48c5d3
X86/KVM: Properly update 'tsc_offset' to represent the running guest

Update 'tsc_offset' on vmentry/vmexit of L2 guests to ensure that it always
captures the TSC_OFFSET of the running guest whether it is the L1 or L2
guest.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Jim Mattson <jmattson@google.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: KarimAllah Ahmed <karahmed@amazon.de>
[AMD changes, fix update_ia32_tsc_adjust_msr. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/svm.c
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c