KVM: x86: fix vcpu initialization with userspace lapic
authorRadim Krčmář <rkrcmar@redhat.com>
Thu, 1 Mar 2018 14:24:25 +0000 (15:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Mar 2018 06:41:25 +0000 (22:41 -0800)
commitb4830f3ad9c5e2bb9fd9782c88fd7584556ddc8d
treeed5910d646fec2b295b25d572d85c02efae24806
parent1f17daea70264051c084dcca757e67c8e0288fa0
KVM: x86: fix vcpu initialization with userspace lapic

commit b7e31be385584afe7f073130e8e570d53c95f7fe upstream.

Moving the code around broke this rare configuration.
Use this opportunity to finally call lapic reset from vcpu reset.

Reported-by: syzbot+fb7a33a4b6c35007a72b@syzkaller.appspotmail.com
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Fixes: 0b2e9904c159 ("KVM: x86: move LAPIC initialization after VMCS creation")
Cc: stable@vger.kernel.org
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/lapic.c
arch/x86/kvm/x86.c