x86/kvm/vmx: read MSR_{FS,KERNEL_GS}_BASE from current->thread
authorVitaly Kuznetsov <vkuznets@redhat.com>
Tue, 13 Mar 2018 17:48:04 +0000 (18:48 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 16 Mar 2018 21:03:53 +0000 (22:03 +0100)
commit42b933b59721f288e3ce23ca79a17a973808dab9
tree24f455d30d65833ac4eb2d00a2029f09519aa5aa
parentb31c114b82b2b55913d2cf744e6a665c2ca090ac
x86/kvm/vmx: read MSR_{FS,KERNEL_GS}_BASE from current->thread

vmx_save_host_state() is only called from kvm_arch_vcpu_ioctl_run() so
the context is pretty well defined. Read MSR_{FS,KERNEL_GS}_BASE from
current->thread after calling save_fsgs() which takes care of
X86_BUG_NULL_SEG case now and will do RD[FG,GS]BASE when FSGSBASE
extensions are exposed to userspace (currently they are not).

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/process_64.c
arch/x86/kvm/vmx.c