Message ID | 514070CC.1010202@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 2013-03-13 13:27, Paolo Bonzini wrote: > With the following hack to inject an INIT and corresponding QEMU changes: > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 2609e7b99..efdab35 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -6182,8 +6182,16 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, > if (mp_state->mp_state == KVM_MP_STATE_SIPI_RECEIVED) { > vcpu->arch.mp_state = KVM_MP_STATE_INIT_RECEIVED; > set_bit(KVM_APIC_SIPI, &vcpu->arch.apic->pending_events); > - } else > + } else { > + if (kvm_vcpu_has_lapic(vcpu)) { > + if (mp_state->mp_state == KVM_MP_STATE_INIT_RECEIVED && > + kvm_vcpu_is_bsp(vcpu)) > + vcpu->arch.apic->pending_events = 1UL << KVM_APIC_INIT; > + else > + vcpu->arch.apic->pending_events = 0; > + } > vcpu->arch.mp_state = mp_state->mp_state; > + } > kvm_make_request(KVM_REQ_EVENT, vcpu); > return 0; > } > > ... this patch passes the init.flat kvm-unit-test. > > Tested-by: Paolo Bonzini <pbonzini@redhat.com> Cool, thanks. Jan
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 2609e7b99..efdab35 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6182,8 +6182,16 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, if (mp_state->mp_state == KVM_MP_STATE_SIPI_RECEIVED) { vcpu->arch.mp_state = KVM_MP_STATE_INIT_RECEIVED; set_bit(KVM_APIC_SIPI, &vcpu->arch.apic->pending_events); - } else + } else { + if (kvm_vcpu_has_lapic(vcpu)) { + if (mp_state->mp_state == KVM_MP_STATE_INIT_RECEIVED && + kvm_vcpu_is_bsp(vcpu)) + vcpu->arch.apic->pending_events = 1UL << KVM_APIC_INIT; + else + vcpu->arch.apic->pending_events = 0; + } vcpu->arch.mp_state = mp_state->mp_state; + } kvm_make_request(KVM_REQ_EVENT, vcpu); return 0; }