From patchwork Wed Dec 9 17:46:54 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 66023 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB9HlTiU004772 for ; Wed, 9 Dec 2009 17:47:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752650AbZLIRrU (ORCPT ); Wed, 9 Dec 2009 12:47:20 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752272AbZLIRrU (ORCPT ); Wed, 9 Dec 2009 12:47:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10660 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751681AbZLIRrT (ORCPT ); Wed, 9 Dec 2009 12:47:19 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB9HlQO9032041 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 9 Dec 2009 12:47:26 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nB9HlQqD027406; Wed, 9 Dec 2009 12:47:26 -0500 Received: from amt.cnet (vpn-10-232.rdu.redhat.com [10.11.10.232]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id nB9HlONC008735; Wed, 9 Dec 2009 12:47:25 -0500 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id A08F768012D; Wed, 9 Dec 2009 15:46:55 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id nB9HksTG028073; Wed, 9 Dec 2009 15:46:54 -0200 Date: Wed, 9 Dec 2009 15:46:54 -0200 From: Marcelo Tosatti To: Avi Kivity , Glauber de Oliveira Costa Cc: kvm Subject: qemu-kvm requires apic initialized before vcpu main loop Message-ID: <20091209174654.GA28056@amt.cnet> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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; }