qemu-e2k/include
Bharata B Rao b7bca73334 cpu: Convert cpu_index into a bitmap
Currently CPUState::cpu_index is monotonically increasing and a newly
created CPU always gets the next higher index. The next available
index is calculated by counting the existing number of CPUs. This is
fine as long as we only add CPUs, but there are architectures which
are starting to support CPU removal, too. For an architecture like PowerPC
which derives its CPU identifier (device tree ID) from cpu_index, the
existing logic of generating cpu_index values causes problems.

With the currently proposed method of handling vCPU removal by parking
the vCPU fd in QEMU
(Ref: http://lists.gnu.org/archive/html/qemu-devel/2015-02/msg02604.html),
generating cpu_index this way will not work for PowerPC.

This patch changes the way cpu_index is handed out by maintaining
a bit map of the CPUs that tracks both addition and removal of CPUs.

The CPU bitmap allocation logic is part of cpu_exec_init(), which is
called by instance_init routines of various CPU targets. Newly added
cpu_exec_exit() API handles the deallocation part and this routine is
called from generic CPU instance_finalize.

Note: This new CPU enumeration is for !CONFIG_USER_ONLY only.
CONFIG_USER_ONLY continues to have the old enumeration logic.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
[AF: max_cpus -> MAX_CPUMASK_BITS]
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-07-09 15:20:40 +02:00
..
block blockjob: add block_job_release function 2015-07-07 14:27:14 +01:00
crypto crypto: introduce generic cipher API & built-in implementation 2015-07-08 13:11:01 +02:00
disas disas: Remove uses of CPU env 2015-06-22 17:40:01 +02:00
exec cpu: Add Error argument to cpu_exec_init() 2015-07-09 15:20:40 +02:00
fpu softfloat: expand out STATUS macro 2015-02-06 16:11:38 +00:00
hw Bugfixes and Daniel Berrange's crypto library. 2015-07-08 20:46:35 +01:00
libdecnumber Fix new typos in comments (found by codespell) 2014-07-18 17:45:36 +04:00
migration migration: Make events a capability 2015-07-07 14:54:55 +02:00
monitor Include monitor/monitor.h exactly where needed 2015-06-22 18:20:41 +02:00
net qmp: Wean off qerror_report() 2015-06-22 18:20:40 +02:00
qapi qerror: Move #include out of qerror.h 2015-06-22 18:20:40 +02:00
qemu crypto: move built-in AES implementation into crypto/ 2015-07-07 12:04:13 +02:00
qom cpu: Convert cpu_index into a bitmap 2015-07-09 15:20:40 +02:00
standard-headers virtio: define virtio_pci_cfg_cap in header. 2015-07-08 10:09:56 +03:00
sysemu runstate: Add runstate store 2015-07-07 14:54:51 +02:00
ui Include monitor/monitor.h exactly where needed 2015-06-22 18:20:41 +02:00
config.h janitor: move remaining public headers to include/ 2012-12-19 08:32:46 +01:00
elf.h linux/elf.h update 2015-05-27 17:52:03 +02:00
glib-compat.h glib: remove stale compat functions 2015-05-22 15:58:06 -04:00
qemu-common.h Stop including qemu-common.h in memory.h 2015-07-06 14:59:09 +02:00
qemu-io.h qemu-io: Use BlockBackend 2015-02-16 15:07:19 +00:00
qjson.h QJSON: Add JSON writer 2015-02-05 17:16:14 +01:00
trace-tcg.h trace: [tcg] Generate TCG tracing routines 2014-08-12 14:26:12 +01:00
trace.h trace: [tcg] Include event definitions in "trace.h" 2014-08-12 14:26:12 +01:00