From: Stefano Stabellini Subject: Re: [PATCH 6/7] xen: Fix vcpus initialisation. Date: Thu, 20 Jun 2013 12:14:01 +0100 Message-ID: References: <1371478402-28082-1-git-send-email-anthony.perard@citrix.com> <1371478549-28527-1-git-send-email-anthony.perard@citrix.com> <1371478549-28527-6-git-send-email-anthony.perard@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1371478549-28527-6-git-send-email-anthony.perard@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Anthony PERARD Cc: Stefano Stabellini , Xen Devel List-Id: xen-devel@lists.xenproject.org On Mon, 17 Jun 2013, Anthony PERARD wrote: > Each vcpu needs a call to xc_evtchn_bind_interdomain in QEMU, even those > that are unplug at QEMU initialisation. > > Without this patch, any hot-plugged CPU will be "Stuck ??" when Linux > will try to use them. > > Signed-off-by: Anthony PERARD Acked-by: Stefano Stabellini > xen-all.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/xen-all.c b/xen-all.c > index daf43b9..15be8ed 100644 > --- a/xen-all.c > +++ b/xen-all.c > @@ -632,13 +632,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"); > } > > @@ -1123,10 +1123,10 @@ int xen_hvm_init(void) > 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) { > -- > Anthony PERARD >