qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 8/8] [PATCH RFC v2] s390-qemu: cpu hotplug - Tre


From: Jason J. Herne
Subject: Re: [Qemu-devel] [PATCH 8/8] [PATCH RFC v2] s390-qemu: cpu hotplug - Treat S390 cpus as devices
Date: Tue, 30 Jul 2013 10:27:26 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7

On 07/30/2013 03:24 AM, Igor Mammedov wrote:
On Mon, 29 Jul 2013 15:41:57 -0400
"Jason J. Herne" <address@hidden> wrote:

On 06/08/2013 09:11 PM, Andreas Färber wrote:
   if (tcg_enabled() && !inited) {
          inited = true;
          s390x_translate_init();
      }
+
+    smp_cpus += 1;
Won't we need some form of locking?

If we fiddle with a global CPU counter, we should do so in qom/cpu.c,
not just in s390x code.


I've redesigned a lot of this to make it simpler and less intrusive.
I'm almost ready to post the next revision but I'm hung up on this one
thing.

I moved the smp_cpu increment to qom/cpu.c : cpu_common_realizefn.
However this seems to break the user mode target because smp_cpus does
not exist.  I tried wrapping the increment in a #ifndef CONFIG_USER_ONLY
statement but it seems to have no effect.  I think the reason for that
is because CONFIG_USER_ONLY is added to config-target.h which is not
actually generated until after we compile qom/cpu.c.

...
    CC    qom/object.o
    CC    qom/container.o
    CC    qom/qom-qobject.o
    CC    qom/cpu.o
    CC    hw/core/qdev.o
    CC    hw/core/qdev-properties.o
    CC    hw/core/irq.o
    GEN   s390x-linux-user/config-target.h
    CC    s390x-linux-user/exec.o
...

Is there another place I should put the increment?

Could you just use current number of cpus instead of smp_cpus increment?


Is there an easier way of getting the count besides this?

int cpu_count = 0;
for (cpu = first_cpu; cpu != NULL; cpu = cpu->next_cpu) {
    cpu_count++;
}




--
-- Jason J. Herne (address@hidden)




reply via email to

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