|
@@ -2002,14 +2002,13 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
|
|
|
|
|
|
void kvm_lapic_reset(struct kvm_vcpu *vcpu, bool init_event)
|
|
void kvm_lapic_reset(struct kvm_vcpu *vcpu, bool init_event)
|
|
{
|
|
{
|
|
- struct kvm_lapic *apic;
|
|
|
|
|
|
+ struct kvm_lapic *apic = vcpu->arch.apic;
|
|
int i;
|
|
int i;
|
|
|
|
|
|
- apic_debug("%s\n", __func__);
|
|
|
|
|
|
+ if (!apic)
|
|
|
|
+ return;
|
|
|
|
|
|
- ASSERT(vcpu);
|
|
|
|
- apic = vcpu->arch.apic;
|
|
|
|
- ASSERT(apic != NULL);
|
|
|
|
|
|
+ apic_debug("%s\n", __func__);
|
|
|
|
|
|
/* Stop the timer in case it's a reset to an active apic */
|
|
/* Stop the timer in case it's a reset to an active apic */
|
|
hrtimer_cancel(&apic->lapic_timer.timer);
|
|
hrtimer_cancel(&apic->lapic_timer.timer);
|
|
@@ -2568,7 +2567,6 @@ void kvm_apic_accept_events(struct kvm_vcpu *vcpu)
|
|
|
|
|
|
pe = xchg(&apic->pending_events, 0);
|
|
pe = xchg(&apic->pending_events, 0);
|
|
if (test_bit(KVM_APIC_INIT, &pe)) {
|
|
if (test_bit(KVM_APIC_INIT, &pe)) {
|
|
- kvm_lapic_reset(vcpu, true);
|
|
|
|
kvm_vcpu_reset(vcpu, true);
|
|
kvm_vcpu_reset(vcpu, true);
|
|
if (kvm_vcpu_is_bsp(apic->vcpu))
|
|
if (kvm_vcpu_is_bsp(apic->vcpu))
|
|
vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
|
|
vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
|