]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Prevent set vCPU into INIT/SIPI_RECEIVED state when INIT are latched
authorLiran Alon <liran.alon@oracle.com>
Mon, 11 Nov 2019 09:16:40 +0000 (11:16 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 15 Nov 2019 10:44:00 +0000 (11:44 +0100)
commitf479c30bbc7d66b318e784a6a1a8fa338355ed59
treebc17f29599d31ae681b7d945675b75ed217ff38f
parentb3d527b5408d2b99c262d3405f13d15b34710e61
KVM: x86: Prevent set vCPU into INIT/SIPI_RECEIVED state when INIT are latched

Commit 3c25e23f0ea3 ("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_MP_STATE allows userspace to put vCPU
into KVM_MP_STATE_SIPI_RECEIVED or KVM_MP_STATE_INIT_RECEIVED even when
vCPU is in VMX operation.

Fix this by introducing a util method to check if vCPU state latch INIT
signals and use it in KVM_SET_MP_STATE handler.

Fixes: 3c25e23f0ea3 ("KVM: x86: Fix INIT signal handling in various CPU states")
Reported-by: Sean Christopherson <sean.j.christopherson@intel.com>
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/lapic.c
arch/x86/kvm/x86.c
arch/x86/kvm/x86.h