KVM: x86: Evaluate latched_init in KVM_SET_VCPU_EVENTS when vCPU not in SMM
authorLiran Alon <liran.alon@oracle.com>
Mon, 11 Nov 2019 09:16:39 +0000 (11:16 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 15 Nov 2019 10:43:59 +0000 (11:43 +0100)
commitff90afa75573502f3ac05acd5a282d6e3d4cef34
treeac2aa0008434b007556cdc5071ed6644ad2a3172
parent74c504a6d70ab29b2c28bee62f5f39e3dd847ea2
KVM: x86: Evaluate latched_init in KVM_SET_VCPU_EVENTS when vCPU not in SMM

Commit 4b9852f4f389 ("KVM: x86: Fix INIT signal handling in various CPU states")
fixed KVM to also latch pending LAPIC INIT event when vCPU is in VMX
operation.

However, current API of KVM_SET_VCPU_EVENTS defines this field as
part of SMM state and only set pending LAPIC INIT event if vCPU is
specified to be in SMM mode (events->smi.smm is set).

Change KVM_SET_VCPU_EVENTS handler to set pending LAPIC INIT event
by latched_init field regardless of if vCPU is in SMM mode or not.

Fixes: 4b9852f4f389 ("KVM: x86: Fix INIT signal handling in various CPU states")
Reviewed-by: Mihai Carabas <mihai.carabas@oracle.com>
Signed-off-by: Liran Alon <liran.alon@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c