WSL2-Linux-Kernel/arch
Jay Zhou 1f7becf1b7 KVM: x86: get smi pending status correctly
The injection process of smi has two steps:

    Qemu                        KVM
Step1:
    cpu->interrupt_request &= \
        ~CPU_INTERRUPT_SMI;
    kvm_vcpu_ioctl(cpu, KVM_SMI)

                                call kvm_vcpu_ioctl_smi() and
                                kvm_make_request(KVM_REQ_SMI, vcpu);

Step2:
    kvm_vcpu_ioctl(cpu, KVM_RUN, 0)

                                call process_smi() if
                                kvm_check_request(KVM_REQ_SMI, vcpu) is
                                true, mark vcpu->arch.smi_pending = true;

The vcpu->arch.smi_pending will be set true in step2, unfortunately if
vcpu paused between step1 and step2, the kvm_run->immediate_exit will be
set and vcpu has to exit to Qemu immediately during step2 before mark
vcpu->arch.smi_pending true.
During VM migration, Qemu will get the smi pending status from KVM using
KVM_GET_VCPU_EVENTS ioctl at the downtime, then the smi pending status
will be lost.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Signed-off-by: Shengen Zhuang <zhuangshengen@huawei.com>
Message-Id: <20210118084720.1585-1-jianjay.zhou@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-01-25 18:52:07 -05:00
..
alpha
arc ARC: [hsdk]: Enable FPU_SAVE_RESTORE 2021-01-08 13:46:58 -08:00
arm ARM: SoC fixes for v5.11 2021-01-08 14:13:54 -08:00
arm64 KVM/arm64 fixes for 5.11, take #2 2021-01-25 18:52:01 -05:00
c6x
csky
h8300
hexagon
ia64
m68k
microblaze
mips
nds32
nios2
openrisc
parisc
powerpc powerpc: Handle .text.{hot,unlikely}.* in linker script 2021-01-06 21:59:04 +11:00
riscv
s390 Merge branch 'kvm-master' into kvm-next 2021-01-07 18:06:52 -05:00
sh
sparc
um
x86 KVM: x86: get smi pending status correctly 2021-01-25 18:52:07 -05:00
xtensa
.gitignore
Kconfig