From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNMA8-0002EK-Kp for qemu-devel@nongnu.org; Tue, 11 Mar 2014 08:52:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNM9z-0005ZL-NN for qemu-devel@nongnu.org; Tue, 11 Mar 2014 08:52:04 -0400 Received: from e32.co.us.ibm.com ([32.97.110.150]:56490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNM9z-0005Z7-Gq for qemu-devel@nongnu.org; Tue, 11 Mar 2014 08:51:55 -0400 Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 11 Mar 2014 06:51:53 -0600 Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id B10663E40026 for ; Tue, 11 Mar 2014 06:51:50 -0600 (MDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by b03cxnp08025.gho.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s2BCpo3t7078298 for ; Tue, 11 Mar 2014 13:51:50 +0100 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id s2BCtMGa027896 for ; Tue, 11 Mar 2014 06:55:23 -0600 Message-ID: <531F06E4.6050609@linux.vnet.ibm.com> Date: Tue, 11 Mar 2014 08:51:48 -0400 From: "Jason J. Herne" MIME-Version: 1.0 References: <1394209746-30824-1-git-send-email-jjherne@us.ibm.com> <1394209746-30824-2-git-send-email-jjherne@us.ibm.com> <5319FBCC.102@redhat.com> In-Reply-To: <5319FBCC.102@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/1] s390-cpu: qom interface for S390 cpu states array Reply-To: jjherne@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , "Jason J. Herne" , afaerber@suse.de, borntraeger@de.ibm.com, agraf@suse.de, qemu-devel@nongnu.org On 03/07/2014 12:03 PM, Paolo Bonzini wrote: > Il 07/03/2014 17:29, Jason J. Herne ha scritto: >> From: "Jason J. Herne" >> >> Rename the S390 ipi_states array to cpu_states to better reflect its >> contents. >> >> Create machine/cpu[cpu_addr] links within the qom tree when creating a >> new cpu. >> >> Encapsulate the qom tree linking process and the management of the >> cpu_states >> array into helper functions. >> >> Signed-off-by: Jason J. Herne >> --- >> hw/s390x/s390-virtio.c | 30 ++++++++++++++++++++++++------ >> target-s390x/cpu.h | 1 + >> 2 files changed, 25 insertions(+), 6 deletions(-) >> >> diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c >> index 9eeda97..82411e7 100644 >> --- a/hw/s390x/s390-virtio.c >> +++ b/hw/s390x/s390-virtio.c >> @@ -52,15 +52,33 @@ >> #define ZIPL_FILENAME "s390-zipl.rom" >> >> static VirtIOS390Bus *s390_bus; >> -static S390CPU **ipi_states; >> +static S390CPU **cpu_states; >> >> S390CPU *s390_cpu_addr2state(uint16_t cpu_addr) >> { >> + gchar *name; >> + Object *cpu; >> + >> if (cpu_addr >= smp_cpus) { >> return NULL; >> } >> >> - return ipi_states[cpu_addr]; >> + name = g_strdup_printf("cpu[%i]", cpu_addr); >> + cpu = object_property_get_link(qdev_get_machine(), name, NULL); >> + >> + g_free(name); >> + return S390_CPU(cpu); >> +} > > QOM is too slow to be used in the data path. > > I don't think you want a malloc + a linear scan of an array in > css_inject_io_interrupt, so you should keep using cpu_states here. > Hi Paolo, I agree. Provided Andreas also agrees I'll include this change in my next patch. Thanks. -- -- Jason J. Herne (jjherne@linux.vnet.ibm.com)