From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVlnS-0005PD-BQ for qemu-devel@nongnu.org; Fri, 26 Apr 2013 12:46:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVlnR-0004xx-6x for qemu-devel@nongnu.org; Fri, 26 Apr 2013 12:46:54 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35863 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVlnQ-0004xp-UJ for qemu-devel@nongnu.org; Fri, 26 Apr 2013 12:46:53 -0400 Message-ID: <517AAF7A.1080604@suse.de> Date: Fri, 26 Apr 2013 18:46:50 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1366898737-6201-1-git-send-email-imammedo@redhat.com> <1366898737-6201-5-git-send-email-imammedo@redhat.com> In-Reply-To: <1366898737-6201-5-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 04/15] target-i386: introduce apic-id property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, ehabkost@redhat.com, mst@redhat.com, stefano.stabellini@eu.citrix.com, qemu-devel@nongnu.org, quintela@redhat.com, anthony.perard@citrix.com, pbonzini@redhat.com Am 25.04.2013 16:05, schrieb Igor Mammedov: > The property is used from board level to set APIC ID for CPUs it > creates. Do so in a new pc_new_cpu() helper, to be reused for hot-plug. >=20 > Signed-off-by: Igor Mammedov > --- > Note: > * pc_new_cpu() function will be reused later in CPU hot-plug hook. >=20 > v4: > * after switching to qemu_for_each_cpu() in cpu_exists(), first CPU > becomes visible to cpu_exists() early and setting property fails, > skip APIC ID check if value to be set is the same as the current. > * use error_propagate() in pc_new_cpu() > * return CPU from pc_new_cpu(). Moved from "move APIC to ICC bus" > to reduce its size. > v3: > * user error_propagate() in property setter > v2: > * use generic cpu_exists() instead of custom one > * make apic-id dynamic property, so it won't be possible to use it > as global property, since it's instance specific > --- > hw/i386/pc.c | 29 ++++++++++++++++++++++++++++- > target-i386/cpu.c | 42 ++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 70 insertions(+), 1 deletions(-) Thanks, applied to qom-cpu (with change suggested on v4 below): https://github.com/afaerber/qemu-cpu/commits/qom-cpu Question: This being a dynamic QOM property, QMP qom-set apic-id allows to change the value during runtime. Should we suppress this with a dev->realized check? If so, please supply a follow-up patch. Andreas diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 0be0138..f1cecc0 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1295,16 +1295,14 @@ static void x86_cpuid_set_apic_id(Object *obj, Visitor *v, void *opaque, return; } if (value < min || value > max) { - error_setg(&error, "Property %s.%s doesn't take value %" PRId64 + error_setg(errp, "Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ", maximum: %" PRId64 ")" , object_get_typename(obj), name, value, min, max); - error_propagate(errp, error); return; } if ((value !=3D cpu->env.cpuid_apic_id) && cpu_exists(value)) { - error_setg(&error, "CPU with APIC ID %" PRIi64 " exists", value)= ; - error_propagate(errp, error); + error_setg(errp, "CPU with APIC ID %" PRIi64 " exists", value); return; } cpu->env.cpuid_apic_id =3D value; --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg