From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: qemu-kvm requires apic initialized before vcpu main loop Date: Wed, 9 Dec 2009 21:20:49 +0200 Message-ID: <20091209192049.GB8739@redhat.com> References: <20091209174654.GA28056@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Glauber de Oliveira Costa , kvm To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:39933 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757255AbZLITUn (ORCPT ); Wed, 9 Dec 2009 14:20:43 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB9JKo3x010480 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 9 Dec 2009 14:20:50 -0500 Content-Disposition: inline In-Reply-To: <20091209174654.GA28056@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Dec 09, 2009 at 03:46:54PM -0200, Marcelo Tosatti wrote: > > Otherwise a zero apic base is loaded into KVM, which results > in interrupts being lost until a proper apic base with enabled > bit set is loaded. > > Fixes WinXP migration in qemu-kvm origin/next. > > Signed-off-by: Marcelo Tosatti > > diff --git a/hw/apic.c b/hw/apic.c > index 627ff98..45a4d2b 100644 > --- a/hw/apic.c > +++ b/hw/apic.c > @@ -1131,6 +1131,11 @@ int apic_init(CPUState *env) > vmstate_register(s->idx, &vmstate_apic, s); > qemu_register_reset(apic_reset, s); > > + /* apic_reset must be called before the vcpu threads are initialized and load > + * registers, in qemu-kvm. > + */ > + apic_reset(s); > + > local_apics[s->idx] = s; > return 0; > } Didn't calls to reset90 were removed from init functions to be done in centralized manner? -- Gleb.