qemu-e2k/hw/i386
Igor Mammedov a15d2728a9 pc: Init CPUState->cpu_index with index in possible_cpus[]
It will enshure that cpu_index for a given cpu stays the same
regardless of the order cpus has been created/deleted.

No compat code is needed as for initial cpus index in
possible_cpus[] matches cpu_index that's been auto-allocated
in cpu_exec_init().

Tha same applies for hotplug with cpu-add command if cpus are
added sequentially in increasing order as 'id' matches cpu_index.

If cpu-add had been used for creating out-of-order cpus,
that created unmigratable instance since it were not possible
to start target with the same cpu_index using old way
of migrating instance with hotplugged cpus:

* source QEMU with CLI (-smp 1,maxcpus=3 and cpu-add id=2)
  following set of cpu_index is allocated [0, 1] with
  apics set [0, 2] respectivelly
* target QEMU is started with CLI -smp 2,maxcpus=3
  resulting in set of cpu_index [0, 1] but with
  set of apics [0, 1] wich doesn't match source.

So we don't need compat code in this case as it's never worked
and newelly added device_add support would use stable cpu_index
set by machine to begin with, so it won't have above limitation
and source QEMU could be migrated to destination regardless
of the order cpus were created.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2016-07-26 15:32:08 -03:00
..
kvm pc, pci, virtio: new features, cleanups, fixes 2016-07-21 20:12:37 +01:00
xen include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
acpi-build.c acpi: add DMAR scope definition for root IOAPIC 2016-07-20 19:30:27 +03:00
acpi-build.h Use scripts/clean-includes to drop redundant qemu/typedefs.h 2016-03-22 22:20:16 +01:00
intel_iommu_internal.h intel_iommu: support all masks in interrupt entry cache invalidation 2016-07-21 20:44:19 +03:00
intel_iommu.c intel_iommu: avoid unnamed fields 2016-07-21 20:44:20 +03:00
kvmvapic.c cpu-exec: Rename cpu_resume_from_signal() to cpu_loop_exit_noexc() 2016-06-09 15:55:02 +01:00
Makefile.objs x86-iommu: introduce parent class 2016-07-20 19:30:27 +03:00
multiboot.c hw: explicitly include qemu-common.h and cpu.h 2016-03-22 22:20:17 +01:00
multiboot.h
pc_piix.c xen: fix ram init regression 2016-07-04 14:50:00 +03:00
pc_q35.c hw/iommu: enable iommu with -device 2016-07-04 14:50:58 +03:00
pc_sysfw.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
pc.c pc: Init CPUState->cpu_index with index in possible_cpus[] 2016-07-26 15:32:08 -03:00
pci-assign-load-rom.c pci-assign: Move "Invalid ROM" error message to pci-assign-load-rom.c 2016-06-29 14:03:47 +02:00
trace-events x86-iommu: introduce IEC notifiers 2016-07-21 20:43:49 +03:00
x86-iommu.c x86-iommu: introduce IEC notifiers 2016-07-21 20:43:49 +03:00