]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit99c4fbe7d477662fc3d59530f686e4341e8d1e42
tree24f455d30d65833ac4eb2d00a2029f09519aa5aa
parent9b92d0c69ad472a5c2660dba8cf923ffe0d67ffb
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