]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Add kvm_emulate_{rd,wr}msr() to consolidate VXM/SVM code
authorSean Christopherson <sean.j.christopherson@intel.com>
Thu, 5 Sep 2019 21:22:55 +0000 (14:22 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 10 Sep 2019 17:18:29 +0000 (19:18 +0200)
commit970f5b3db4da54b58cda1679f3c9066482336afa
treebd0f6dafd4ea0904a810717fe7577caec8dcd1a7
parent71886128b6de208023bef355e3995cc4d2c60596
KVM: x86: Add kvm_emulate_{rd,wr}msr() to consolidate VXM/SVM code

Move RDMSR and WRMSR emulation into common x86 code to consolidate
nearly identical SVM and VMX code.

Note, consolidating RDMSR introduces an extra indirect call, i.e.
retpoline, due to reaching {svm,vmx}_get_msr() via kvm_x86_ops, but a
guest kernel likely has bigger problems if increasing the latency of
RDMSR VM-Exits by ~70 cycles has a measurable impact on overall VM
performance.  E.g. the only recurring RDMSR VM-Exits (after booting) on
my system running Linux 5.2 in the guest are for MSR_IA32_TSC_ADJUST via
arch_cpu_idle_enter().

No functional change intended.

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