OSDN Git Service

KVM: x86: Save L1 TSC offset in 'struct kvm_vcpu_arch'
authorSean Christopherson <sean.j.christopherson@intel.com>
Sat, 2 May 2020 04:32:25 +0000 (21:32 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 13 May 2020 16:15:04 +0000 (12:15 -0400)
commit56ba77a459a72a7d95be74355a40a91e1f6dd7f7
tree5baa10ed1ca301dab3d9f57c70ebcd992af95e91
parent1af1bb05625bcdd09522f416b62bcc72cc2fdd3b
KVM: x86: Save L1 TSC offset in 'struct kvm_vcpu_arch'

Save L1's TSC offset in 'struct kvm_vcpu_arch' and drop the kvm_x86_ops
hook read_l1_tsc_offset().  This avoids a retpoline (when configured)
when reading L1's effective TSC, which is done at least once on every
VM-Exit.

No functional change intended.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200502043234.12481-2-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/svm/svm.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c