]> git.baikalelectronics.ru Git - kernel.git/commit
x86/process/64: Make save_fsgs_for_kvm() ready for FSGSBASE
authorThomas Gleixner <tglx@linutronix.de>
Thu, 28 May 2020 20:13:52 +0000 (16:13 -0400)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 18 Jun 2020 13:47:01 +0000 (15:47 +0200)
commit204065f98b1e3f70d0b77011dde12b62a54224e2
treefcaaccf48964fa4f0a63bf54ccb1b9ec3d902fd7
parent56da2178ba7e2202e56c8f5fc69c51659b12b8a9
x86/process/64: Make save_fsgs_for_kvm() ready for FSGSBASE

save_fsgs_for_kvm() is invoked via

  vcpu_enter_guest()
    kvm_x86_ops.prepare_guest_switch(vcpu)
      vmx_prepare_switch_to_guest()
        save_fsgs_for_kvm()

with preemption disabled, but interrupts enabled.

The upcoming FSGSBASE based GS safe needs interrupts to be disabled. This
could be done in the helper function, but that function is also called from
switch_to() which has interrupts disabled already.

Disable interrupts inside save_fsgs_for_kvm() and rename the function to
current_save_fsgs() so it can be invoked from other places.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20200528201402.1708239-7-sashal@kernel.org
arch/x86/include/asm/processor.h
arch/x86/kernel/process_64.c
arch/x86/kvm/vmx/vmx.c