From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH v2] KVM: x86: Rework INIT and SIPI handling Date: Wed, 13 Mar 2013 13:42:01 +0100 Message-ID: <51407419.3020608@siemens.com> References: <5140662A.7010209@siemens.com> <514070CC.1010202@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , Marcelo Tosatti , kvm To: Paolo Bonzini Return-path: Received: from goliath.siemens.de ([192.35.17.28]:18816 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932086Ab3CMMmF (ORCPT ); Wed, 13 Mar 2013 08:42:05 -0400 In-Reply-To: <514070CC.1010202@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 Cool, thanks. Jan -- Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux