TencentOS-kernel/arch/x86/kvm
Thomas Gleixner cfebacff7b x86/process/64: Make save_fsgs_for_kvm() ready for FSGSBASE
commit 6758034e4d6a7f0e26b748789ab1f83f3116d1b9 upstream.
Backport summary: for 5.4 kernel fsgsbase support.

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
(cherry picked from commit 6758034e4d6a7f0e26b748789ab1f83f3116d1b9)
Signed-off-by: Ethan Zhao <Haifeng.Zhao@intel.com>
2021-08-17 06:29:11 +00:00
..
vmx x86/process/64: Make save_fsgs_for_kvm() ready for FSGSBASE 2021-08-17 06:29:11 +00:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cpuid.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cpuid.h KVM: x86: reinstate vendor-agnostic check on SPEC_CTRL cpuid bits 2021-03-16 16:43:50 +08:00
debugfs.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
emulate.c KVM: x86: Update emulator context mode if SYSENTER xfers to 64-bit mode 2021-04-12 12:51:56 +08:00
hyperv.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hyperv.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
i8254.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
i8254.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
i8259.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ioapic.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ioapic.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
irq.c KVM: x86: Fix split-irqchip vs interrupt injection window request 2021-03-16 16:41:36 +08:00
irq.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
irq_comm.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
kvm_cache_regs.h KVM: x86: Mark CR4.TSD as being possibly owned by the guest 2021-03-16 16:31:37 +08:00
lapic.c KVM: x86: handle !lapic_in_kernel case in kvm_cpu_*_extint 2021-03-16 16:41:36 +08:00
lapic.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mmu.c KVM: mmu: Fix SPTE encoding of MMIO generation upper half 2021-03-16 16:42:21 +08:00
mmu.h KVM: x86: fix shift out of bounds reported by UBSAN 2021-04-12 12:51:14 +08:00
mmu_audit.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mmutrace.h KVM: x86: fix incorrect comparison in trace event 2021-03-16 16:36:53 +08:00
mtrr.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
page_track.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
paging_tmpl.h KVM: nVMX: Plumb L2 GPA through to PML emulation 2021-03-16 16:31:08 +08:00
pmu.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pmu.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pmu_amd.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
svm.c kvm: x86: replace kvm_spec_ctrl_test_value with runtime test on the host 2021-04-12 12:52:10 +08:00
trace.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tss.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
x86.c kvm: x86: replace kvm_spec_ctrl_test_value with runtime test on the host 2021-04-12 12:52:10 +08:00
x86.h kvm: x86: replace kvm_spec_ctrl_test_value with runtime test on the host 2021-04-12 12:52:10 +08:00