xemu/target/s390x
David Hildenbrand ca5c1457d6 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>
2017-09-19 18:31:32 +02:00
..
arch_dump.c exec,dump,i386,ppc,s390x: don't include exec/cpu-all.h explicitly 2017-09-19 18:21:33 +02:00
cc_helper.c target/s390x: introduce internal.h 2017-08-30 18:23:25 +02:00
cpu_features_def.h s390x/cpumodel: wire up new hardware features 2017-07-14 12:29:49 +02:00
cpu_features.c target/s390x: introduce (test|set)_be_bit 2017-07-25 09:17:42 +02:00
cpu_features.h target/s390x: introduce (test|set)_be_bit 2017-07-25 09:17:42 +02:00
cpu_models.c target/s390x: use "core-id" for cpu number/address/id handling 2017-09-19 18:31:32 +02:00
cpu_models.h target/s390x: move some s390x typedefs to cpu-qom.h 2017-09-19 18:31:31 +02:00
cpu-qom.h target/s390x: move some s390x typedefs to cpu-qom.h 2017-09-19 18:31:31 +02:00
cpu.c target/s390x: use "core-id" for cpu number/address/id handling 2017-09-19 18:31:32 +02:00
cpu.h target/s390x: use "core-id" for cpu number/address/id handling 2017-09-19 18:31:32 +02:00
diag.c s390x: move subsystem_reset() to s390-virtio-ccw.h 2017-09-19 18:31:31 +02:00
excp_helper.c target/s390x: use "core-id" for cpu number/address/id handling 2017-09-19 18:31:32 +02:00
fpu_helper.c target/s390x: introduce internal.h 2017-08-30 18:23:25 +02:00
gdbstub.c target/s390x: introduce internal.h 2017-08-30 18:23:25 +02:00
gen-features.c s390/cpumodel: remove KSS from the default model of z14 2017-07-25 09:17:42 +02:00
helper.c target/s390x: use "core-id" for cpu number/address/id handling 2017-09-19 18:31:32 +02:00
helper.h target/s390x: Implement TRTR 2017-07-17 14:13:17 -07:00
insn-data.def target/s390x: Implement TRTR 2017-07-17 14:13:17 -07:00
insn-format.def target/s390x: Implement load-on-condition-2 insns 2017-06-23 09:17:44 -07:00
int_helper.c target/s390x: introduce internal.h 2017-08-30 18:23:25 +02:00
internal.h target/s390x: introduce internal.h 2017-08-30 18:23:25 +02:00
interrupt.c s390x/kvm: move KVM declarations and stubs to separate files 2017-08-30 18:23:26 +02:00
ioinst.c target/s390x: introduce internal.h 2017-08-30 18:23:25 +02:00
kvm_s390x.h s390x/kvm: move KVM declarations and stubs to separate files 2017-08-30 18:23:26 +02:00
kvm-stub.c s390x/kvm: move KVM declarations and stubs to separate files 2017-08-30 18:23:26 +02:00
kvm.c s390x: move s390_virtio_hypercall() to s390-virtio-hcall.h 2017-09-19 18:31:31 +02:00
machine.c s390x/kvm: move KVM declarations and stubs to separate files 2017-08-30 18:23:26 +02:00
Makefile.objs s390x/kvm: move KVM declarations and stubs to separate files 2017-08-30 18:23:26 +02:00
mem_helper.c target/s390x: introduce internal.h 2017-08-30 18:23:25 +02:00
misc_helper.c target/s390x: use "core-id" for cpu number/address/id handling 2017-09-19 18:31:32 +02:00
mmu_helper.c s390x/kvm: move KVM declarations and stubs to separate files 2017-08-30 18:23:26 +02:00
trace-events trace-events: fix code style: print 0x before hex numbers 2017-08-01 12:13:07 +01:00
translate.c target/s390x: use "core-id" for cpu number/address/id handling 2017-09-19 18:31:32 +02:00