qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/1] s390-cpu: qom interface for S390 cpu states


From: Jason J. Herne
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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

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" <address@hidden>

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 <address@hidden>
---
 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 (address@hidden)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]