qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RFC 6/6] target-i386: make cpus childs of /machi


From: Igor Mammedov
Subject: Re: [Qemu-devel] [PATCH RFC 6/6] target-i386: make cpus childs of /machine
Date: Tue, 17 Apr 2012 06:28:39 -0400 (EDT)

----- Original Message -----
> From: "Andreas Färber" <address@hidden>
> To: "Paolo Bonzini" <address@hidden>, "Igor Mammedov" <address@hidden>
> Cc: address@hidden, address@hidden, "jan kiszka" <address@hidden>
> Sent: Tuesday, April 17, 2012 10:46:14 AM
> Subject: Re: [PATCH RFC 6/6] target-i386: make cpus childs of /machine
>
> Am 17.04.2012 09:19, schrieb Paolo Bonzini:
> > Il 17/04/2012 01:37, Igor Mammedov ha scritto:
> >> From: Igor Mammedov <address@hidden>
> >>
> >> Signed-off-by: Igor Mammedov <address@hidden>
> >> ---
> >>  target-i386/helper.c |    4 ++++
> >>  1 files changed, 4 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/target-i386/helper.c b/target-i386/helper.c
> >> index de7637c..1996b97 100644
> >> --- a/target-i386/helper.c
> >> +++ b/target-i386/helper.c
> >> @@ -1134,6 +1134,7 @@ CPUX86State *cpu_x86_init(const char
> >> *cpu_model)
> >>      X86CPU *cpu;
> >>      CPUX86State *env;
> >>      Error *errp = NULL;
> >> +    char cpuname[8];
> >>
> >>      cpu = X86_CPU(object_new(TYPE_X86_CPU));
> >>      env = &cpu->env;
> >> @@ -1146,6 +1147,9 @@ CPUX86State *cpu_x86_init(const char
> >> *cpu_model)
> >>          }
> >>      }
> >>
> >> +    snprintf(cpuname, sizeof(cpuname), "cpu%d",
> >> env->cpuid_apic_id);
> >> +    object_property_add_child(container_get("/machine"), cpuname,
> >> OBJECT(cpu), NULL);
> >> +
> >>      object_property_set_bool(OBJECT(cpu), true, "realized",
> >>      &errp);
> >>      if (errp) {
> >>          object_delete(OBJECT(cpu));
> >
> > I think the right name would be /machine/cpu[%d]/cpu.  The local
> > APIC
> > for example should reside under /machine/cpu[%d]/apic.
>
> Depends on how we model the CPU, I was kinda waiting for feedback on
> that.
>
> I would prefer /machine/cpu[%d], with the APIC being a child
> .../apic,
> if possible. That however depends on how the device'ification of the
> CPU
Ok, I'll change /machine/cpu%d to /machine/cpu[%d].

> for hotplug works out - issue being that the CPU is a cross-target
> base
> class where we'd need to change its parent to something that's a
> device
> for device_add, on a hot-pluggable bus (for now) and works for all
> targets.
We could just enable hotplugging in sysbus so that it won't prevent
hotplugging apic for now. And for cpu hotplug use links as Anthony
suggested. However we need storage for keeping link references, cpu
list (I mean: first_cpu...) could be used for it now. But I'd like
to make shallow conversion of cpu list to a pre-allocated cpu array
for maxcpus. that will provide storage for pre-allocated links and
fix/simplify cpu_index allocation for repeated cpu add/remove ops.

After that probably would be a good time to hack device_add/del for
cpu hot-plug.

>
> Andreas
>
> --
> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG
> Nürnberg
>



reply via email to

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