mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
target/s390x: use "core-id" for cpu number/address/id handling
Some time ago we discussed that using "id" as property name is not the right thing to do, as it is a reserved property for other devices and will not work with device_add. Switch to the term "core-id" instead, and use it as an equivalent to "CPU address" mentioned in the PoP. There is no such thing as cpu number, so rename env.cpu_num to env.core_id. We use "core-id" as this is the common term to use for device_add later on (x86 and ppc). We can get rid of cpu->id now. Keep cpu_index and env->core_id in sync. cpu_index was already implicitly used by e.g. cpu_exists(), so keeping both in sync seems to be the right thing to do. cpu_index will now no longer automatically get set via cpu_exec_realizefn(). For now, we were lucky that both implicitly stayed in sync. Our new cpu property "core-id" can be a static property. Range checks can be avoided by using the correct type and the "setting after realized" check is done implicitly. device_add will later need the reserved "id" property. Hotplugging a CPU on s390x will then be: "device_add host-s390-cpu,id=cpu2,core-id=2". Reviewed-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20170913132417.24384-14-david@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
This commit is contained in:
parent
88556edd74
commit
ca5c1457d6
8 changed files with 30 additions and 66 deletions
|
@ -150,7 +150,7 @@ struct CPUS390XState {
|
|||
|
||||
CPU_COMMON
|
||||
|
||||
uint32_t cpu_num;
|
||||
uint32_t core_id; /* PoP "CPU address", same as cpu_index */
|
||||
uint64_t cpuid;
|
||||
|
||||
uint64_t tod_offset;
|
||||
|
@ -194,7 +194,6 @@ struct S390CPU {
|
|||
/*< public >*/
|
||||
|
||||
CPUS390XState env;
|
||||
int64_t id;
|
||||
S390CPUModel *model;
|
||||
/* needed for live migration */
|
||||
void *irqstate;
|
||||
|
@ -690,7 +689,7 @@ const char *s390_default_cpu_model_name(void);
|
|||
|
||||
/* helper.c */
|
||||
#define cpu_init(cpu_model) cpu_generic_init(TYPE_S390_CPU, cpu_model)
|
||||
S390CPU *s390x_new_cpu(const char *cpu_model, int64_t id, Error **errp);
|
||||
S390CPU *s390x_new_cpu(const char *cpu_model, uint32_t core_id, Error **errp);
|
||||
/* you can call this signal handler from your SIGBUS and SIGSEGV
|
||||
signal handlers to inform the virtual CPU of exceptions. non zero
|
||||
is returned if the signal was handled by the virtual CPU. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue