[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/15] target-i386: introduce apic-id property
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH 04/15] target-i386: introduce apic-id property |
Date: |
Fri, 26 Apr 2013 18:46:50 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 |
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.
>
> Signed-off-by: Igor Mammedov <address@hidden>
> ---
> Note:
> * pc_new_cpu() function will be reused later in CPU hot-plug hook.
>
> 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 != 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 = value;
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- [Qemu-devel] [PATCH 01/15] exec: add qemu_for_each_cpu, (continued)
- Re: [Qemu-devel] [PATCH 04/15] target-i386: introduce apic-id property, Eduardo Habkost, 2013/04/26
- Re: [Qemu-devel] [PATCH 04/15] target-i386: introduce apic-id property,
Andreas Färber <=
- [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id one CPU is realized, Igor Mammedov, 2013/04/26
- Re: [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id one CPU is realized, Andreas Färber, 2013/04/26
- Re: [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id one CPU is realized, Igor Mammedov, 2013/04/26
- [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id once CPU is realized, Igor Mammedov, 2013/04/26
- Re: [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id once CPU is realized, Andreas Färber, 2013/04/27
- Re: [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id one CPU is realized, Eduardo Habkost, 2013/04/26
[Qemu-devel] [PATCH 02/15] cpu: add helper cpu_exists(), to check if CPU with specified id exists, Igor Mammedov, 2013/04/25
[Qemu-devel] [PATCH 05/15] target-i386: introduce ICC bus/device/bridge, Igor Mammedov, 2013/04/25