From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adm4y-0005Km-5M for qemu-devel@nongnu.org; Wed, 09 Mar 2016 16:55:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adm4t-00049U-Az for qemu-devel@nongnu.org; Wed, 09 Mar 2016 16:55:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adm4t-00049Q-51 for qemu-devel@nongnu.org; Wed, 09 Mar 2016 16:55:35 -0500 References: <1457544488-5276-1-git-send-email-cornelia.huck@de.ibm.com> <1457544488-5276-5-git-send-email-cornelia.huck@de.ibm.com> From: Thomas Huth Message-ID: <56E09BD2.9070803@redhat.com> Date: Wed, 9 Mar 2016 22:55:30 +0100 MIME-Version: 1.0 In-Reply-To: <1457544488-5276-5-git-send-email-cornelia.huck@de.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.6 04/10] s390x/cpu: Tolerate max_cpus List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck , qemu-devel@nongnu.org Cc: Matthew Rosato , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, agraf@suse.de, Markus Armbruster On 09.03.2016 18:28, Cornelia Huck wrote: > From: Matthew Rosato > > Once hotplug is enabled, interrupts may come in for CPUs > with an address > smp_cpus. Allocate for this and allow > search routines to look beyond smp_cpus. > > Signed-off-by: Matthew Rosato > Message-Id: <1457112875-5209-5-git-send-email-mjrosato@linux.vnet.ibm.com> > Reviewed-by: David Hildenbrand > Signed-off-by: Cornelia Huck > --- > hw/s390x/s390-virtio.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c > index c501a48..57c3c88 100644 > --- a/hw/s390x/s390-virtio.c > +++ b/hw/s390x/s390-virtio.c ... > @@ -101,14 +102,14 @@ void s390_init_cpus(MachineState *machine) > machine->cpu_model = "host"; > } > > - ipi_states = g_malloc(sizeof(S390CPU *) * smp_cpus); > + cpu_states = g_malloc0(sizeof(S390CPU *) * max_cpus); While you're at it, it might be better to use g_new0 here instead (see e.g. https://patchwork.ozlabs.org/patch/517377/ for a description why this is better). Thomas