From patchwork Wed Sep 25 16:51:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 277932 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E1C682C0246 for ; Thu, 26 Sep 2013 02:54:04 +1000 (EST) Received: from localhost ([::1]:53970 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOsLj-0000tF-2o for incoming@patchwork.ozlabs.org; Wed, 25 Sep 2013 12:54:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOsK0-0006gN-Kl for qemu-devel@nongnu.org; Wed, 25 Sep 2013 12:52:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOsJv-0002ke-VS for qemu-devel@nongnu.org; Wed, 25 Sep 2013 12:52:16 -0400 Received: from smtp.citrix.com ([66.165.176.89]:51042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOsJv-0002k1-Qm for qemu-devel@nongnu.org; Wed, 25 Sep 2013 12:52:11 -0400 X-IronPort-AV: E=Sophos;i="4.90,979,1371081600"; d="scan'208";a="57338161" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 25 Sep 2013 16:52:11 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.2.342.4; Wed, 25 Sep 2013 12:52:11 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1VOsJk-0008KP-Pp; Wed, 25 Sep 2013 17:52:00 +0100 From: Stefano Stabellini To: Date: Wed, 25 Sep 2013 17:51:22 +0100 Message-ID: <1380127883-6421-3-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-DLP: MIA1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.89 Cc: Anthony PERARD , xen-devel@lists.xensource.com, qemu-devel@nongnu.org, Stefano Stabellini Subject: [Qemu-devel] [PULL 3/4] xen: Fix vcpu initialization. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Anthony PERARD Each vcpu need a evtchn binded in qemu, even those that are offline at QEMU initialisation. Signed-off-by: Anthony PERARD Signed-off-by: Stefano Stabellini --- xen-all.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xen-all.c b/xen-all.c index 10af44c..48e881b 100644 --- a/xen-all.c +++ b/xen-all.c @@ -614,13 +614,13 @@ static ioreq_t *cpu_get_ioreq(XenIOState *state) } if (port != -1) { - for (i = 0; i < smp_cpus; i++) { + for (i = 0; i < max_cpus; i++) { if (state->ioreq_local_port[i] == port) { break; } } - if (i == smp_cpus) { + if (i == max_cpus) { hw_error("Fatal error while trying to get io event!\n"); } @@ -1115,10 +1115,10 @@ int xen_hvm_init(MemoryRegion **ram_memory) hw_error("map buffered IO page returned error %d", errno); } - state->ioreq_local_port = g_malloc0(smp_cpus * sizeof (evtchn_port_t)); + state->ioreq_local_port = g_malloc0(max_cpus * sizeof (evtchn_port_t)); /* FIXME: how about if we overflow the page here? */ - for (i = 0; i < smp_cpus; i++) { + for (i = 0; i < max_cpus; i++) { rc = xc_evtchn_bind_interdomain(state->xce_handle, xen_domid, xen_vcpu_eport(state->shared_page, i)); if (rc == -1) {