From: "Jason J. Herne" <jjherne@linux.vnet.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
"Jason J. Herne" <jjherne@us.ibm.com>,
afaerber@suse.de, borntraeger@de.ibm.com, agraf@suse.de,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/1] s390-cpu: qom interface for S390 cpu states array
Date: Tue, 11 Mar 2014 08:51:48 -0400 [thread overview]
Message-ID: <531F06E4.6050609@linux.vnet.ibm.com> (raw)
In-Reply-To: <5319FBCC.102@redhat.com>
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" <jjherne@us.ibm.com>
>>
>> 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 <jjherne@us.ibm.com>
>> ---
>> 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)
prev parent reply other threads:[~2014-03-11 12:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-07 16:29 [Qemu-devel] [PATCH 0/1] s390-cpu: qom interface for S390 cpu states array Jason J. Herne
2014-03-07 16:29 ` [Qemu-devel] [PATCH 1/1] " Jason J. Herne
2014-03-07 17:03 ` Paolo Bonzini
2014-03-11 12:51 ` Jason J. Herne [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=531F06E4.6050609@linux.vnet.ibm.com \
--to=jjherne@linux.vnet.ibm.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=jjherne@us.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).