]> git.baikalelectronics.ru Git - kernel.git/commit
x86/kvm/vmx: avoid expensive rdmsr for MSR_GS_BASE
authorVitaly Kuznetsov <vkuznets@redhat.com>
Tue, 13 Mar 2018 17:48:05 +0000 (18:48 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 16 Mar 2018 21:03:54 +0000 (22:03 +0100)
commitc978faaaa04b1d633b5a8b15d306d9dcf7f1437a
tree8bb681a4e0b7c15fd173e0c27aba1bd2460856ec
parent5a4a450124dd6c0de2d36cafa282c9a49e134ee5
x86/kvm/vmx: avoid expensive rdmsr for MSR_GS_BASE

vmx_save_host_state() is only called from kvm_arch_vcpu_ioctl_run() so
the context is pretty well defined and as we're past 'swapgs' MSR_GS_BASE
should contain kernel's GS base which we point to irq_stack_union.

Add new kernelmode_gs_base() API, irq_stack_union needs to be exported
as KVM can be build as module.

Acked-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/processor.h
arch/x86/kernel/cpu/common.c
arch/x86/kvm/vmx.c